@lcap/nasl 3.3.0-alpha.3 → 3.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/bak/translator.js +8 -5
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/AfterStartNode.js +2 -1
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -1
- package/out/breakpoint/generator/BeforeEndNode.js +2 -1
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.js +30 -9
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.d.ts +1 -0
- package/out/breakpoint/shared/constants.js +7 -1
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.d.ts +3 -1
- package/out/breakpoint/shared/utils.js +25 -4
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +21 -8
- package/out/common/BaseNode.js +115 -69
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.js +6 -1
- package/out/common/Command.js.map +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/common/EventEmitter.js +1 -3
- package/out/common/EventEmitter.js.map +1 -1
- package/out/common/index.d.ts +0 -1
- package/out/common/index.js +0 -1
- package/out/common/index.js.map +1 -1
- package/out/concepts/Abort__.d.ts +3 -2
- package/out/concepts/Abort__.js +15 -18
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +3 -3
- package/out/concepts/Anchor__.js +18 -35
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +3 -3
- package/out/concepts/AnonymousFunction__.js +29 -53
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +160 -157
- package/out/concepts/App__.js +106 -80
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +3 -3
- package/out/concepts/Argument__.js +22 -42
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +3 -2
- package/out/concepts/Assignee__.js +19 -21
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +3 -2
- package/out/concepts/AssignmentLine__.js +15 -17
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +3 -3
- package/out/concepts/Assignment__.js +34 -42
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +3 -2
- package/out/concepts/Attribute__.js +36 -28
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +4 -3
- package/out/concepts/AuthInterface__.js +16 -17
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +4 -3
- package/out/concepts/AuthLogicForCallInterface__.js +37 -27
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.d.ts +4 -3
- package/out/concepts/AuthLogic__.js +18 -19
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +8 -7
- package/out/concepts/BackendVariable__.js +39 -34
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +32 -31
- package/out/concepts/Backend__.js +23 -22
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +3 -3
- package/out/concepts/BatchAssignment__.js +46 -54
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +3 -3
- package/out/concepts/BinaryExpression__.js +30 -62
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +12 -9
- package/out/concepts/BindAttribute__.js +81 -102
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +5 -3
- package/out/concepts/BindDirective__.js +34 -28
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +3 -3
- package/out/concepts/BindEvent__.js +51 -74
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +5 -3
- package/out/concepts/BindStyle__.js +24 -23
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +3 -3
- package/out/concepts/BooleanLiteral__.js +17 -24
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +3 -2
- package/out/concepts/CallAuthInterface__.js +17 -19
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +5 -4
- package/out/concepts/CallConnector__.js +41 -34
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +3 -3
- package/out/concepts/CallFunction__.js +33 -71
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +3 -3
- package/out/concepts/CallInterface__.js +26 -57
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +6 -6
- package/out/concepts/CallLogic__.js +135 -180
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +3 -2
- package/out/concepts/CallQueryComponent__.js +57 -41
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +3 -3
- package/out/concepts/Comment__.js +17 -24
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +3 -2
- package/out/concepts/CompletionProperty__.js +30 -25
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +3 -2
- package/out/concepts/ConfigGroup__.js +21 -20
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +3 -2
- package/out/concepts/ConfigPropertyValue__.js +16 -16
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +3 -2
- package/out/concepts/ConfigProperty__.js +26 -23
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +3 -2
- package/out/concepts/Configuration__.js +16 -18
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +4 -4
- package/out/concepts/Connection__.js +22 -18
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.d.ts +7 -6
- package/out/concepts/ConnectorTrigger__.js +22 -21
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.d.ts +139 -33
- package/out/concepts/Connector__.js +191 -34
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +3 -2
- package/out/concepts/Constant__.js +25 -23
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +7 -2
- package/out/concepts/DataSource__.js +31 -23
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +5 -4
- package/out/concepts/DatabaseTypeAnnotation__.js +18 -18
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +11 -11
- package/out/concepts/Destination__.js +39 -89
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +3 -2
- package/out/concepts/End__.js +15 -17
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +4 -3
- package/out/concepts/EntityIndex__.js +23 -21
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +4 -4
- package/out/concepts/EntityProperty__.js +51 -67
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +3 -3
- package/out/concepts/Entity__.js +32 -51
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +3 -3
- package/out/concepts/EnumItem__.js +19 -25
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +3 -3
- package/out/concepts/Enum__.js +23 -35
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.d.ts +3 -2
- package/out/concepts/Event__.js +24 -21
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +6 -5
- package/out/concepts/ExternalDestination__.js +25 -25
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +3 -3
- package/out/concepts/ForEachStatement__.js +21 -60
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +4 -3
- package/out/concepts/FrontendLibrary__.js +27 -25
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendVariable__.d.ts +4 -3
- package/out/concepts/FrontendVariable__.js +12 -12
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +8 -6
- package/out/concepts/Frontend__.js +47 -39
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +3 -3
- package/out/concepts/Function__.js +37 -60
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +4 -3
- package/out/concepts/Identifier__.js +30 -29
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +3 -3
- package/out/concepts/IfStatement__.js +21 -51
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +93 -2
- package/out/concepts/Integration__.js +157 -19
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +30 -4
- package/out/concepts/InterfaceParam__.js +58 -24
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +31 -5
- package/out/concepts/Interface__.js +89 -34
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +3 -3
- package/out/concepts/JSBlock__.js +17 -24
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +4 -3
- package/out/concepts/JavaLogic__.js +22 -21
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +3 -8
- package/out/concepts/LogicItem__.js +23 -30
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +17 -18
- package/out/concepts/Logic__.js +113 -179
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +3 -3
- package/out/concepts/MatchCase__.js +23 -110
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +3 -3
- package/out/concepts/Match__.js +20 -64
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +3 -3
- package/out/concepts/MemberExpression__.js +65 -59
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +3 -2
- package/out/concepts/MicroApp__.js +26 -21
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +219 -47
- package/out/concepts/Module__.js +232 -32
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.d.ts +4 -3
- package/out/concepts/MsgTriggerEvent__.js +16 -18
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.d.ts +4 -3
- package/out/concepts/MsgTriggerLauncher__.js +18 -19
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +4 -2
- package/out/concepts/Namespace__.js +64 -46
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +4 -3
- package/out/concepts/NewComposite__.js +71 -133
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +5 -4
- package/out/concepts/NewList__.js +35 -41
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +5 -4
- package/out/concepts/NewMap__.js +39 -38
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +3 -2
- package/out/concepts/New__.js +15 -17
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +3 -2
- package/out/concepts/NullLiteral__.js +15 -17
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +3 -3
- package/out/concepts/NumericLiteral__.js +21 -27
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +3 -3
- package/out/concepts/OqlQueryComponent__.js +26 -30
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +14 -22
- package/out/concepts/OverriddenLogic__.js +73 -62
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.d.ts +3 -3
- package/out/concepts/Param__.js +34 -69
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.d.ts +3 -2
- package/out/concepts/Point__.js +16 -16
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.d.ts +3 -2
- package/out/concepts/ProcessComponent__.js +24 -22
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +3 -2
- package/out/concepts/ProcessElement__.js +61 -46
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +3 -2
- package/out/concepts/ProcessOutcome__.js +17 -18
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +3 -2
- package/out/concepts/ProcessOutcomes__.js +15 -17
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +5 -7
- package/out/concepts/Process__.js +46 -35
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +3 -2
- package/out/concepts/QueryAggregateExpression__.js +23 -22
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +4 -3
- package/out/concepts/QueryFieldExpression__.js +21 -20
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +4 -3
- package/out/concepts/QueryFromExpression__.js +23 -22
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +3 -2
- package/out/concepts/QueryGroupByExpression__.js +18 -19
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +4 -3
- package/out/concepts/QueryJoinExpression__.js +29 -25
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +3 -2
- package/out/concepts/QueryLimitExpression__.js +22 -22
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +3 -2
- package/out/concepts/QueryOrderByExpression__.js +22 -22
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +3 -2
- package/out/concepts/QuerySelectExpression__.js +23 -21
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.d.ts +3 -2
- package/out/concepts/Rect__.js +20 -18
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +3 -3
- package/out/concepts/Return__.js +29 -45
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +3 -2
- package/out/concepts/Role__.js +22 -21
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +3 -2
- package/out/concepts/SelectMembers__.js +20 -21
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.d.ts +3 -2
- package/out/concepts/Slot__.js +26 -22
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +3 -3
- package/out/concepts/SqlQueryComponent__.js +28 -31
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +3 -2
- package/out/concepts/Start__.js +15 -17
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +3 -3
- package/out/concepts/StringInterpolation__.js +17 -37
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +3 -3
- package/out/concepts/StringLiteral__.js +14 -22
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +5 -5
- package/out/concepts/StructureProperty__.js +33 -40
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +3 -12
- package/out/concepts/Structure__.js +45 -46
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +3 -3
- package/out/concepts/SwitchCase__.js +19 -54
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +3 -3
- package/out/concepts/SwitchStatement__.js +23 -39
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.d.ts +3 -2
- package/out/concepts/Theme__.js +12 -14
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +3 -2
- package/out/concepts/Transactional__.js +18 -17
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +3 -2
- package/out/concepts/TriggerEvent__.js +19 -18
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +6 -17
- package/out/concepts/TriggerLauncher__.js +26 -63
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -6
- package/out/concepts/TypeAnnotation__.js +56 -79
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +3 -3
- package/out/concepts/TypeParam__.js +16 -23
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +3 -3
- package/out/concepts/UnaryExpression__.js +21 -39
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +3 -3
- package/out/concepts/Unparsed__.js +16 -23
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.d.ts +3 -2
- package/out/concepts/UseComponent__.js +16 -16
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +17 -16
- package/out/concepts/ValidationRule__.js +18 -15
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +3 -3
- package/out/concepts/Variable__.js +29 -45
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.d.ts +4 -3
- package/out/concepts/ViewBlock__.js +20 -19
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +32 -31
- package/out/concepts/ViewComponent__.js +35 -32
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +82 -81
- package/out/concepts/ViewElement__.js +259 -155
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +5 -4
- package/out/concepts/View__.js +138 -174
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +3 -3
- package/out/concepts/WhileStatement__.js +20 -41
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/index__.d.ts +0 -1
- package/out/concepts/index__.js +0 -1
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/types__.d.ts +2 -2
- package/out/decorators/index.d.ts +2 -0
- package/out/decorators/index.js +12 -8
- package/out/decorators/index.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +2 -2
- package/out/generator/genBundleFiles.js +11 -4
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +4 -2
- package/out/generator/genReleaseBody.js +192 -136
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/index.d.ts +0 -1
- package/out/index.js +0 -1
- package/out/index.js.map +1 -1
- package/out/sentry/index.js +2 -2
- package/out/sentry/index.js.map +1 -1
- package/out/server/createUiTs.js +34 -1
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/extendBaseNode.js +17 -17
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +0 -10
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getConnector.d.ts +3 -0
- package/out/server/getConnector.js +38 -1
- package/out/server/getConnector.js.map +1 -1
- package/out/server/getMemberIdentifier.js +1 -2
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/index.js +2 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +14 -3
- package/out/server/naslServer.js +207 -117
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +2 -4
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/add.configs.js +26 -0
- package/out/service/creator/add.configs.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -3
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/creator/index.js +13 -0
- package/out/service/creator/index.js.map +1 -1
- package/out/service/storage/init.js +0 -16
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/jsoner.js +1 -1
- package/out/service/storage/jsoner.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +1 -1
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/translator/constant.d.ts +6 -0
- package/out/translator/constant.js +10 -0
- package/out/translator/constant.js.map +1 -0
- package/out/translator/index.d.ts +3 -48
- package/out/translator/index.js +17 -110
- package/out/translator/index.js.map +1 -1
- package/out/translator/types.d.ts +32 -0
- package/out/translator/{tsp.js → types.js} +1 -1
- package/out/translator/types.js.map +1 -0
- package/out/translator/utils.d.ts +17 -0
- package/out/translator/utils.js +102 -0
- package/out/translator/utils.js.map +1 -0
- package/out/utils/cookie.d.ts +9 -0
- package/out/utils/cookie.js +62 -0
- package/out/utils/cookie.js.map +1 -0
- package/out/utils/index.d.ts +2 -0
- package/out/utils/index.js +2 -0
- package/out/utils/index.js.map +1 -1
- package/out/utils/logger.d.ts +4 -0
- package/out/utils/logger.js +13 -1
- package/out/utils/logger.js.map +1 -1
- package/out/utils/types.d.ts +1 -0
- package/out/utils/types.js +3 -0
- package/out/utils/types.js.map +1 -0
- package/out/utils/window.d.ts +7 -0
- package/out/utils/window.js +14 -0
- package/out/utils/window.js.map +1 -0
- package/package.json +5 -11
- package/sandbox/stdlib/nasl.oql.ts +2 -0
- package/sandbox/stdlib/nasl.ui.definition.ts +2218 -1415
- package/src/bak/translator.js +8 -5
- package/src/breakpoint/generator/AfterStartNode.ts +2 -1
- package/src/breakpoint/generator/BeforeEndNode.ts +2 -1
- package/src/breakpoint/generator/BreakpointNode.ts +36 -9
- package/src/breakpoint/shared/constants.ts +7 -0
- package/src/breakpoint/shared/utils.ts +36 -3
- package/src/common/BaseNode.ts +140 -81
- package/src/common/Command.ts +6 -1
- package/src/common/EventEmitter.ts +2 -4
- package/src/common/index.ts +0 -1
- package/src/concepts/Abort__.ts +20 -22
- package/src/concepts/Anchor__.ts +23 -38
- package/src/concepts/AnonymousFunction__.ts +39 -63
- package/src/concepts/App__.ts +364 -314
- package/src/concepts/Argument__.ts +27 -44
- package/src/concepts/Assignee__.ts +41 -39
- package/src/concepts/AssignmentLine__.ts +20 -23
- package/src/concepts/Assignment__.ts +54 -58
- package/src/concepts/Attribute__.ts +40 -34
- package/src/concepts/AuthInterface__.ts +22 -24
- package/src/concepts/AuthLogicForCallInterface__.ts +71 -41
- package/src/concepts/AuthLogic__.ts +21 -30
- package/src/concepts/BackendVariable__.ts +55 -54
- package/src/concepts/Backend__.ts +58 -59
- package/src/concepts/BatchAssignment__.ts +88 -78
- package/src/concepts/BinaryExpression__.ts +72 -66
- package/src/concepts/BindAttribute__.ts +135 -155
- package/src/concepts/BindDirective__.ts +45 -41
- package/src/concepts/BindEvent__.ts +80 -89
- package/src/concepts/BindStyle__.ts +37 -36
- package/src/concepts/BooleanLiteral__.ts +22 -28
- package/src/concepts/CallAuthInterface__.ts +29 -32
- package/src/concepts/CallConnector__.ts +50 -41
- package/src/concepts/CallFunction__.ts +45 -77
- package/src/concepts/CallInterface__.ts +36 -68
- package/src/concepts/CallLogic__.ts +166 -213
- package/src/concepts/CallQueryComponent__.ts +156 -88
- package/src/concepts/Comment__.ts +22 -29
- package/src/concepts/CompletionProperty__.ts +34 -30
- package/src/concepts/ConfigGroup__.ts +28 -29
- package/src/concepts/ConfigPropertyValue__.ts +22 -23
- package/src/concepts/ConfigProperty__.ts +42 -36
- package/src/concepts/Configuration__.ts +23 -26
- package/src/concepts/Connection__.ts +26 -21
- package/src/concepts/ConnectorTrigger__.ts +30 -34
- package/src/concepts/Connector__.ts +342 -87
- package/src/concepts/Constant__.ts +30 -36
- package/src/concepts/DataSource__.ts +37 -33
- package/src/concepts/DatabaseTypeAnnotation__.ts +24 -24
- package/src/concepts/Destination__.ts +51 -104
- package/src/concepts/End__.ts +23 -25
- package/src/concepts/EntityIndex__.ts +36 -33
- package/src/concepts/EntityProperty__.ts +64 -84
- package/src/concepts/Entity__.ts +41 -67
- package/src/concepts/EnumItem__.ts +24 -32
- package/src/concepts/Enum__.ts +28 -42
- package/src/concepts/Event__.ts +33 -33
- package/src/concepts/ExternalDestination__.ts +29 -29
- package/src/concepts/ForEachStatement__.ts +34 -73
- package/src/concepts/FrontendLibrary__.ts +37 -38
- package/src/concepts/FrontendVariable__.ts +18 -20
- package/src/concepts/Frontend__.ts +66 -62
- package/src/concepts/Function__.ts +54 -80
- package/src/concepts/Identifier__.ts +37 -34
- package/src/concepts/IfStatement__.ts +40 -77
- package/src/concepts/Integration__.ts +244 -24
- package/src/concepts/InterfaceParam__.ts +69 -33
- package/src/concepts/Interface__.ts +104 -46
- package/src/concepts/JSBlock__.ts +22 -28
- package/src/concepts/JavaLogic__.ts +27 -26
- package/src/concepts/LogicItem__.ts +29 -47
- package/src/concepts/Logic__.ts +168 -214
- package/src/concepts/MatchCase__.ts +38 -128
- package/src/concepts/Match__.ts +28 -73
- package/src/concepts/MemberExpression__.ts +174 -139
- package/src/concepts/MicroApp__.ts +32 -27
- package/src/concepts/Module__.ts +527 -107
- package/src/concepts/MsgTriggerEvent__.ts +25 -33
- package/src/concepts/MsgTriggerLauncher__.ts +27 -30
- package/src/concepts/Namespace__.ts +109 -99
- package/src/concepts/NewComposite__.ts +130 -161
- package/src/concepts/NewList__.ts +45 -51
- package/src/concepts/NewMap__.ts +51 -48
- package/src/concepts/New__.ts +20 -22
- package/src/concepts/NullLiteral__.ts +20 -22
- package/src/concepts/NumericLiteral__.ts +26 -31
- package/src/concepts/OqlQueryComponent__.ts +33 -34
- package/src/concepts/OverriddenLogic__.ts +128 -94
- package/src/concepts/Param__.ts +51 -90
- package/src/concepts/Point__.ts +22 -22
- package/src/concepts/ProcessComponent__.ts +36 -37
- package/src/concepts/ProcessElement__.ts +114 -86
- package/src/concepts/ProcessOutcome__.ts +22 -23
- package/src/concepts/ProcessOutcomes__.ts +20 -22
- package/src/concepts/Process__.ts +69 -63
- package/src/concepts/QueryAggregateExpression__.ts +28 -27
- package/src/concepts/QueryFieldExpression__.ts +26 -25
- package/src/concepts/QueryFromExpression__.ts +29 -28
- package/src/concepts/QueryGroupByExpression__.ts +22 -23
- package/src/concepts/QueryJoinExpression__.ts +62 -41
- package/src/concepts/QueryLimitExpression__.ts +27 -27
- package/src/concepts/QueryOrderByExpression__.ts +27 -27
- package/src/concepts/QuerySelectExpression__.ts +105 -54
- package/src/concepts/Rect__.ts +26 -24
- package/src/concepts/Return__.ts +42 -67
- package/src/concepts/Role__.ts +25 -25
- package/src/concepts/SelectMembers__.ts +30 -32
- package/src/concepts/Slot__.ts +32 -30
- package/src/concepts/SqlQueryComponent__.ts +41 -37
- package/src/concepts/Start__.ts +20 -22
- package/src/concepts/StringInterpolation__.ts +25 -45
- package/src/concepts/StringLiteral__.ts +19 -26
- package/src/concepts/StructureProperty__.ts +38 -47
- package/src/concepts/Structure__.ts +55 -58
- package/src/concepts/SwitchCase__.ts +40 -74
- package/src/concepts/SwitchStatement__.ts +29 -44
- package/src/concepts/Theme__.ts +18 -21
- package/src/concepts/Transactional__.ts +24 -31
- package/src/concepts/TriggerEvent__.ts +28 -29
- package/src/concepts/TriggerLauncher__.ts +32 -82
- package/src/concepts/TypeAnnotation__.ts +92 -98
- package/src/concepts/TypeParam__.ts +21 -28
- package/src/concepts/UnaryExpression__.ts +26 -45
- package/src/concepts/Unparsed__.ts +20 -25
- package/src/concepts/UseComponent__.ts +22 -22
- package/src/concepts/ValidationRule__.ts +539 -555
- package/src/concepts/Variable__.ts +43 -67
- package/src/concepts/ViewBlock__.ts +26 -25
- package/src/concepts/ViewComponent__.ts +87 -91
- package/src/concepts/ViewElement__.ts +2696 -2437
- package/src/concepts/View__.ts +342 -369
- package/src/concepts/WhileStatement__.ts +36 -59
- package/src/concepts/index__.ts +0 -1
- package/src/concepts/types__.ts +124 -124
- package/src/decorators/index.ts +11 -7
- package/src/generator/genBundleFiles.ts +14 -4
- package/src/generator/genReleaseBody.ts +198 -182
- package/src/index.ts +0 -1
- package/src/sentry/index.ts +2 -2
- package/src/server/createUiTs.ts +30 -1
- package/src/server/extendBaseNode.ts +18 -18
- package/src/server/formatTsUtils.ts +0 -11
- package/src/server/getConnector.ts +63 -27
- package/src/server/getMemberIdentifier.ts +2 -3
- package/src/server/index.ts +4 -1
- package/src/server/naslServer.ts +212 -121
- package/src/server/translator.ts +1 -3
- package/src/service/creator/add.configs.js +26 -1
- package/src/service/creator/errHandles.js +5 -4
- package/src/service/creator/index.js +12 -0
- package/src/service/storage/init.ts +0 -17
- package/src/service/storage/jsoner.ts +1 -1
- package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +3 -3
- package/src/templator/genTableBlock.ts +1 -1
- package/src/translator/constant.ts +7 -0
- package/src/translator/index.ts +3 -137
- package/src/translator/types.ts +40 -0
- package/src/translator/utils.ts +104 -0
- package/src/utils/cookie.ts +60 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/logger.ts +13 -0
- package/src/utils/types.ts +1 -0
- package/src/utils/window.ts +9 -0
- package/test/concepts/boolean-literal/__snapshots__/toEmbeddedTS.spec.ts.snap +11 -0
- package/test/concepts/boolean-literal/__snapshots__/toJS.spec.ts.snap +11 -0
- package/test/concepts/boolean-literal/__snapshots__/toVue.spec.ts.snap +11 -0
- package/test/concepts/boolean-literal/constant.ts +5 -0
- package/test/concepts/boolean-literal/fixtures/false.json +4 -0
- package/test/concepts/boolean-literal/fixtures/true.json +4 -0
- package/test/concepts/boolean-literal/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/boolean-literal/toJS.spec.ts +14 -0
- package/test/concepts/boolean-literal/toVue.spec.ts +14 -0
- package/test/concepts/call-interface/toEmbeddedTS.spec.ts +6 -6
- package/test/concepts/call-interface/toJS.spec.ts +6 -6
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +106 -0
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +45 -0
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +102 -0
- package/test/concepts/call-logic/fixtures/nested-call-logic.json +860 -0
- package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +23 -0
- package/test/concepts/call-logic/toEmbeddedTS.spec.ts +6 -6
- package/test/concepts/call-logic/toJS.spec.ts +6 -6
- package/test/concepts/identifier/__snapshots__/toEmbeddedTS.spec.ts.snap +16 -0
- package/test/concepts/identifier/__snapshots__/toJS.spec.ts.snap +16 -0
- package/test/concepts/identifier/__snapshots__/toVue.spec.ts.snap +16 -0
- package/test/concepts/identifier/constant.ts +5 -0
- package/test/concepts/identifier/fixtures/data-source.json +5 -0
- package/test/concepts/identifier/fixtures/no-namespace.json +4 -0
- package/test/concepts/identifier/fixtures/view-variable.json +201 -0
- package/test/concepts/identifier/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/identifier/toJS.spec.ts +14 -0
- package/test/concepts/identifier/toVue.spec.ts +14 -0
- package/test/concepts/match/toEmbeddedTS.spec.ts +6 -6
- package/test/concepts/match/toJS.spec.ts +6 -6
- package/test/concepts/member-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +21 -0
- package/test/concepts/member-expression/__snapshots__/toJS.spec.ts.snap +21 -0
- package/test/concepts/member-expression/__snapshots__/toVue.spec.ts.snap +21 -0
- package/test/concepts/member-expression/constant.ts +5 -0
- package/test/concepts/member-expression/fixtures/app.enums.UserStatusEnum.json +13 -0
- package/test/concepts/member-expression/fixtures/elements.table-view.data.json +13 -0
- package/test/concepts/member-expression/fixtures/entry.created-by.json +18 -0
- package/test/concepts/member-expression/fixtures/nasl.auth.userInfo.json +19 -0
- package/test/concepts/member-expression/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/member-expression/toJS.spec.ts +14 -0
- package/test/concepts/member-expression/toVue.spec.ts +14 -0
- package/test/concepts/null-literal/__snapshots__/toEmbeddedTS.spec.ts.snap +6 -0
- package/test/concepts/null-literal/__snapshots__/toJS.spec.ts.snap +6 -0
- package/test/concepts/null-literal/__snapshots__/toVue.spec.ts.snap +6 -0
- package/test/concepts/null-literal/constant.ts +5 -0
- package/test/concepts/null-literal/fixtures/null.json +3 -0
- package/test/concepts/null-literal/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/null-literal/toJS.spec.ts +14 -0
- package/test/concepts/null-literal/toVue.spec.ts +14 -0
- package/test/concepts/numeric-literal/__snapshots__/toEmbeddedTS.spec.ts.snap +6 -0
- package/test/concepts/numeric-literal/__snapshots__/toJS.spec.ts.snap +6 -0
- package/test/concepts/numeric-literal/__snapshots__/toVue.spec.ts.snap +6 -0
- package/test/concepts/numeric-literal/constant.ts +5 -0
- package/test/concepts/numeric-literal/fixtures/number.json +10 -0
- package/test/concepts/numeric-literal/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/numeric-literal/toJS.spec.ts +14 -0
- package/test/concepts/numeric-literal/toVue.spec.ts +14 -0
- package/test/concepts/string-literal/__snapshots__/toEmbeddedTS.spec.ts.snap +16 -0
- package/test/concepts/string-literal/__snapshots__/toJS.spec.ts.snap +16 -0
- package/test/concepts/string-literal/__snapshots__/toVue.spec.ts.snap +16 -0
- package/test/concepts/string-literal/constant.ts +5 -0
- package/test/concepts/string-literal/fixtures/escape.json +4 -0
- package/test/concepts/string-literal/fixtures/space.json +4 -0
- package/test/concepts/string-literal/fixtures/string.json +4 -0
- package/test/concepts/string-literal/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/string-literal/toJS.spec.ts +14 -0
- package/test/concepts/string-literal/toVue.spec.ts +14 -0
- package/test/concepts/utils.ts +46 -43
- package/test/concepts/validation-rule/toEmbeddedTS.spec.ts +6 -6
- package/test/concepts/validation-rule/toJS.spec.ts +6 -6
- package/test/concepts/validation-rule/validation-rule.spec.ts +8 -8
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +592 -0
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +308 -0
- package/test/concepts/view-element/fixtures/default-login.json +333 -0
- package/test/concepts/view-element/fixtures/default-not-found.json +313 -313
- package/test/concepts/view-element/fixtures/with-role-auth.json +148 -0
- package/test/concepts/view-element/fixtures/with-table.json +3473 -0
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +6 -6
- package/test/concepts/view-element/toVue.spec.ts +6 -6
- package/ts-worker/package-lock.json +6663 -101
- package/ts-worker/webpack.config.js +1 -1
- package/out/common/classMap.d.ts +0 -4
- package/out/common/classMap.js +0 -5
- package/out/common/classMap.js.map +0 -1
- package/out/concepts/DataElement__.d.ts +0 -46
- package/out/concepts/DataElement__.js +0 -118
- package/out/concepts/DataElement__.js.map +0 -1
- package/out/natural/RequirementAnalyzer.d.ts +0 -22
- package/out/natural/RequirementAnalyzer.js +0 -196
- package/out/natural/RequirementAnalyzer.js.map +0 -1
- package/out/natural/RequirementExecutor.d.ts +0 -51
- package/out/natural/RequirementExecutor.js +0 -692
- package/out/natural/RequirementExecutor.js.map +0 -1
- package/out/natural/componentData.d.ts +0 -31
- package/out/natural/componentData.js +0 -85
- package/out/natural/componentData.js.map +0 -1
- package/out/natural/genNaturalTS.d.ts +0 -3
- package/out/natural/genNaturalTS.js +0 -80
- package/out/natural/genNaturalTS.js.map +0 -1
- package/out/natural/index.d.ts +0 -4
- package/out/natural/index.js +0 -21
- package/out/natural/index.js.map +0 -1
- package/out/natural/knowledgeMap.d.ts +0 -4
- package/out/natural/knowledgeMap.js +0 -40
- package/out/natural/knowledgeMap.js.map +0 -1
- package/out/natural/naslStdlibMap.d.ts +0 -2
- package/out/natural/naslStdlibMap.js +0 -26
- package/out/natural/naslStdlibMap.js.map +0 -1
- package/out/natural/transformTSCode.d.ts +0 -7
- package/out/natural/transformTSCode.js +0 -734
- package/out/natural/transformTSCode.js.map +0 -1
- package/out/translator/lsp.d.ts +0 -45
- package/out/translator/lsp.js +0 -6
- package/out/translator/lsp.js.map +0 -1
- package/out/translator/tsp.d.ts +0 -12
- package/out/translator/tsp.js.map +0 -1
- package/sandbox-natural/stdlib/nasl.core.ts +0 -36
- package/sandbox-natural/stdlib/nasl.oql.ts +0 -8
- package/sandbox-natural/stdlib/nasl.ui.ts +0 -56
- package/sandbox-natural/stdlib/nasl.util.ts +0 -85
- package/sandbox-natural/tsconfig.json +0 -12
- package/src/common/classMap.ts +0 -3
- package/src/concepts/DataElement__.ts +0 -131
- package/src/natural/RequirementAnalyzer.ts +0 -208
- package/src/natural/RequirementExecutor.ts +0 -685
- package/src/natural/componentData.ts +0 -81
- package/src/natural/genNaturalTS.ts +0 -81
- package/src/natural/index.ts +0 -4
- package/src/natural/knowledgeMap.ts +0 -39
- package/src/natural/naslStdlibMap.ts +0 -24
- package/src/natural/transformTSCode.ts +0 -680
- package/src/test/examples/app1.json +0 -1406
- package/src/test/fixtures/env.ts +0 -19
- package/src/test/integration/connect-create-file.ts +0 -14
- package/src/test/integration/connect-file.ts +0 -24
- package/src/test/integration/node-nasl-server.ts +0 -14
- package/src/test/units/baseTypes/Assignment.spec.ts +0 -20
- package/src/test/units/baseTypes/CallLogic.spec.ts +0 -22
- package/src/test/units/baseTypes/StringLiteral.spec.ts +0 -60
- package/src/test/units/baseTypes/new.spec.ts +0 -13
- package/src/test/units/common/Vertex.spec.ts +0 -23
- package/src/test/units/data/Entity.spec.ts +0 -10
- package/src/test/units/login.spec.ts +0 -10
- package/src/test/units/page/Block.spec.ts +0 -15
- package/src/test/units/page/Element.spec.ts +0 -45
- package/src/test/units/page/example.dashboard.html +0 -46
- package/src/test/units/page/example.view1.html +0 -63
- package/src/test/units/temp/temp.spec.ts +0 -66
- package/src/translator/lsp.ts +0 -50
- package/src/translator/tsp.ts +0 -14
package/src/server/naslServer.ts
CHANGED
|
@@ -84,7 +84,8 @@ import {
|
|
|
84
84
|
TriggerLauncher,
|
|
85
85
|
CallConnector,
|
|
86
86
|
} from '../concepts';
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
import { lsp2tspNumber, SourceMap, SourceMapItem, isSameRange } from '../translator';
|
|
88
89
|
import axios from '../service/storage';
|
|
89
90
|
import { translateDiagnosticMessage, naslNodeTranslateMessage, MinRange, checkAStructure_ } from './translator';
|
|
90
91
|
import { EventPayload, invokeCommand, registerCommand } from '../common';
|
|
@@ -144,14 +145,13 @@ type QuickInfoNodes = Array<{ filePath: string; node: BaseNode; item: SourceMapI
|
|
|
144
145
|
let isChangeInterface = false; //判断是否导入接口
|
|
145
146
|
type ActionNode = { target: Variable; typeannotation: TypeAnnotation };
|
|
146
147
|
let actionArr: Array<ActionNode> = []; //用于导入接口收集更改的节点
|
|
147
|
-
let timer: number = null; //超时器用于收集导入接口相关
|
|
148
|
-
const __naslStdlibFileCacheMap: Map<tsProtocol.OpenRequestArgs['file'], tsProtocol.OpenRequestArgs> = new Map(); // naslStdlib文件缓存
|
|
148
|
+
let timer: number | null = null; //超时器用于收集导入接口相关
|
|
149
149
|
|
|
150
150
|
// 联合类型切割取出类型
|
|
151
151
|
export function getDisplayString2Type(displayString: string) {
|
|
152
|
-
const targetString = displayString.match(/value:\s(\S+)\)/)?.[1]
|
|
153
|
-
let targetType:
|
|
154
|
-
if (targetString
|
|
152
|
+
const targetString = displayString.match(/value:\s(\S+)\)/)?.[1];
|
|
153
|
+
let targetType:string | null = null;
|
|
154
|
+
if (targetString?.startsWith('nasl.core.')) {
|
|
155
155
|
targetType = targetString.slice(10);
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -161,7 +161,7 @@ export function getDisplayString2Type(displayString: string) {
|
|
|
161
161
|
displayString = displayString?.replace('T extends ', '') || '';
|
|
162
162
|
const types = reg.exec(displayString);
|
|
163
163
|
// 取出提示的类型,组成是数组
|
|
164
|
-
const typeList: string[] = types[1].split(' | ').map((item: string) => {
|
|
164
|
+
const typeList: string[] = (types?.[1].split(' | ') ?? []).map((item: string) => {
|
|
165
165
|
if (/<([^()]+)>/g.exec(item)) {
|
|
166
166
|
return item;
|
|
167
167
|
} else if (item.includes(' ')) {
|
|
@@ -185,10 +185,12 @@ export function getDisplayString2Type(displayString: string) {
|
|
|
185
185
|
|
|
186
186
|
@sentryMonitorNaslServer
|
|
187
187
|
class NaslServer {
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
/** naslStdlib文件缓存 */
|
|
189
|
+
naslStdlibFileCacheMap: Map<tsProtocol.OpenRequestArgs['file'], tsProtocol.OpenRequestArgs> = new Map();
|
|
190
|
+
|
|
191
|
+
messager: Messager;
|
|
190
192
|
|
|
191
|
-
worker: Worker
|
|
193
|
+
worker: Worker;
|
|
192
194
|
|
|
193
195
|
/**
|
|
194
196
|
* 按道理 fileSourceMap: new Map<string, SourceMap>() 比较合理,
|
|
@@ -197,12 +199,22 @@ class NaslServer {
|
|
|
197
199
|
*/
|
|
198
200
|
file2NodeMap: Map<string, BaseNode> = new Map<string, BaseNode>();
|
|
199
201
|
|
|
202
|
+
/** TS 翻译的源码 */
|
|
203
|
+
tsFiles = new Map<string, string>();
|
|
204
|
+
|
|
205
|
+
/// #if process.env.NODE_ENV === 'development'
|
|
206
|
+
/**
|
|
207
|
+
* 调试时是否储存 ts 文件
|
|
208
|
+
*/
|
|
209
|
+
openDebugEmbedded = true;
|
|
210
|
+
/// #endif
|
|
211
|
+
|
|
200
212
|
elementsLogic: { [elementLogicName: string]: Array<Logic> } = {};
|
|
201
213
|
|
|
202
214
|
// 错误日志收集
|
|
203
|
-
diagnosticManager: DiagnosticManager
|
|
215
|
+
diagnosticManager: DiagnosticManager;
|
|
204
216
|
|
|
205
|
-
embeddedTSEmitter: EventEmitter
|
|
217
|
+
embeddedTSEmitter: EventEmitter;
|
|
206
218
|
|
|
207
219
|
// 需要执行修改的文件
|
|
208
220
|
changeStackList: Array<EventPayload> = [];
|
|
@@ -518,6 +530,24 @@ class NaslServer {
|
|
|
518
530
|
launcher.sourceMap = result.sourceMap;
|
|
519
531
|
this.file2NodeMap.set(result.filePath, launcher);
|
|
520
532
|
});
|
|
533
|
+
module.namespaces?.forEach?.((namespace) => {
|
|
534
|
+
namespace.logics.forEach((logic) => {
|
|
535
|
+
const result = logic.toEmbeddedTSFile();
|
|
536
|
+
results.push(result);
|
|
537
|
+
// sourceMap都存在目录级别内容下,在页面层级下去找
|
|
538
|
+
logic.sourceMap = result.sourceMap;
|
|
539
|
+
this.file2NodeMap.set(result.filePath, logic);
|
|
540
|
+
});
|
|
541
|
+
})
|
|
542
|
+
module?.authLogicsForCallInterface?.forEach?.((logic) => {
|
|
543
|
+
try {
|
|
544
|
+
if (!(logic instanceof Logic)) return;
|
|
545
|
+
const result = logic.toEmbeddedTSFile();
|
|
546
|
+
results.push(result);
|
|
547
|
+
logic.sourceMap = result.sourceMap;
|
|
548
|
+
this.file2NodeMap.set(result.filePath, logic);
|
|
549
|
+
} catch (err) {}
|
|
550
|
+
});
|
|
521
551
|
} catch (error) {
|
|
522
552
|
console.error(error);
|
|
523
553
|
}
|
|
@@ -597,6 +627,7 @@ class NaslServer {
|
|
|
597
627
|
// 其他模块的创建内容
|
|
598
628
|
app.dependencies.forEach((item) => this.contentToFile(item, results));
|
|
599
629
|
app.interfaceDependencies.forEach((item) => this.contentToFile(item, results));
|
|
630
|
+
app.integration?.connectors?.forEach((item) => this.contentToFile(item, results));
|
|
600
631
|
} catch (err) {
|
|
601
632
|
console.log(err);
|
|
602
633
|
}
|
|
@@ -642,7 +673,7 @@ class NaslServer {
|
|
|
642
673
|
}
|
|
643
674
|
// 缓存添加过的文件
|
|
644
675
|
cacheFile(options: tsProtocol.OpenRequestArgs) {
|
|
645
|
-
|
|
676
|
+
this.naslStdlibFileCacheMap.set(options.file, options);
|
|
646
677
|
}
|
|
647
678
|
|
|
648
679
|
/**u
|
|
@@ -650,6 +681,7 @@ class NaslServer {
|
|
|
650
681
|
* @param {*} files
|
|
651
682
|
*/
|
|
652
683
|
writeFiles(files: Array<tsProtocol.OpenRequestArgs>) {
|
|
684
|
+
files.forEach(({ file, fileContent }) => this.tsFiles.set(file, fileContent));
|
|
653
685
|
return this.messager.requestCommand('writeFiles', files);
|
|
654
686
|
}
|
|
655
687
|
|
|
@@ -659,6 +691,7 @@ class NaslServer {
|
|
|
659
691
|
* @param {*} args
|
|
660
692
|
*/
|
|
661
693
|
updateFiles(args: { outputFiles: Array<tsProtocol.OpenRequestArgs> }) {
|
|
694
|
+
args.outputFiles.forEach(({ file, fileContent }) => this.tsFiles.set(file, fileContent));
|
|
662
695
|
return this.messager.requestCommand('updateFiles', args);
|
|
663
696
|
}
|
|
664
697
|
|
|
@@ -666,20 +699,22 @@ class NaslServer {
|
|
|
666
699
|
* 清除一个目录下的所有文件
|
|
667
700
|
*/
|
|
668
701
|
deleteDirectoryFiles(args: { directoryName: string }) {
|
|
702
|
+
Array.from(this.tsFiles.keys())
|
|
703
|
+
.filter((key) => key.startsWith(args.directoryName))
|
|
704
|
+
.forEach((key) => this.tsFiles.delete(key));
|
|
705
|
+
|
|
669
706
|
return this.messager.requestCommand('deleteDirectoryFiles', args);
|
|
670
707
|
}
|
|
671
708
|
|
|
672
709
|
async _debugInFileStorage(node: BaseNode, openFiles: Array<tsProtocol.OpenRequestArgs>) {
|
|
673
710
|
let app = node;
|
|
674
|
-
let openDebugEmbedded = true;
|
|
675
711
|
if (node.concept !== 'App') {
|
|
676
712
|
app = (node as any).rootNode || (node as any).app;
|
|
677
713
|
}
|
|
678
714
|
/// #if process.env.NODE_ENV === 'development'
|
|
679
715
|
// 首次尝试请求
|
|
680
|
-
await axios.post('/api/App/debugEmbedded?id=' + app.id, openFiles[0]).catch(() => (openDebugEmbedded = false));
|
|
681
|
-
|
|
682
|
-
if (openDebugEmbedded && globalThis.window) {
|
|
716
|
+
await axios.post('/api/App/debugEmbedded?id=' + app.id, openFiles[0]).catch(() => (this.openDebugEmbedded = false));
|
|
717
|
+
if (this.openDebugEmbedded && globalThis.window) {
|
|
683
718
|
// For TS build
|
|
684
719
|
try {
|
|
685
720
|
let canDebug = true;
|
|
@@ -694,8 +729,7 @@ class NaslServer {
|
|
|
694
729
|
);
|
|
695
730
|
}
|
|
696
731
|
} catch (e) {
|
|
697
|
-
//
|
|
698
|
-
openDebugEmbedded = false;
|
|
732
|
+
// ..
|
|
699
733
|
}
|
|
700
734
|
}
|
|
701
735
|
/// #endif
|
|
@@ -734,8 +768,8 @@ class NaslServer {
|
|
|
734
768
|
return this._getValueSelectCompletion({
|
|
735
769
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
736
770
|
range: {
|
|
737
|
-
line: lsp2tspNumber(currentSource.
|
|
738
|
-
offset: lsp2tspNumber(currentSource.
|
|
771
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
772
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
739
773
|
},
|
|
740
774
|
value,
|
|
741
775
|
noFilterList,
|
|
@@ -769,8 +803,8 @@ class NaslServer {
|
|
|
769
803
|
try {
|
|
770
804
|
const quickInfo = await this._getTypeQuickinfo({
|
|
771
805
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
772
|
-
line: lsp2tspNumber(currentSource.
|
|
773
|
-
offset: lsp2tspNumber(currentSource.
|
|
806
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
807
|
+
offset: lsp2tspNumber(currentSource.start.character) + `nasl.util.C`.length,
|
|
774
808
|
});
|
|
775
809
|
if (quickInfo.responseRequired) {
|
|
776
810
|
const displayString = quickInfo?.response?.displayString || '';
|
|
@@ -815,8 +849,8 @@ class NaslServer {
|
|
|
815
849
|
}
|
|
816
850
|
const quickInfo = await this._getTypeQuickinfo({
|
|
817
851
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
818
|
-
line: lsp2tspNumber(currentSource.
|
|
819
|
-
offset: lsp2tspNumber(currentSource.
|
|
852
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
853
|
+
offset: lsp2tspNumber(currentSource.start.character) + `new nasl.ui.`.length,
|
|
820
854
|
});
|
|
821
855
|
if (quickInfo.responseRequired) {
|
|
822
856
|
const displayString = quickInfo?.response?.displayString || '';
|
|
@@ -873,8 +907,8 @@ class NaslServer {
|
|
|
873
907
|
}
|
|
874
908
|
const quickInfo = await this._getTypeQuickinfo({
|
|
875
909
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
876
|
-
line: lsp2tspNumber(currentSource.
|
|
877
|
-
offset: lsp2tspNumber(currentSource.
|
|
910
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
911
|
+
offset: lsp2tspNumber(currentSource.start.character) + `new nasl.ui.`.length,
|
|
878
912
|
});
|
|
879
913
|
if (quickInfo.responseRequired) {
|
|
880
914
|
const displayString = quickInfo?.response?.displayString || '';
|
|
@@ -968,8 +1002,8 @@ class NaslServer {
|
|
|
968
1002
|
return this._getSelectNextCompletion({
|
|
969
1003
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
970
1004
|
range: {
|
|
971
|
-
line: lsp2tspNumber(currentSource.
|
|
972
|
-
offset: lsp2tspNumber(currentSource.
|
|
1005
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
1006
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
973
1007
|
},
|
|
974
1008
|
noFilterList,
|
|
975
1009
|
});
|
|
@@ -1015,7 +1049,7 @@ class NaslServer {
|
|
|
1015
1049
|
|
|
1016
1050
|
oldRecord?.semanticDiagnostics.forEach((item) => {
|
|
1017
1051
|
if (item.node) {
|
|
1018
|
-
item.node.tsErrorDetail
|
|
1052
|
+
delete item.node.tsErrorDetail;
|
|
1019
1053
|
// 如果logic中有报错就把标识置为true
|
|
1020
1054
|
if ((item.node as any)?.logic?.haveError) {
|
|
1021
1055
|
(item.node as any).logic.haveError = false;
|
|
@@ -1026,7 +1060,7 @@ class NaslServer {
|
|
|
1026
1060
|
// 清空一些状态
|
|
1027
1061
|
oldRecord?.suggestionDiagnostics.forEach((item) => {
|
|
1028
1062
|
if (item.node) {
|
|
1029
|
-
item.node.tsErrorDetail
|
|
1063
|
+
delete item.node.tsErrorDetail;
|
|
1030
1064
|
if (item.node && item.node instanceof Logic) {
|
|
1031
1065
|
item.node.isSmpty = false;
|
|
1032
1066
|
}
|
|
@@ -1042,7 +1076,7 @@ class NaslServer {
|
|
|
1042
1076
|
if (record.node instanceof Logic) {
|
|
1043
1077
|
record?.syntaxDiagnostics.forEach((item) => {
|
|
1044
1078
|
const minRange = this._findMinRange(item as unknown as tsProtocol.DiagnosticWithFileName, record.node as FileNode);
|
|
1045
|
-
if (minRange
|
|
1079
|
+
if (minRange?.node instanceof OqlQueryComponent) {
|
|
1046
1080
|
if (item.text === 'Invalid character.') {
|
|
1047
1081
|
record.semanticDiagnostics.push(item);
|
|
1048
1082
|
}
|
|
@@ -1485,6 +1519,14 @@ class NaslServer {
|
|
|
1485
1519
|
};
|
|
1486
1520
|
this.baseNodeAssignmentTsError(variable, diagnostic);
|
|
1487
1521
|
diagnostics.push(diagnostic);
|
|
1522
|
+
} else if (variable.__TypeAnnotation?.hasSystemType(node.app)) {
|
|
1523
|
+
const diagnostic = {
|
|
1524
|
+
node,
|
|
1525
|
+
severity: 'warning',
|
|
1526
|
+
message: `数据查询中不可以使用或包含系统类型!当前类型:${variable.__TypeAnnotation?.typeChineseTitle}。`,
|
|
1527
|
+
};
|
|
1528
|
+
this.baseNodeAssignmentTsError(variable, diagnostic);
|
|
1529
|
+
diagnostics.push(diagnostic);
|
|
1488
1530
|
}
|
|
1489
1531
|
});
|
|
1490
1532
|
}
|
|
@@ -1743,6 +1785,19 @@ class NaslServer {
|
|
|
1743
1785
|
diagnostics.push(diagnostic);
|
|
1744
1786
|
node.tsErrorDetail = diagnostic;
|
|
1745
1787
|
}
|
|
1788
|
+
} else if (node instanceof Identifier) {
|
|
1789
|
+
// 变量如果选到了页面,因为ts会找到兄弟的同名变量,所以需要新增报错,通过类型来判断加不加
|
|
1790
|
+
// https://projectmanage.netease-official.lcap.163yun.com/dashboard/BugDetail?id=2696136968961024
|
|
1791
|
+
if (node.name && node.__TypeAnnotation?.typeKind === 'reference' && node.__TypeAnnotation?.typeNamespace?.endsWith('views')) {
|
|
1792
|
+
const errorMsg = `找不到 ${node.name}。`;
|
|
1793
|
+
const diagnostic = {
|
|
1794
|
+
node,
|
|
1795
|
+
severity: 'error',
|
|
1796
|
+
message: errorMsg,
|
|
1797
|
+
};
|
|
1798
|
+
diagnostics.push(diagnostic);
|
|
1799
|
+
node.tsErrorDetail = diagnostic;
|
|
1800
|
+
}
|
|
1746
1801
|
} else {
|
|
1747
1802
|
this.checkNodeError(node, diagnostics);
|
|
1748
1803
|
}
|
|
@@ -1911,6 +1966,16 @@ class NaslServer {
|
|
|
1911
1966
|
typeAnnotationErrorDetail.errorPos[key] = errorMsg;
|
|
1912
1967
|
}
|
|
1913
1968
|
});
|
|
1969
|
+
} else if (rulesMap?.maxLength && +dataBaseTyp?.max && +rulesMap.maxLength > +dataBaseTyp.max) {
|
|
1970
|
+
// 判断当前 最大长度 是不是比 数据库类型的最大长度 长,超过就报错
|
|
1971
|
+
const errorMsg = `最大长度超出存储长度`;
|
|
1972
|
+
const diag: any = {
|
|
1973
|
+
node: property,
|
|
1974
|
+
severity: 'warning',
|
|
1975
|
+
message: errorMsg,
|
|
1976
|
+
};
|
|
1977
|
+
diagnostics.push(diag);
|
|
1978
|
+
typeAnnotationErrorDetail.errorPos.maxLength = errorMsg;
|
|
1914
1979
|
}
|
|
1915
1980
|
}
|
|
1916
1981
|
case 'Long': {
|
|
@@ -2113,7 +2178,7 @@ class NaslServer {
|
|
|
2113
2178
|
node.tsErrorDetail = diagnostic;
|
|
2114
2179
|
diagnostics.push(diagnostic);
|
|
2115
2180
|
} else {
|
|
2116
|
-
node.tsErrorDetail
|
|
2181
|
+
delete node.tsErrorDetail;
|
|
2117
2182
|
}
|
|
2118
2183
|
}
|
|
2119
2184
|
this.checkNodeError(node, diagnostics);
|
|
@@ -2123,7 +2188,6 @@ class NaslServer {
|
|
|
2123
2188
|
this.checkNodeError(node, diagnostics);
|
|
2124
2189
|
});
|
|
2125
2190
|
}
|
|
2126
|
-
console.timeEnd('_attachDiagnostics');
|
|
2127
2191
|
return diagnostics;
|
|
2128
2192
|
}
|
|
2129
2193
|
|
|
@@ -2489,19 +2553,19 @@ class NaslServer {
|
|
|
2489
2553
|
* 当前内容的开始行 <= 诊断开始的行 &&
|
|
2490
2554
|
* 当前内容的结束行 >= 诊断结束的行
|
|
2491
2555
|
*/
|
|
2492
|
-
if (lsp2tspNumber(item.
|
|
2556
|
+
if (lsp2tspNumber(item.start.line) <= diagnostic.start.line && lsp2tspNumber(item.end.line) >= diagnostic.end.line) {
|
|
2493
2557
|
// 如果找到某一行
|
|
2494
|
-
if (lsp2tspNumber(item.
|
|
2558
|
+
if (lsp2tspNumber(item.start.line) === diagnostic.start.line && lsp2tspNumber(item.end.line) === diagnostic.end.line) {
|
|
2495
2559
|
// 在行的范围但是又不在列的范围,不用给默认值,给了反而不对,
|
|
2496
2560
|
// 需要在列的范围内
|
|
2497
2561
|
if (
|
|
2498
|
-
lsp2tspNumber(item.
|
|
2499
|
-
lsp2tspNumber(item.
|
|
2562
|
+
lsp2tspNumber(item.start.character) <= diagnostic.start.offset &&
|
|
2563
|
+
lsp2tspNumber(item.end.character) >= diagnostic.end.offset
|
|
2500
2564
|
) {
|
|
2501
2565
|
// 比列更靠近 ,满足条件且长度更短
|
|
2502
2566
|
// 如果先走到下面有一个默认值了就像在if for里面有个表达式
|
|
2503
2567
|
// if for的内容也是包括当前的所以会重新赋值
|
|
2504
|
-
if (!minRange || item.
|
|
2568
|
+
if (!minRange || (item.end.offset - item.start.offset) < (minRange.item.end.offset - minRange.item.start.offset)) {
|
|
2505
2569
|
minRange = { item, node };
|
|
2506
2570
|
haveLineNode = true;
|
|
2507
2571
|
}
|
|
@@ -2513,24 +2577,24 @@ class NaslServer {
|
|
|
2513
2577
|
minRange = { node, item };
|
|
2514
2578
|
} else if (!haveLineNode) {
|
|
2515
2579
|
if (
|
|
2516
|
-
lsp2tspNumber(item.
|
|
2517
|
-
diagnostic.start.offset >= lsp2tspNumber(item.
|
|
2580
|
+
lsp2tspNumber(item.start.line) === diagnostic.start.line &&
|
|
2581
|
+
diagnostic.start.offset >= lsp2tspNumber(item.start.character)
|
|
2518
2582
|
) {
|
|
2519
2583
|
// 如果当前遍历的内容的行和列都 小于之前的, 而且是有效的
|
|
2520
2584
|
// 如果两个内容位置行数是一样的,就比较下找到内容的位置信息
|
|
2521
2585
|
// 找到的内容的开始位置, 要大于申明内容开始的位置,要不就不包含在内了
|
|
2522
|
-
if (diagnostic.start.offset - item.
|
|
2586
|
+
if (diagnostic.start.offset - item.start.character <= diagnostic.start.offset - minRange.item.start.character) {
|
|
2523
2587
|
minRange = { node, item };
|
|
2524
2588
|
} else {
|
|
2525
|
-
if (diagnostic.start.offset < lsp2tspNumber(minRange.item.
|
|
2589
|
+
if (diagnostic.start.offset < lsp2tspNumber(minRange.item.start.character)) {
|
|
2526
2590
|
minRange = { node, item };
|
|
2527
2591
|
}
|
|
2528
2592
|
}
|
|
2529
|
-
} else if (item.
|
|
2593
|
+
} else if (item.end.line - item.start.line <= minRange.item.end.line - minRange.item.start.line) {
|
|
2530
2594
|
// 行都一致 ,比较列
|
|
2531
|
-
if (minRange.item.
|
|
2595
|
+
if (minRange.item.start.line === item.start.line && minRange.item.end.line === item.end.line) {
|
|
2532
2596
|
// 如果两个起始和结束的行都一样,那么就比较开始列, 要比原来大,说明更精准
|
|
2533
|
-
if (item.
|
|
2597
|
+
if (item.start.character > minRange.item.start.character) {
|
|
2534
2598
|
minRange = { node, item };
|
|
2535
2599
|
}
|
|
2536
2600
|
} else {
|
|
@@ -2564,8 +2628,8 @@ class NaslServer {
|
|
|
2564
2628
|
if (currentSource) {
|
|
2565
2629
|
const newRefs = await this.references({
|
|
2566
2630
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2567
|
-
line: lsp2tspNumber(currentSource.
|
|
2568
|
-
offset: lsp2tspNumber(currentSource.
|
|
2631
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2632
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
2569
2633
|
});
|
|
2570
2634
|
refsList = [...newRefs.refs];
|
|
2571
2635
|
} else {
|
|
@@ -2608,7 +2672,7 @@ class NaslServer {
|
|
|
2608
2672
|
const entity = this.file2NodeMap.get(item.file);
|
|
2609
2673
|
const { currentSource } = this.getCurrentSource(entity);
|
|
2610
2674
|
// 42 11个函数的总行数
|
|
2611
|
-
if (item.end.line < currentSource.
|
|
2675
|
+
if (item.end.line < currentSource.end.line - 42 && item.start.line > 1) {
|
|
2612
2676
|
flag = true;
|
|
2613
2677
|
}
|
|
2614
2678
|
}
|
|
@@ -2637,8 +2701,8 @@ class NaslServer {
|
|
|
2637
2701
|
callQueryComponentTypeAnnotation = key;
|
|
2638
2702
|
}
|
|
2639
2703
|
});
|
|
2640
|
-
const { currentSource: qcTypeAnnotationCurrentSource, fileNode } = callQueryComponentTypeAnnotation.getCurrentSource();
|
|
2641
|
-
const { currentSource: logicCurrentSource } = fileNode.getCurrentSource();
|
|
2704
|
+
const { currentSource: qcTypeAnnotationCurrentSource, fileNode: qcTypeCurrentFileNode } = callQueryComponentTypeAnnotation.getCurrentSource();
|
|
2705
|
+
const { currentSource: logicCurrentSource, fileNode: logicCurrentFileNode } = fileNode.getCurrentSource();
|
|
2642
2706
|
const aggregateLength = callQueryComponent.select.selectAggregateElements.filter(
|
|
2643
2707
|
(item: any) => item.aggregateName && item.asName
|
|
2644
2708
|
).length;
|
|
@@ -2654,15 +2718,18 @@ class NaslServer {
|
|
|
2654
2718
|
}
|
|
2655
2719
|
const { currentSource: propertyTypeCurrentSource } = targetProperty.typeAnnotation.getCurrentSource();
|
|
2656
2720
|
// 减去 ": " 2个字符、减去属性名长度
|
|
2657
|
-
const propertyCharacter = propertyTypeCurrentSource.
|
|
2658
|
-
const propertyOffset = propertyCharacter - qcTypeAnnotationCurrentSource.
|
|
2659
|
-
const
|
|
2660
|
-
const
|
|
2721
|
+
const propertyCharacter = propertyTypeCurrentSource.start.character - 2 - targetProperty.name.length;
|
|
2722
|
+
const propertyOffset = propertyCharacter - qcTypeAnnotationCurrentSource.start.character;
|
|
2723
|
+
const qcTypeCurrentFilePath = (qcTypeCurrentFileNode as any).getEmbeddedFilePath() as string;
|
|
2724
|
+
const qcTypeAnnotationCurrentCode = this.getNodeCode(qcTypeCurrentFileNode, qcTypeAnnotationCurrentSource);
|
|
2725
|
+
const logicCurrentCode = this.getNodeCode(qcTypeCurrentFileNode, logicCurrentSource);
|
|
2726
|
+
const qcTypeAnnotationOffset = logicCurrentCode.indexOf(qcTypeAnnotationCurrentCode);
|
|
2727
|
+
const declarationCodeArr = logicCurrentCode.slice(0, qcTypeAnnotationOffset).split('\n');
|
|
2661
2728
|
const line = declarationCodeArr.length - 1;
|
|
2662
2729
|
const character = declarationCodeArr[declarationCodeArr.length - 1].length;
|
|
2663
2730
|
// eslint-disable-next-line no-await-in-loop
|
|
2664
2731
|
const newRefs = await this.references({
|
|
2665
|
-
file:
|
|
2732
|
+
file: qcTypeCurrentFilePath,
|
|
2666
2733
|
line: line + 2,
|
|
2667
2734
|
offset: character + 1 + propertyOffset,
|
|
2668
2735
|
});
|
|
@@ -2689,8 +2756,8 @@ class NaslServer {
|
|
|
2689
2756
|
const { currentSource } = this.getCurrentSource(logicNode);
|
|
2690
2757
|
const parentRefs = await this.references({
|
|
2691
2758
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2692
|
-
line: lsp2tspNumber(currentSource.
|
|
2693
|
-
offset: lsp2tspNumber(currentSource.
|
|
2759
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2760
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
2694
2761
|
});
|
|
2695
2762
|
refsList = [...refsList, ...parentRefs.refs];
|
|
2696
2763
|
}
|
|
@@ -2698,13 +2765,13 @@ class NaslServer {
|
|
|
2698
2765
|
// 如果是参数修改, 就需要把logic的引用 都查找出来就需要把他的父级的引用全部查找出来
|
|
2699
2766
|
if (node instanceof Param && (node.parentNode instanceof View || node.parentNode instanceof Process)) {
|
|
2700
2767
|
const viewNode = node.parentNode;
|
|
2701
|
-
const { currentSource } = this.getCurrentSource(viewNode);
|
|
2702
|
-
const code = currentSource
|
|
2768
|
+
const { currentSource, fileNode } = this.getCurrentSource(viewNode);
|
|
2769
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2703
2770
|
const viewIndex = code.indexOf(' {');
|
|
2704
2771
|
const viewRefs = await this.references({
|
|
2705
2772
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2706
|
-
line: lsp2tspNumber(currentSource.
|
|
2707
|
-
offset: lsp2tspNumber(currentSource.
|
|
2773
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2774
|
+
offset: lsp2tspNumber(currentSource.start.character + viewIndex),
|
|
2708
2775
|
});
|
|
2709
2776
|
let filterViewRefs = [];
|
|
2710
2777
|
if (node.parentNode instanceof View) {
|
|
@@ -2727,8 +2794,8 @@ class NaslServer {
|
|
|
2727
2794
|
// const viewIndex = code.indexOf(' {');
|
|
2728
2795
|
// const viewRefs = await naslServer.references({
|
|
2729
2796
|
// file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2730
|
-
// line: lsp2tspNumber(currentSource.
|
|
2731
|
-
// offset: lsp2tspNumber(currentSource.
|
|
2797
|
+
// line: lsp2tspNumber(currentSource.start.line),
|
|
2798
|
+
// offset: lsp2tspNumber(currentSource.start.character + viewIndex),
|
|
2732
2799
|
// });
|
|
2733
2800
|
// refsList = [...viewRefs.refs];
|
|
2734
2801
|
// }
|
|
@@ -2737,14 +2804,14 @@ class NaslServer {
|
|
|
2737
2804
|
*/
|
|
2738
2805
|
if (node instanceof ViewElement) {
|
|
2739
2806
|
if (currentSource) {
|
|
2740
|
-
const code = currentSource
|
|
2807
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2741
2808
|
const prefix = '__elements.';
|
|
2742
2809
|
const prefixIndex = code.indexOf(prefix) !== -1 ? code.indexOf(prefix) : 0;
|
|
2743
2810
|
const methodsNameIndex = prefixIndex + prefix.length;
|
|
2744
2811
|
const methods = await this.references({
|
|
2745
2812
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2746
|
-
line: lsp2tspNumber(currentSource.
|
|
2747
|
-
offset: lsp2tspNumber(currentSource.
|
|
2813
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2814
|
+
offset: lsp2tspNumber(currentSource.start.character + methodsNameIndex),
|
|
2748
2815
|
});
|
|
2749
2816
|
const methodRefs: tsProtocol.ReferencesResponseItem[] = [];
|
|
2750
2817
|
methods.refs.forEach((item) => {
|
|
@@ -2763,7 +2830,7 @@ class NaslServer {
|
|
|
2763
2830
|
}
|
|
2764
2831
|
if (node instanceof Process) {
|
|
2765
2832
|
if (currentSource) {
|
|
2766
|
-
const code = currentSource
|
|
2833
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2767
2834
|
const prefix = '__ProcessIdentification__';
|
|
2768
2835
|
let positions = [];
|
|
2769
2836
|
let pos = code.indexOf(prefix);
|
|
@@ -2777,8 +2844,8 @@ class NaslServer {
|
|
|
2777
2844
|
const promises = positions.map((item) =>
|
|
2778
2845
|
this.references({
|
|
2779
2846
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2780
|
-
line: lsp2tspNumber(currentSource.
|
|
2781
|
-
offset: lsp2tspNumber(currentSource.
|
|
2847
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2848
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2782
2849
|
})
|
|
2783
2850
|
);
|
|
2784
2851
|
const results = await Promise.all(promises);
|
|
@@ -2788,9 +2855,9 @@ class NaslServer {
|
|
|
2788
2855
|
}
|
|
2789
2856
|
}
|
|
2790
2857
|
if ((node instanceof Param || node instanceof Return) && node.parentNode instanceof Process) {
|
|
2791
|
-
const { currentSource } = this.getCurrentSource(node.parentNode);
|
|
2858
|
+
const { currentSource, fileNode } = this.getCurrentSource(node.parentNode);
|
|
2792
2859
|
if (currentSource) {
|
|
2793
|
-
const code = currentSource
|
|
2860
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2794
2861
|
const prefix = '__ProcessIdentification__';
|
|
2795
2862
|
const positions = [];
|
|
2796
2863
|
let pos = code.indexOf(prefix);
|
|
@@ -2808,8 +2875,8 @@ class NaslServer {
|
|
|
2808
2875
|
const promises = positions.map((item) =>
|
|
2809
2876
|
this.references({
|
|
2810
2877
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2811
|
-
line: lsp2tspNumber(currentSource.
|
|
2812
|
-
offset: lsp2tspNumber(currentSource.
|
|
2878
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2879
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2813
2880
|
})
|
|
2814
2881
|
);
|
|
2815
2882
|
const results = await Promise.all(promises);
|
|
@@ -2820,7 +2887,7 @@ class NaslServer {
|
|
|
2820
2887
|
}
|
|
2821
2888
|
if (node instanceof ProcessElement) {
|
|
2822
2889
|
if (currentSource) {
|
|
2823
|
-
const code = currentSource
|
|
2890
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2824
2891
|
const prefix = '__ProcessIdentification__';
|
|
2825
2892
|
let positions = [];
|
|
2826
2893
|
let pos = code.indexOf(prefix);
|
|
@@ -2833,8 +2900,8 @@ class NaslServer {
|
|
|
2833
2900
|
const promises = positions.map((item) =>
|
|
2834
2901
|
this.references({
|
|
2835
2902
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2836
|
-
line: lsp2tspNumber(currentSource.
|
|
2837
|
-
offset: lsp2tspNumber(currentSource.
|
|
2903
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2904
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2838
2905
|
})
|
|
2839
2906
|
);
|
|
2840
2907
|
const results = await Promise.all(promises);
|
|
@@ -2844,9 +2911,9 @@ class NaslServer {
|
|
|
2844
2911
|
}
|
|
2845
2912
|
}
|
|
2846
2913
|
if (node instanceof Return && node.parentNode instanceof ProcessElement) {
|
|
2847
|
-
const { currentSource } = this.getCurrentSource(node.parentNode);
|
|
2914
|
+
const { currentSource, fileNode } = this.getCurrentSource(node.parentNode);
|
|
2848
2915
|
if (currentSource) {
|
|
2849
|
-
const code = currentSource
|
|
2916
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2850
2917
|
const prefix = '__ProcessIdentification__';
|
|
2851
2918
|
const positions = [];
|
|
2852
2919
|
let pos = code.indexOf(prefix);
|
|
@@ -2867,8 +2934,8 @@ class NaslServer {
|
|
|
2867
2934
|
const promises = positions.map((item) =>
|
|
2868
2935
|
this.references({
|
|
2869
2936
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2870
|
-
line: lsp2tspNumber(currentSource.
|
|
2871
|
-
offset: lsp2tspNumber(currentSource.
|
|
2937
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2938
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2872
2939
|
})
|
|
2873
2940
|
);
|
|
2874
2941
|
const results = await Promise.all(promises);
|
|
@@ -3612,8 +3679,8 @@ class NaslServer {
|
|
|
3612
3679
|
handlingCurrentSourceException(currentSource: SourceMapItem, node: BaseNode) {
|
|
3613
3680
|
// 如果有前面的一些注解,元素在最后一行输出的值就给最后一行
|
|
3614
3681
|
if (node instanceof EntityProperty) {
|
|
3615
|
-
if (currentSource.
|
|
3616
|
-
currentSource.
|
|
3682
|
+
if (currentSource.start.line !== currentSource.end.line) {
|
|
3683
|
+
currentSource.start = { ...currentSource.start, line: currentSource.end.line };
|
|
3617
3684
|
}
|
|
3618
3685
|
}
|
|
3619
3686
|
}
|
|
@@ -3623,12 +3690,12 @@ class NaslServer {
|
|
|
3623
3690
|
const { currentSource, fileNode } = this.getCurrentSource(node);
|
|
3624
3691
|
if (currentSource && fileNode) {
|
|
3625
3692
|
const range = {
|
|
3626
|
-
line: lsp2tspNumber(currentSource.
|
|
3627
|
-
offset: lsp2tspNumber(currentSource.
|
|
3693
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
3694
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
3628
3695
|
};
|
|
3629
3696
|
// foreach 在最后一行自动补全
|
|
3630
3697
|
if (node.concept === 'ForEachStatement') {
|
|
3631
|
-
range.line = currentSource.
|
|
3698
|
+
range.line = currentSource.end.line;
|
|
3632
3699
|
range.offset = 0;
|
|
3633
3700
|
} else if (node.concept === 'BindAttribute') {
|
|
3634
3701
|
range.offset = range.offset + 7;
|
|
@@ -3795,7 +3862,7 @@ class NaslServer {
|
|
|
3795
3862
|
}
|
|
3796
3863
|
// 如果 入参不是虚拟节点的,就不去请求类型
|
|
3797
3864
|
// 只有虚拟节点的入参,才没有类型
|
|
3798
|
-
if (node.concept === 'Param' && node.parentKey !== 'virtualParams' && node.parentKey !== 'item') {
|
|
3865
|
+
if (node.concept === 'Param' && (node.parentKey !== 'virtualParams' && node.parentKey !== 'item' && node.parentNode.concept !== 'AnonymousFunction')) {
|
|
3799
3866
|
return;
|
|
3800
3867
|
}
|
|
3801
3868
|
if (
|
|
@@ -3830,36 +3897,40 @@ class NaslServer {
|
|
|
3830
3897
|
newQuickInfoNodes.push(itemDetail);
|
|
3831
3898
|
const fileDetail = {
|
|
3832
3899
|
file: filePath,
|
|
3833
|
-
line: lsp2tspNumber(item.
|
|
3834
|
-
offset: lsp2tspNumber(item.
|
|
3900
|
+
line: lsp2tspNumber(item.start.line),
|
|
3901
|
+
offset: lsp2tspNumber(item.start.character),
|
|
3902
|
+
};
|
|
3903
|
+
|
|
3904
|
+
const getCode = (range: SourceMapItem) => {
|
|
3905
|
+
return this.tsFiles.get(filePath)?.slice(range.start.offset, range.end.offset) ?? '';
|
|
3835
3906
|
};
|
|
3836
3907
|
|
|
3837
3908
|
// 位置计算偏移
|
|
3838
3909
|
if ('getQuickInfoOffset' in node) {
|
|
3839
|
-
Object.assign(fileDetail, (node as any).getQuickInfoOffset(fileDetail, item
|
|
3910
|
+
Object.assign(fileDetail, (node as any).getQuickInfoOffset(fileDetail, getCode(item)));
|
|
3840
3911
|
}
|
|
3841
3912
|
|
|
3842
3913
|
// 位置计算偏移2
|
|
3843
3914
|
// TODO: 之后考虑把这些偏移量计算全都挪到节点内部去
|
|
3844
3915
|
if (
|
|
3845
3916
|
node.concept === 'BinaryExpression' ||
|
|
3846
|
-
node.concept === 'CallLogic' ||
|
|
3847
3917
|
node.concept === 'CallFunction' ||
|
|
3848
3918
|
node.concept === 'CallInterface'
|
|
3849
3919
|
) {
|
|
3920
|
+
const code = getCode(item);
|
|
3850
3921
|
// 如果没有括号 ,括号就在外面,就 -1
|
|
3851
3922
|
// 有括号就找到括号的位置 然后 -1
|
|
3852
3923
|
let indexOf = 0;
|
|
3853
|
-
if (!
|
|
3924
|
+
if (!code.includes('(')) {
|
|
3854
3925
|
indexOf = -1;
|
|
3855
3926
|
} else {
|
|
3856
3927
|
// 如果有泛型先往前找一找
|
|
3857
|
-
if (
|
|
3858
|
-
indexOf = Math.min(
|
|
3928
|
+
if (code.includes('<')) {
|
|
3929
|
+
indexOf = Math.min(code.indexOf('<'), code.indexOf('('));
|
|
3859
3930
|
} else {
|
|
3860
|
-
indexOf =
|
|
3931
|
+
indexOf = code.indexOf('(');
|
|
3861
3932
|
}
|
|
3862
|
-
const subStr =
|
|
3933
|
+
const subStr = code.substring(0, indexOf);
|
|
3863
3934
|
const codeArr = subStr?.split('.');
|
|
3864
3935
|
const lastLen = codeArr?.[codeArr.length - 1]?.length;
|
|
3865
3936
|
indexOf = subStr.length - lastLen;
|
|
@@ -3871,28 +3942,31 @@ class NaslServer {
|
|
|
3871
3942
|
node.concept === 'QueryFieldExpression' ||
|
|
3872
3943
|
node.concept === 'QueryGroupByExpression'
|
|
3873
3944
|
) {
|
|
3874
|
-
|
|
3875
|
-
|
|
3945
|
+
const code = getCode(item);
|
|
3946
|
+
if (code.includes('.')) {
|
|
3947
|
+
const codeArr = code?.split('.');
|
|
3876
3948
|
const lastLen = codeArr?.[codeArr.length - 1]?.length;
|
|
3877
3949
|
// MemberExpression取最后一位当做类型
|
|
3878
|
-
const indexOf =
|
|
3950
|
+
const indexOf = code.length - lastLen;
|
|
3879
3951
|
fileDetail.offset = fileDetail.offset + indexOf;
|
|
3880
3952
|
}
|
|
3881
3953
|
} else if (node.concept === 'Match') {
|
|
3954
|
+
const code = getCode(item);
|
|
3882
3955
|
// 去查return 后面的返回值,变成函数调用
|
|
3883
|
-
if (
|
|
3884
|
-
fileDetail.line = item.
|
|
3956
|
+
if (code?.endsWith(';\n')) {
|
|
3957
|
+
fileDetail.line = item.end.line - 1;
|
|
3885
3958
|
} else {
|
|
3886
|
-
fileDetail.line = item.
|
|
3959
|
+
fileDetail.line = item.end.line;
|
|
3887
3960
|
}
|
|
3888
|
-
const indexOf =
|
|
3889
|
-
let newCode =
|
|
3961
|
+
const indexOf = code.indexOf('return __MatchExpressionFuntion');
|
|
3962
|
+
let newCode = code.substring(0, indexOf);
|
|
3890
3963
|
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
3891
3964
|
fileDetail.offset = newCode.length + 'return '.length;
|
|
3892
3965
|
} else if (['NewComposite', 'NewList', 'NewMap'].includes(node.concept)) {
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3966
|
+
const code = getCode(item);
|
|
3967
|
+
fileDetail.line = item.end.line;
|
|
3968
|
+
const indexOf = code.indexOf('return __newComposite');
|
|
3969
|
+
let newCode = code.substring(0, indexOf);
|
|
3896
3970
|
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
3897
3971
|
fileDetail.offset = newCode.length + 'return '.length;
|
|
3898
3972
|
} else if (['OqlQueryComponent'].includes(node.concept)) {
|
|
@@ -3912,7 +3986,13 @@ class NaslServer {
|
|
|
3912
3986
|
|
|
3913
3987
|
types.set(node, Object.freeze(nodeTypeAnnotation) as TypeAnnotation);
|
|
3914
3988
|
|
|
3915
|
-
|
|
3989
|
+
const type = itemType ? (Object.isFrozen(itemType) ? itemType : Object.freeze(itemType)) : null;
|
|
3990
|
+
|
|
3991
|
+
if (type) {
|
|
3992
|
+
(node as any).__nodeType = type;
|
|
3993
|
+
} else {
|
|
3994
|
+
delete (node as any).__nodeType;
|
|
3995
|
+
}
|
|
3916
3996
|
});
|
|
3917
3997
|
|
|
3918
3998
|
await utils.timeSlicing(Array.from(getFromOthers.entries()), ([node]) => {
|
|
@@ -3947,7 +4027,7 @@ class NaslServer {
|
|
|
3947
4027
|
if (typeAnnotation.typeName === 'List' && typeAnnotation.typeKind === 'generic') {
|
|
3948
4028
|
const typeArguments = typeAnnotation.typeArguments;
|
|
3949
4029
|
if (typeArguments.length && typeArguments[0].isComplexType()) {
|
|
3950
|
-
node.__TypeAnnotation
|
|
4030
|
+
delete node.__TypeAnnotation;
|
|
3951
4031
|
return;
|
|
3952
4032
|
}
|
|
3953
4033
|
}
|
|
@@ -3960,12 +4040,12 @@ class NaslServer {
|
|
|
3960
4040
|
}
|
|
3961
4041
|
} else {
|
|
3962
4042
|
// 清空原来已经赋值上去的类型,可能原来有现在没有了
|
|
3963
|
-
node.__TypeAnnotation
|
|
4043
|
+
delete node.__TypeAnnotation;
|
|
3964
4044
|
}
|
|
3965
4045
|
} catch (err) {
|
|
3966
|
-
if (globalThis.window) {
|
|
3967
|
-
|
|
3968
|
-
}
|
|
4046
|
+
// if (globalThis.window) {
|
|
4047
|
+
// console.log(err);
|
|
4048
|
+
// }
|
|
3969
4049
|
}
|
|
3970
4050
|
});
|
|
3971
4051
|
return types;
|
|
@@ -4119,7 +4199,7 @@ class NaslServer {
|
|
|
4119
4199
|
) {
|
|
4120
4200
|
const { currentSource, fileNode } = matchExpression?.getCurrentSource();
|
|
4121
4201
|
fileNode.sourceMap.forEach((item, itemNode) => {
|
|
4122
|
-
if (itemNode.concept === matchExpression.concept && item
|
|
4202
|
+
if (itemNode.concept === matchExpression.concept && isSameRange(item, currentSource)) {
|
|
4123
4203
|
const jsonNode = jsoner.queryNodeByPath(json, itemNode.getNodePath(false));
|
|
4124
4204
|
jsonNode.typeAnnotation = matchExpression.__TypeAnnotation;
|
|
4125
4205
|
}
|
|
@@ -4428,8 +4508,8 @@ class NaslServer {
|
|
|
4428
4508
|
*/
|
|
4429
4509
|
const oldRefs = await this.references({
|
|
4430
4510
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
4431
|
-
line: lsp2tspNumber(currentSource.
|
|
4432
|
-
offset: lsp2tspNumber(currentSource.
|
|
4511
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
4512
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
4433
4513
|
});
|
|
4434
4514
|
oldRefs.refs.forEach((ref) => this.filesToCheck.add(ref.file));
|
|
4435
4515
|
// 更新文件之后
|
|
@@ -4437,8 +4517,8 @@ class NaslServer {
|
|
|
4437
4517
|
|
|
4438
4518
|
const newRefs2 = await this.references({
|
|
4439
4519
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
4440
|
-
line: lsp2tspNumber(currentSource.
|
|
4441
|
-
offset: lsp2tspNumber(currentSource.
|
|
4520
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
4521
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
4442
4522
|
});
|
|
4443
4523
|
newRefs2.refs.forEach((ref) => this.filesToCheck.add(ref.file));
|
|
4444
4524
|
}
|
|
@@ -4573,9 +4653,14 @@ class NaslServer {
|
|
|
4573
4653
|
return;
|
|
4574
4654
|
}
|
|
4575
4655
|
|
|
4576
|
-
|
|
4656
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4657
|
+
console.time('重新生成 TS 文件');
|
|
4658
|
+
}
|
|
4577
4659
|
const result = (fileNode as FileNode).toEmbeddedTSFile();
|
|
4578
|
-
|
|
4660
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4661
|
+
console.timeEnd('重新生成 TS 文件');
|
|
4662
|
+
console.log('重新生成 TS 文件', (fileNode as FileNode).getEmbeddedFilePath());
|
|
4663
|
+
}
|
|
4579
4664
|
|
|
4580
4665
|
// 当前操作的节点
|
|
4581
4666
|
// 如果当前没有生成tsFile
|
|
@@ -4622,13 +4707,19 @@ class NaslServer {
|
|
|
4622
4707
|
if (this.changeStackList.length) {
|
|
4623
4708
|
this.changeFileNext();
|
|
4624
4709
|
} else {
|
|
4625
|
-
|
|
4710
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4711
|
+
console.info('校验以下文件', Array.from(this.filesToCheck));
|
|
4712
|
+
}
|
|
4626
4713
|
await this.getDiagnosticRecordsAndPushAll(Array.from(this.filesToCheck));
|
|
4627
4714
|
this.filesToCheck.clear();
|
|
4628
4715
|
}
|
|
4629
4716
|
});
|
|
4630
4717
|
}
|
|
4631
4718
|
}
|
|
4719
|
+
|
|
4720
|
+
private getNodeCode(fileNode: BaseNode, range: SourceMapItem) {
|
|
4721
|
+
return (this.tsFiles.get((fileNode as any).getEmbeddedFilePath()) ?? '').slice(range.start.offset, range.end.offset)
|
|
4722
|
+
}
|
|
4632
4723
|
}
|
|
4633
4724
|
|
|
4634
4725
|
export { NaslServer };
|