@lcap/nasl 3.4.0-alpha.1 → 3.4.0-alpha.2
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 +116 -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 +14 -16
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +3 -2
- package/out/concepts/Anchor__.js +18 -19
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +3 -2
- package/out/concepts/AnonymousFunction__.js +29 -27
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +160 -157
- package/out/concepts/App__.js +108 -81
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +3 -2
- package/out/concepts/Argument__.js +22 -21
- 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 +14 -16
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +3 -2
- package/out/concepts/Assignment__.js +33 -27
- 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 +38 -33
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +32 -31
- package/out/concepts/Backend__.js +22 -21
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +3 -2
- package/out/concepts/BatchAssignment__.js +45 -36
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +3 -2
- package/out/concepts/BinaryExpression__.js +44 -39
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +12 -8
- package/out/concepts/BindAttribute__.js +96 -53
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +5 -3
- package/out/concepts/BindDirective__.js +33 -27
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +3 -2
- package/out/concepts/BindEvent__.js +51 -17
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +5 -3
- package/out/concepts/BindStyle__.js +23 -22
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +3 -2
- package/out/concepts/BooleanLiteral__.js +16 -17
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +3 -2
- package/out/concepts/CallAuthInterface__.js +16 -18
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +5 -4
- package/out/concepts/CallConnector__.js +40 -33
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +3 -2
- package/out/concepts/CallFunction__.js +32 -26
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +3 -2
- package/out/concepts/CallInterface__.js +35 -30
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +6 -5
- package/out/concepts/CallLogic__.js +134 -79
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +3 -2
- package/out/concepts/CallQueryComponent__.js +56 -40
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +3 -2
- package/out/concepts/Comment__.js +16 -17
- 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 +25 -22
- 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 +24 -22
- 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 -10
- package/out/concepts/Destination__.js +38 -37
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +3 -2
- package/out/concepts/End__.js +14 -16
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +4 -3
- package/out/concepts/EntityIndex__.js +22 -20
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +4 -3
- package/out/concepts/EntityProperty__.js +50 -50
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +3 -2
- package/out/concepts/Entity__.js +31 -26
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +3 -2
- package/out/concepts/EnumItem__.js +18 -18
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +3 -2
- package/out/concepts/Enum__.js +22 -21
- 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 -2
- package/out/concepts/ForEachStatement__.js +20 -16
- 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 +46 -38
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +3 -2
- package/out/concepts/Function__.js +36 -31
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +4 -3
- package/out/concepts/Identifier__.js +29 -28
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +3 -2
- package/out/concepts/IfStatement__.js +20 -21
- 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 +34 -6
- package/out/concepts/Interface__.js +106 -35
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +3 -2
- package/out/concepts/JSBlock__.js +16 -17
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +4 -3
- package/out/concepts/JavaLogic__.js +21 -20
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +3 -2
- package/out/concepts/LogicItem__.js +22 -20
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +17 -17
- package/out/concepts/Logic__.js +113 -56
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +3 -2
- package/out/concepts/MatchCase__.js +23 -22
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +3 -2
- package/out/concepts/Match__.js +19 -20
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +3 -2
- package/out/concepts/MemberExpression__.js +64 -40
- 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 -2
- package/out/concepts/NewComposite__.js +70 -42
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +5 -3
- package/out/concepts/NewList__.js +34 -24
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +5 -3
- package/out/concepts/NewMap__.js +38 -27
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +3 -2
- package/out/concepts/New__.js +14 -16
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +3 -2
- package/out/concepts/NullLiteral__.js +14 -16
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +3 -2
- package/out/concepts/NumericLiteral__.js +20 -20
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +3 -2
- package/out/concepts/OqlQueryComponent__.js +25 -22
- 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 -2
- package/out/concepts/Param__.js +34 -28
- 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 +60 -45
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +3 -2
- package/out/concepts/ProcessOutcome__.js +16 -17
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +3 -2
- package/out/concepts/ProcessOutcomes__.js +14 -16
- 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 +22 -21
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +4 -3
- package/out/concepts/QueryFieldExpression__.js +20 -19
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +4 -3
- package/out/concepts/QueryFromExpression__.js +22 -21
- 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 +28 -24
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +3 -2
- package/out/concepts/QueryLimitExpression__.js +21 -21
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +3 -2
- package/out/concepts/QueryOrderByExpression__.js +21 -21
- 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 -2
- package/out/concepts/Return__.js +28 -25
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +3 -2
- package/out/concepts/Role__.js +21 -20
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +3 -2
- package/out/concepts/SelectMembers__.js +19 -20
- 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 -2
- package/out/concepts/SqlQueryComponent__.js +27 -23
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +3 -2
- package/out/concepts/Start__.js +14 -16
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +3 -2
- package/out/concepts/StringInterpolation__.js +16 -18
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +3 -2
- package/out/concepts/StringLiteral__.js +14 -16
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +9 -4
- package/out/concepts/StructureProperty__.js +39 -29
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +7 -11
- package/out/concepts/Structure__.js +51 -32
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +3 -2
- package/out/concepts/SwitchCase__.js +19 -20
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +3 -2
- package/out/concepts/SwitchStatement__.js +22 -20
- 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 +25 -62
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -5
- package/out/concepts/TypeAnnotation__.js +55 -32
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +3 -2
- package/out/concepts/TypeParam__.js +16 -17
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +3 -2
- package/out/concepts/UnaryExpression__.js +20 -20
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +3 -2
- package/out/concepts/Unparsed__.js +16 -17
- 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 -2
- package/out/concepts/Variable__.js +28 -25
- 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 +84 -81
- package/out/concepts/ViewElement__.js +324 -153
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +5 -3
- package/out/concepts/View__.js +139 -113
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +3 -2
- package/out/concepts/WhileStatement__.js +19 -20
- 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/natural/genNaturalTS.js +15 -14
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/index.d.ts +0 -2
- package/out/natural/index.js +0 -2
- package/out/natural/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 +213 -120
- 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/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/env.d.ts +2 -0
- package/out/utils/env.js +6 -0
- package/out/utils/env.js.map +1 -0
- package/out/utils/index.d.ts +3 -0
- package/out/utils/index.js +3 -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/time-slicing.js +2 -1
- package/out/utils/time-slicing.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 +1 -1
- 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 +141 -80
- 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 +18 -20
- package/src/concepts/Anchor__.ts +21 -22
- package/src/concepts/AnonymousFunction__.ts +38 -37
- package/src/concepts/App__.ts +366 -315
- package/src/concepts/Argument__.ts +26 -25
- package/src/concepts/Assignee__.ts +40 -38
- package/src/concepts/AssignmentLine__.ts +18 -21
- package/src/concepts/Assignment__.ts +43 -32
- 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 +53 -52
- package/src/concepts/Backend__.ts +57 -58
- package/src/concepts/BatchAssignment__.ts +85 -58
- package/src/concepts/BinaryExpression__.ts +85 -43
- package/src/concepts/BindAttribute__.ts +146 -107
- package/src/concepts/BindDirective__.ts +43 -39
- package/src/concepts/BindEvent__.ts +80 -31
- package/src/concepts/BindStyle__.ts +35 -34
- package/src/concepts/BooleanLiteral__.ts +20 -21
- package/src/concepts/CallAuthInterface__.ts +27 -30
- package/src/concepts/CallConnector__.ts +48 -39
- package/src/concepts/CallFunction__.ts +43 -35
- package/src/concepts/CallInterface__.ts +46 -40
- package/src/concepts/CallLogic__.ts +163 -90
- package/src/concepts/CallQueryComponent__.ts +154 -86
- package/src/concepts/Comment__.ts +19 -20
- 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 +41 -35
- 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 +28 -34
- package/src/concepts/DataSource__.ts +37 -33
- package/src/concepts/DatabaseTypeAnnotation__.ts +24 -24
- package/src/concepts/Destination__.ts +49 -46
- package/src/concepts/End__.ts +21 -23
- package/src/concepts/EntityIndex__.ts +34 -31
- package/src/concepts/EntityProperty__.ts +62 -66
- package/src/concepts/Entity__.ts +40 -40
- package/src/concepts/EnumItem__.ts +22 -25
- package/src/concepts/Enum__.ts +27 -28
- package/src/concepts/Event__.ts +33 -33
- package/src/concepts/ExternalDestination__.ts +29 -29
- package/src/concepts/ForEachStatement__.ts +30 -25
- package/src/concepts/FrontendLibrary__.ts +37 -38
- package/src/concepts/FrontendVariable__.ts +18 -20
- package/src/concepts/Frontend__.ts +65 -61
- package/src/concepts/Function__.ts +52 -50
- package/src/concepts/Identifier__.ts +35 -32
- package/src/concepts/IfStatement__.ts +37 -38
- package/src/concepts/Integration__.ts +244 -24
- package/src/concepts/InterfaceParam__.ts +69 -33
- package/src/concepts/Interface__.ts +122 -47
- package/src/concepts/JSBlock__.ts +20 -21
- package/src/concepts/JavaLogic__.ts +25 -24
- package/src/concepts/LogicItem__.ts +27 -36
- package/src/concepts/Logic__.ts +168 -90
- package/src/concepts/MatchCase__.ts +38 -40
- package/src/concepts/Match__.ts +25 -26
- package/src/concepts/MemberExpression__.ts +172 -120
- 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 +128 -76
- package/src/concepts/NewList__.ts +43 -34
- package/src/concepts/NewMap__.ts +49 -37
- package/src/concepts/New__.ts +18 -20
- package/src/concepts/NullLiteral__.ts +18 -20
- package/src/concepts/NumericLiteral__.ts +24 -24
- package/src/concepts/OqlQueryComponent__.ts +31 -26
- package/src/concepts/OverriddenLogic__.ts +128 -94
- package/src/concepts/Param__.ts +50 -50
- package/src/concepts/Point__.ts +22 -22
- package/src/concepts/ProcessComponent__.ts +36 -37
- package/src/concepts/ProcessElement__.ts +112 -84
- package/src/concepts/ProcessOutcome__.ts +20 -21
- package/src/concepts/ProcessOutcomes__.ts +18 -20
- package/src/concepts/Process__.ts +69 -63
- package/src/concepts/QueryAggregateExpression__.ts +26 -25
- package/src/concepts/QueryFieldExpression__.ts +24 -23
- package/src/concepts/QueryFromExpression__.ts +27 -26
- package/src/concepts/QueryGroupByExpression__.ts +22 -23
- package/src/concepts/QueryJoinExpression__.ts +60 -39
- package/src/concepts/QueryLimitExpression__.ts +25 -25
- package/src/concepts/QueryOrderByExpression__.ts +25 -25
- package/src/concepts/QuerySelectExpression__.ts +105 -54
- package/src/concepts/Rect__.ts +26 -24
- package/src/concepts/Return__.ts +40 -47
- package/src/concepts/Role__.ts +24 -24
- package/src/concepts/SelectMembers__.ts +28 -30
- package/src/concepts/Slot__.ts +32 -30
- package/src/concepts/SqlQueryComponent__.ts +39 -29
- package/src/concepts/Start__.ts +18 -20
- package/src/concepts/StringInterpolation__.ts +22 -25
- package/src/concepts/StringLiteral__.ts +18 -20
- package/src/concepts/StructureProperty__.ts +44 -36
- package/src/concepts/Structure__.ts +62 -45
- package/src/concepts/SwitchCase__.ts +38 -39
- package/src/concepts/SwitchStatement__.ts +26 -24
- 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 +31 -81
- package/src/concepts/TypeAnnotation__.ts +90 -51
- package/src/concepts/TypeParam__.ts +19 -20
- package/src/concepts/UnaryExpression__.ts +23 -23
- package/src/concepts/Unparsed__.ts +19 -20
- package/src/concepts/UseComponent__.ts +22 -22
- package/src/concepts/ValidationRule__.ts +537 -553
- package/src/concepts/Variable__.ts +41 -47
- package/src/concepts/ViewBlock__.ts +26 -25
- package/src/concepts/ViewComponent__.ts +87 -91
- package/src/concepts/ViewElement__.ts +2750 -2423
- package/src/concepts/View__.ts +337 -301
- package/src/concepts/WhileStatement__.ts +33 -34
- 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/natural/genNaturalTS.ts +18 -17
- package/src/natural/index.ts +0 -2
- 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 +215 -122
- 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/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/env.ts +2 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/logger.ts +13 -0
- package/src/utils/time-slicing.ts +3 -1
- package/src/utils/types.ts +1 -0
- package/src/utils/window.ts +9 -0
- package/test/concepts/anonymous-function/__snapshots__/toEmbeddedTS.spec.ts.snap +8 -0
- package/test/concepts/anonymous-function/__snapshots__/toJS.spec.ts.snap +3 -0
- package/test/concepts/anonymous-function/__snapshots__/toVue.spec.ts.snap +6 -0
- package/test/concepts/anonymous-function/constant.ts +5 -0
- package/test/concepts/anonymous-function/fixtures/simple.json +85 -0
- package/test/concepts/anonymous-function/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/anonymous-function/toJS.spec.ts +14 -0
- package/test/concepts/anonymous-function/toVue.spec.ts +14 -0
- package/test/concepts/assignment/__snapshots__/toEmbeddedTS.spec.ts.snap +21 -0
- package/test/concepts/assignment/__snapshots__/toJS.spec.ts.snap +9 -0
- package/test/concepts/assignment/__snapshots__/toVue.spec.ts.snap +21 -0
- package/test/concepts/assignment/constant.ts +5 -0
- package/test/concepts/assignment/fixtures/both-space.json +4 -0
- package/test/concepts/assignment/fixtures/left-space.json +14 -0
- package/test/concepts/assignment/fixtures/right-space.json +8 -0
- package/test/concepts/assignment/fixtures/simple.json +12 -0
- package/test/concepts/assignment/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/assignment/toJS.spec.ts +14 -0
- package/test/concepts/assignment/toVue.spec.ts +14 -0
- package/test/concepts/batch-assignment/__snapshots__/toEmbeddedTS.spec.ts.snap +28 -0
- package/test/concepts/batch-assignment/__snapshots__/toJS.spec.ts.snap +13 -0
- package/test/concepts/batch-assignment/__snapshots__/toVue.spec.ts.snap +14 -0
- package/test/concepts/batch-assignment/constant.ts +5 -0
- package/test/concepts/batch-assignment/fixtures/muli-var-muli-value.json +144 -0
- package/test/concepts/batch-assignment/fixtures/simple-var-simple-value.json +36 -0
- package/test/concepts/batch-assignment/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/batch-assignment/toJS.spec.ts +14 -0
- package/test/concepts/batch-assignment/toVue.spec.ts +14 -0
- package/test/concepts/binary-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +25 -0
- package/test/concepts/binary-expression/__snapshots__/toJS.spec.ts.snap +16 -0
- package/test/concepts/binary-expression/__snapshots__/toVue.spec.ts.snap +19 -0
- package/test/concepts/binary-expression/constant.ts +5 -0
- package/test/concepts/binary-expression/fixtures/constant-nested.json +36 -0
- package/test/concepts/binary-expression/fixtures/constant-simple.json +12 -0
- package/test/concepts/binary-expression/fixtures/variable-nested.json +69 -0
- package/test/concepts/binary-expression/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/binary-expression/toJS.spec.ts +14 -0
- package/test/concepts/binary-expression/toVue.spec.ts +14 -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/data-source/__snapshots__/toEmbeddedTS.spec.ts.snap +8 -0
- package/test/concepts/data-source/__snapshots__/toEmbeddedTSFile.spec.ts.snap +12 -0
- package/test/concepts/data-source/constant.ts +5 -0
- package/test/concepts/data-source/fixtures/normal.json +289 -0
- package/test/concepts/data-source/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/data-source/toEmbeddedTSFile.spec.ts +15 -0
- package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +74 -0
- package/test/concepts/entity/__snapshots__/toEmbeddedTSFile.spec.ts.snap +3 -0
- package/test/concepts/entity/constant.ts +5 -0
- package/test/concepts/entity/fixtures/normal.json +469 -0
- package/test/concepts/entity/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/entity/toEmbeddedTSFile.spec.ts +14 -0
- 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 +324 -12
- 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/knowledgeMap.d.ts +0 -4
- package/out/natural/knowledgeMap.js +0 -40
- package/out/natural/knowledgeMap.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/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/knowledgeMap.ts +0 -39
- 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
|
@@ -85,7 +85,8 @@ import {
|
|
|
85
85
|
TriggerLauncher,
|
|
86
86
|
CallConnector,
|
|
87
87
|
} from '../concepts';
|
|
88
|
-
|
|
88
|
+
|
|
89
|
+
import { lsp2tspNumber, SourceMap, SourceMapItem, isSameRange } from '../translator';
|
|
89
90
|
import axios from '../service/storage';
|
|
90
91
|
import { translateDiagnosticMessage, naslNodeTranslateMessage, MinRange, checkAStructure_ } from './translator';
|
|
91
92
|
import { EventPayload, invokeCommand, registerCommand } from '../common';
|
|
@@ -143,15 +144,14 @@ type QuickInfoNodes = Array<{ filePath: string; node: BaseNode; item: SourceMapI
|
|
|
143
144
|
|
|
144
145
|
let isChangeInterface = false; // 判断是否导入接口
|
|
145
146
|
type ActionNode = { target: Variable; typeannotation: TypeAnnotation };
|
|
146
|
-
let actionArr: Array<ActionNode> = [];
|
|
147
|
-
let timer: number = null;
|
|
148
|
-
const __naslStdlibFileCacheMap: Map<tsProtocol.OpenRequestArgs['file'], tsProtocol.OpenRequestArgs> = new Map(); // naslStdlib文件缓存
|
|
147
|
+
let actionArr: Array<ActionNode> = []; //用于导入接口收集更改的节点
|
|
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
|
} if (item.includes(' ')) {
|
|
@@ -185,11 +185,12 @@ export function getDisplayString2Type(displayString: string) {
|
|
|
185
185
|
|
|
186
186
|
@sentryMonitorNaslServer
|
|
187
187
|
class NaslServer {
|
|
188
|
-
|
|
188
|
+
/** naslStdlib文件缓存 */
|
|
189
|
+
naslStdlibFileCacheMap: Map<tsProtocol.OpenRequestArgs['file'], tsProtocol.OpenRequestArgs> = new Map();
|
|
189
190
|
|
|
190
|
-
messager: Messager
|
|
191
|
+
messager: Messager;
|
|
191
192
|
|
|
192
|
-
worker: Worker
|
|
193
|
+
worker: Worker;
|
|
193
194
|
|
|
194
195
|
/**
|
|
195
196
|
* 按道理 fileSourceMap: new Map<string, SourceMap>() 比较合理,
|
|
@@ -198,12 +199,22 @@ class NaslServer {
|
|
|
198
199
|
*/
|
|
199
200
|
file2NodeMap: Map<string, BaseNode> = new Map<string, BaseNode>();
|
|
200
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
|
+
|
|
201
212
|
elementsLogic: { [elementLogicName: string]: Array<Logic> } = {};
|
|
202
213
|
|
|
203
214
|
// 错误日志收集
|
|
204
|
-
diagnosticManager: DiagnosticManager
|
|
215
|
+
diagnosticManager: DiagnosticManager;
|
|
205
216
|
|
|
206
|
-
embeddedTSEmitter: EventEmitter
|
|
217
|
+
embeddedTSEmitter: EventEmitter;
|
|
207
218
|
|
|
208
219
|
// 需要执行修改的文件
|
|
209
220
|
changeStackList: Array<EventPayload> = [];
|
|
@@ -521,6 +532,24 @@ class NaslServer {
|
|
|
521
532
|
launcher.sourceMap = result.sourceMap;
|
|
522
533
|
this.file2NodeMap.set(result.filePath, launcher);
|
|
523
534
|
});
|
|
535
|
+
module.namespaces?.forEach?.((namespace) => {
|
|
536
|
+
namespace.logics.forEach((logic) => {
|
|
537
|
+
const result = logic.toEmbeddedTSFile();
|
|
538
|
+
results.push(result);
|
|
539
|
+
// sourceMap都存在目录级别内容下,在页面层级下去找
|
|
540
|
+
logic.sourceMap = result.sourceMap;
|
|
541
|
+
this.file2NodeMap.set(result.filePath, logic);
|
|
542
|
+
});
|
|
543
|
+
})
|
|
544
|
+
module?.authLogicsForCallInterface?.forEach?.((logic) => {
|
|
545
|
+
try {
|
|
546
|
+
if (!(logic instanceof Logic)) return;
|
|
547
|
+
const result = logic.toEmbeddedTSFile();
|
|
548
|
+
results.push(result);
|
|
549
|
+
logic.sourceMap = result.sourceMap;
|
|
550
|
+
this.file2NodeMap.set(result.filePath, logic);
|
|
551
|
+
} catch (err) {}
|
|
552
|
+
});
|
|
524
553
|
} catch (error) {
|
|
525
554
|
console.error(error);
|
|
526
555
|
}
|
|
@@ -600,6 +629,7 @@ class NaslServer {
|
|
|
600
629
|
// 其他模块的创建内容
|
|
601
630
|
app.dependencies.forEach((item) => this.contentToFile(item, results));
|
|
602
631
|
app.interfaceDependencies.forEach((item) => this.contentToFile(item, results));
|
|
632
|
+
app.integration?.connectors?.forEach((item) => this.contentToFile(item, results));
|
|
603
633
|
} catch (err) {
|
|
604
634
|
console.log(err);
|
|
605
635
|
}
|
|
@@ -646,7 +676,7 @@ class NaslServer {
|
|
|
646
676
|
|
|
647
677
|
// 缓存添加过的文件
|
|
648
678
|
cacheFile(options: tsProtocol.OpenRequestArgs) {
|
|
649
|
-
|
|
679
|
+
this.naslStdlibFileCacheMap.set(options.file, options);
|
|
650
680
|
}
|
|
651
681
|
|
|
652
682
|
/** u
|
|
@@ -654,6 +684,7 @@ class NaslServer {
|
|
|
654
684
|
* @param {*} files
|
|
655
685
|
*/
|
|
656
686
|
writeFiles(files: Array<tsProtocol.OpenRequestArgs>) {
|
|
687
|
+
files.forEach(({ file, fileContent }) => this.tsFiles.set(file, fileContent));
|
|
657
688
|
return this.messager.requestCommand('writeFiles', files);
|
|
658
689
|
}
|
|
659
690
|
|
|
@@ -663,6 +694,7 @@ class NaslServer {
|
|
|
663
694
|
* @param {*} args
|
|
664
695
|
*/
|
|
665
696
|
updateFiles(args: { outputFiles: Array<tsProtocol.OpenRequestArgs> }) {
|
|
697
|
+
args.outputFiles.forEach(({ file, fileContent }) => this.tsFiles.set(file, fileContent));
|
|
666
698
|
return this.messager.requestCommand('updateFiles', args);
|
|
667
699
|
}
|
|
668
700
|
|
|
@@ -670,20 +702,22 @@ class NaslServer {
|
|
|
670
702
|
* 清除一个目录下的所有文件
|
|
671
703
|
*/
|
|
672
704
|
deleteDirectoryFiles(args: { directoryName: string }) {
|
|
705
|
+
Array.from(this.tsFiles.keys())
|
|
706
|
+
.filter((key) => key.startsWith(args.directoryName))
|
|
707
|
+
.forEach((key) => this.tsFiles.delete(key));
|
|
708
|
+
|
|
673
709
|
return this.messager.requestCommand('deleteDirectoryFiles', args);
|
|
674
710
|
}
|
|
675
711
|
|
|
676
712
|
async _debugInFileStorage(node: BaseNode, openFiles: Array<tsProtocol.OpenRequestArgs>) {
|
|
677
713
|
let app = node;
|
|
678
|
-
let openDebugEmbedded = true;
|
|
679
714
|
if (node.concept !== 'App') {
|
|
680
715
|
app = (node as any).rootNode || (node as any).app;
|
|
681
716
|
}
|
|
682
717
|
/// #if process.env.NODE_ENV === 'development'
|
|
683
718
|
// 首次尝试请求
|
|
684
|
-
await axios.post(
|
|
685
|
-
|
|
686
|
-
if (openDebugEmbedded && globalThis.window) {
|
|
719
|
+
await axios.post('/api/App/debugEmbedded?id=' + app.id, openFiles[0]).catch(() => (this.openDebugEmbedded = false));
|
|
720
|
+
if (this.openDebugEmbedded && globalThis.window) {
|
|
687
721
|
// For TS build
|
|
688
722
|
try {
|
|
689
723
|
let canDebug = true;
|
|
@@ -698,8 +732,7 @@ class NaslServer {
|
|
|
698
732
|
);
|
|
699
733
|
}
|
|
700
734
|
} catch (e) {
|
|
701
|
-
//
|
|
702
|
-
openDebugEmbedded = false;
|
|
735
|
+
// ..
|
|
703
736
|
}
|
|
704
737
|
}
|
|
705
738
|
/// #endif
|
|
@@ -738,8 +771,8 @@ class NaslServer {
|
|
|
738
771
|
return this._getValueSelectCompletion({
|
|
739
772
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
740
773
|
range: {
|
|
741
|
-
line: lsp2tspNumber(currentSource.
|
|
742
|
-
offset: lsp2tspNumber(currentSource.
|
|
774
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
775
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
743
776
|
},
|
|
744
777
|
value,
|
|
745
778
|
noFilterList,
|
|
@@ -773,8 +806,8 @@ class NaslServer {
|
|
|
773
806
|
try {
|
|
774
807
|
const quickInfo = await this._getTypeQuickinfo({
|
|
775
808
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
776
|
-
line: lsp2tspNumber(currentSource.
|
|
777
|
-
offset: lsp2tspNumber(currentSource.
|
|
809
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
810
|
+
offset: lsp2tspNumber(currentSource.start.character) + `nasl.util.C`.length,
|
|
778
811
|
});
|
|
779
812
|
if (quickInfo.responseRequired) {
|
|
780
813
|
const displayString = quickInfo?.response?.displayString || '';
|
|
@@ -819,8 +852,8 @@ class NaslServer {
|
|
|
819
852
|
}
|
|
820
853
|
const quickInfo = await this._getTypeQuickinfo({
|
|
821
854
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
822
|
-
line: lsp2tspNumber(currentSource.
|
|
823
|
-
offset: lsp2tspNumber(currentSource.
|
|
855
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
856
|
+
offset: lsp2tspNumber(currentSource.start.character) + `new nasl.ui.`.length,
|
|
824
857
|
});
|
|
825
858
|
if (quickInfo.responseRequired) {
|
|
826
859
|
const displayString = quickInfo?.response?.displayString || '';
|
|
@@ -878,8 +911,8 @@ class NaslServer {
|
|
|
878
911
|
}
|
|
879
912
|
const quickInfo = await this._getTypeQuickinfo({
|
|
880
913
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
881
|
-
line: lsp2tspNumber(currentSource.
|
|
882
|
-
offset: lsp2tspNumber(currentSource.
|
|
914
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
915
|
+
offset: lsp2tspNumber(currentSource.start.character) + `new nasl.ui.`.length,
|
|
883
916
|
});
|
|
884
917
|
if (quickInfo.responseRequired) {
|
|
885
918
|
const displayString = quickInfo?.response?.displayString || '';
|
|
@@ -973,8 +1006,8 @@ class NaslServer {
|
|
|
973
1006
|
return this._getSelectNextCompletion({
|
|
974
1007
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
975
1008
|
range: {
|
|
976
|
-
line: lsp2tspNumber(currentSource.
|
|
977
|
-
offset: lsp2tspNumber(currentSource.
|
|
1009
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
1010
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
978
1011
|
},
|
|
979
1012
|
noFilterList,
|
|
980
1013
|
});
|
|
@@ -1021,7 +1054,7 @@ class NaslServer {
|
|
|
1021
1054
|
|
|
1022
1055
|
oldRecord?.semanticDiagnostics.forEach((item) => {
|
|
1023
1056
|
if (item.node) {
|
|
1024
|
-
item.node.tsErrorDetail
|
|
1057
|
+
delete item.node.tsErrorDetail;
|
|
1025
1058
|
// 如果logic中有报错就把标识置为true
|
|
1026
1059
|
if ((item.node as any)?.logic?.haveError) {
|
|
1027
1060
|
(item.node as any).logic.haveError = false;
|
|
@@ -1032,7 +1065,7 @@ class NaslServer {
|
|
|
1032
1065
|
// 清空一些状态
|
|
1033
1066
|
oldRecord?.suggestionDiagnostics.forEach((item) => {
|
|
1034
1067
|
if (item.node) {
|
|
1035
|
-
item.node.tsErrorDetail
|
|
1068
|
+
delete item.node.tsErrorDetail;
|
|
1036
1069
|
if (item.node && item.node instanceof Logic) {
|
|
1037
1070
|
item.node.isSmpty = false;
|
|
1038
1071
|
}
|
|
@@ -1048,7 +1081,7 @@ class NaslServer {
|
|
|
1048
1081
|
if (record.node instanceof Logic) {
|
|
1049
1082
|
record?.syntaxDiagnostics.forEach((item) => {
|
|
1050
1083
|
const minRange = this._findMinRange(item as unknown as tsProtocol.DiagnosticWithFileName, record.node as FileNode);
|
|
1051
|
-
if (minRange
|
|
1084
|
+
if (minRange?.node instanceof OqlQueryComponent) {
|
|
1052
1085
|
if (item.text === 'Invalid character.') {
|
|
1053
1086
|
record.semanticDiagnostics.push(item);
|
|
1054
1087
|
}
|
|
@@ -1491,6 +1524,14 @@ class NaslServer {
|
|
|
1491
1524
|
};
|
|
1492
1525
|
this.baseNodeAssignmentTsError(variable, diagnostic);
|
|
1493
1526
|
diagnostics.push(diagnostic);
|
|
1527
|
+
} else if (variable.__TypeAnnotation?.hasSystemType(node.app)) {
|
|
1528
|
+
const diagnostic = {
|
|
1529
|
+
node,
|
|
1530
|
+
severity: 'warning',
|
|
1531
|
+
message: `数据查询中不可以使用或包含系统类型!当前类型:${variable.__TypeAnnotation?.typeChineseTitle}。`,
|
|
1532
|
+
};
|
|
1533
|
+
this.baseNodeAssignmentTsError(variable, diagnostic);
|
|
1534
|
+
diagnostics.push(diagnostic);
|
|
1494
1535
|
}
|
|
1495
1536
|
});
|
|
1496
1537
|
}
|
|
@@ -1749,6 +1790,19 @@ class NaslServer {
|
|
|
1749
1790
|
diagnostics.push(diagnostic);
|
|
1750
1791
|
node.tsErrorDetail = diagnostic;
|
|
1751
1792
|
}
|
|
1793
|
+
} else if (node instanceof Identifier) {
|
|
1794
|
+
// 变量如果选到了页面,因为ts会找到兄弟的同名变量,所以需要新增报错,通过类型来判断加不加
|
|
1795
|
+
// https://projectmanage.netease-official.lcap.163yun.com/dashboard/BugDetail?id=2696136968961024
|
|
1796
|
+
if (node.name && node.__TypeAnnotation?.typeKind === 'reference' && node.__TypeAnnotation?.typeNamespace?.endsWith('views')) {
|
|
1797
|
+
const errorMsg = `找不到 ${node.name}。`;
|
|
1798
|
+
const diagnostic = {
|
|
1799
|
+
node,
|
|
1800
|
+
severity: 'error',
|
|
1801
|
+
message: errorMsg,
|
|
1802
|
+
};
|
|
1803
|
+
diagnostics.push(diagnostic);
|
|
1804
|
+
node.tsErrorDetail = diagnostic;
|
|
1805
|
+
}
|
|
1752
1806
|
} else {
|
|
1753
1807
|
this.checkNodeError(node, diagnostics);
|
|
1754
1808
|
}
|
|
@@ -1917,6 +1971,16 @@ class NaslServer {
|
|
|
1917
1971
|
typeAnnotationErrorDetail.errorPos[key] = errorMsg;
|
|
1918
1972
|
}
|
|
1919
1973
|
});
|
|
1974
|
+
} else if (rulesMap?.maxLength && +dataBaseTyp?.max && +rulesMap.maxLength > +dataBaseTyp.max) {
|
|
1975
|
+
// 判断当前 最大长度 是不是比 数据库类型的最大长度 长,超过就报错
|
|
1976
|
+
const errorMsg = `最大长度超出存储长度`;
|
|
1977
|
+
const diag: any = {
|
|
1978
|
+
node: property,
|
|
1979
|
+
severity: 'warning',
|
|
1980
|
+
message: errorMsg,
|
|
1981
|
+
};
|
|
1982
|
+
diagnostics.push(diag);
|
|
1983
|
+
typeAnnotationErrorDetail.errorPos.maxLength = errorMsg;
|
|
1920
1984
|
}
|
|
1921
1985
|
}
|
|
1922
1986
|
case 'Long': {
|
|
@@ -2119,7 +2183,7 @@ class NaslServer {
|
|
|
2119
2183
|
node.tsErrorDetail = diagnostic;
|
|
2120
2184
|
diagnostics.push(diagnostic);
|
|
2121
2185
|
} else {
|
|
2122
|
-
node.tsErrorDetail
|
|
2186
|
+
delete node.tsErrorDetail;
|
|
2123
2187
|
}
|
|
2124
2188
|
}
|
|
2125
2189
|
this.checkNodeError(node, diagnostics);
|
|
@@ -2494,19 +2558,19 @@ class NaslServer {
|
|
|
2494
2558
|
* 当前内容的开始行 <= 诊断开始的行 &&
|
|
2495
2559
|
* 当前内容的结束行 >= 诊断结束的行
|
|
2496
2560
|
*/
|
|
2497
|
-
if (lsp2tspNumber(item.
|
|
2561
|
+
if (lsp2tspNumber(item.start.line) <= diagnostic.start.line && lsp2tspNumber(item.end.line) >= diagnostic.end.line) {
|
|
2498
2562
|
// 如果找到某一行
|
|
2499
|
-
if (lsp2tspNumber(item.
|
|
2563
|
+
if (lsp2tspNumber(item.start.line) === diagnostic.start.line && lsp2tspNumber(item.end.line) === diagnostic.end.line) {
|
|
2500
2564
|
// 在行的范围但是又不在列的范围,不用给默认值,给了反而不对,
|
|
2501
2565
|
// 需要在列的范围内
|
|
2502
2566
|
if (
|
|
2503
|
-
lsp2tspNumber(item.
|
|
2504
|
-
lsp2tspNumber(item.
|
|
2567
|
+
lsp2tspNumber(item.start.character) <= diagnostic.start.offset &&
|
|
2568
|
+
lsp2tspNumber(item.end.character) >= diagnostic.end.offset
|
|
2505
2569
|
) {
|
|
2506
2570
|
// 比列更靠近 ,满足条件且长度更短
|
|
2507
2571
|
// 如果先走到下面有一个默认值了就像在if for里面有个表达式
|
|
2508
2572
|
// if for的内容也是包括当前的所以会重新赋值
|
|
2509
|
-
if (!minRange || item.
|
|
2573
|
+
if (!minRange || (item.end.offset - item.start.offset) < (minRange.item.end.offset - minRange.item.start.offset)) {
|
|
2510
2574
|
minRange = { item, node };
|
|
2511
2575
|
haveLineNode = true;
|
|
2512
2576
|
}
|
|
@@ -2518,22 +2582,24 @@ class NaslServer {
|
|
|
2518
2582
|
minRange = { node, item };
|
|
2519
2583
|
} else if (!haveLineNode) {
|
|
2520
2584
|
if (
|
|
2521
|
-
lsp2tspNumber(item.
|
|
2522
|
-
diagnostic.start.offset >= lsp2tspNumber(item.
|
|
2585
|
+
lsp2tspNumber(item.start.line) === diagnostic.start.line &&
|
|
2586
|
+
diagnostic.start.offset >= lsp2tspNumber(item.start.character)
|
|
2523
2587
|
) {
|
|
2524
2588
|
// 如果当前遍历的内容的行和列都 小于之前的, 而且是有效的
|
|
2525
2589
|
// 如果两个内容位置行数是一样的,就比较下找到内容的位置信息
|
|
2526
2590
|
// 找到的内容的开始位置, 要大于申明内容开始的位置,要不就不包含在内了
|
|
2527
|
-
if (diagnostic.start.offset - item.
|
|
2591
|
+
if (diagnostic.start.offset - item.start.character <= diagnostic.start.offset - minRange.item.start.character) {
|
|
2528
2592
|
minRange = { node, item };
|
|
2529
|
-
} else
|
|
2593
|
+
} else {
|
|
2594
|
+
if (diagnostic.start.offset < lsp2tspNumber(minRange.item.start.character)) {
|
|
2530
2595
|
minRange = { node, item };
|
|
2531
2596
|
}
|
|
2532
|
-
|
|
2597
|
+
}
|
|
2598
|
+
} else if (item.end.line - item.start.line <= minRange.item.end.line - minRange.item.start.line) {
|
|
2533
2599
|
// 行都一致 ,比较列
|
|
2534
|
-
if (minRange.item.
|
|
2600
|
+
if (minRange.item.start.line === item.start.line && minRange.item.end.line === item.end.line) {
|
|
2535
2601
|
// 如果两个起始和结束的行都一样,那么就比较开始列, 要比原来大,说明更精准
|
|
2536
|
-
if (item.
|
|
2602
|
+
if (item.start.character > minRange.item.start.character) {
|
|
2537
2603
|
minRange = { node, item };
|
|
2538
2604
|
}
|
|
2539
2605
|
} else {
|
|
@@ -2567,8 +2633,8 @@ class NaslServer {
|
|
|
2567
2633
|
if (currentSource) {
|
|
2568
2634
|
const newRefs = await this.references({
|
|
2569
2635
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2570
|
-
line: lsp2tspNumber(currentSource.
|
|
2571
|
-
offset: lsp2tspNumber(currentSource.
|
|
2636
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2637
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
2572
2638
|
});
|
|
2573
2639
|
refsList = [...newRefs.refs];
|
|
2574
2640
|
} else if (node instanceof Module) {
|
|
@@ -2609,7 +2675,7 @@ class NaslServer {
|
|
|
2609
2675
|
const entity = this.file2NodeMap.get(item.file);
|
|
2610
2676
|
const { currentSource } = this.getCurrentSource(entity);
|
|
2611
2677
|
// 42 11个函数的总行数
|
|
2612
|
-
if (item.end.line < currentSource.
|
|
2678
|
+
if (item.end.line < currentSource.end.line - 42 && item.start.line > 1) {
|
|
2613
2679
|
flag = true;
|
|
2614
2680
|
}
|
|
2615
2681
|
}
|
|
@@ -2638,8 +2704,8 @@ class NaslServer {
|
|
|
2638
2704
|
callQueryComponentTypeAnnotation = key;
|
|
2639
2705
|
}
|
|
2640
2706
|
});
|
|
2641
|
-
const { currentSource: qcTypeAnnotationCurrentSource, fileNode } = callQueryComponentTypeAnnotation.getCurrentSource();
|
|
2642
|
-
const { currentSource: logicCurrentSource } = fileNode.getCurrentSource();
|
|
2707
|
+
const { currentSource: qcTypeAnnotationCurrentSource, fileNode: qcTypeCurrentFileNode } = callQueryComponentTypeAnnotation.getCurrentSource();
|
|
2708
|
+
const { currentSource: logicCurrentSource, fileNode: logicCurrentFileNode } = fileNode.getCurrentSource();
|
|
2643
2709
|
const aggregateLength = callQueryComponent.select.selectAggregateElements.filter(
|
|
2644
2710
|
(item: any) => item.aggregateName && item.asName
|
|
2645
2711
|
).length;
|
|
@@ -2655,15 +2721,18 @@ class NaslServer {
|
|
|
2655
2721
|
}
|
|
2656
2722
|
const { currentSource: propertyTypeCurrentSource } = targetProperty.typeAnnotation.getCurrentSource();
|
|
2657
2723
|
// 减去 ": " 2个字符、减去属性名长度
|
|
2658
|
-
const propertyCharacter = propertyTypeCurrentSource.
|
|
2659
|
-
const propertyOffset = propertyCharacter - qcTypeAnnotationCurrentSource.
|
|
2660
|
-
const
|
|
2661
|
-
const
|
|
2724
|
+
const propertyCharacter = propertyTypeCurrentSource.start.character - 2 - targetProperty.name.length;
|
|
2725
|
+
const propertyOffset = propertyCharacter - qcTypeAnnotationCurrentSource.start.character;
|
|
2726
|
+
const qcTypeCurrentFilePath = (qcTypeCurrentFileNode as any).getEmbeddedFilePath() as string;
|
|
2727
|
+
const qcTypeAnnotationCurrentCode = this.getNodeCode(qcTypeCurrentFileNode, qcTypeAnnotationCurrentSource);
|
|
2728
|
+
const logicCurrentCode = this.getNodeCode(qcTypeCurrentFileNode, logicCurrentSource);
|
|
2729
|
+
const qcTypeAnnotationOffset = logicCurrentCode.indexOf(qcTypeAnnotationCurrentCode);
|
|
2730
|
+
const declarationCodeArr = logicCurrentCode.slice(0, qcTypeAnnotationOffset).split('\n');
|
|
2662
2731
|
const line = declarationCodeArr.length - 1;
|
|
2663
2732
|
const character = declarationCodeArr[declarationCodeArr.length - 1].length;
|
|
2664
2733
|
// eslint-disable-next-line no-await-in-loop
|
|
2665
2734
|
const newRefs = await this.references({
|
|
2666
|
-
file:
|
|
2735
|
+
file: qcTypeCurrentFilePath,
|
|
2667
2736
|
line: line + 2,
|
|
2668
2737
|
offset: character + 1 + propertyOffset,
|
|
2669
2738
|
});
|
|
@@ -2690,8 +2759,8 @@ class NaslServer {
|
|
|
2690
2759
|
const { currentSource } = this.getCurrentSource(logicNode);
|
|
2691
2760
|
const parentRefs = await this.references({
|
|
2692
2761
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2693
|
-
line: lsp2tspNumber(currentSource.
|
|
2694
|
-
offset: lsp2tspNumber(currentSource.
|
|
2762
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2763
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
2695
2764
|
});
|
|
2696
2765
|
refsList = [...refsList, ...parentRefs.refs];
|
|
2697
2766
|
}
|
|
@@ -2699,13 +2768,13 @@ class NaslServer {
|
|
|
2699
2768
|
// 如果是参数修改, 就需要把logic的引用 都查找出来就需要把他的父级的引用全部查找出来
|
|
2700
2769
|
if (node instanceof Param && (node.parentNode instanceof View || node.parentNode instanceof Process)) {
|
|
2701
2770
|
const viewNode = node.parentNode;
|
|
2702
|
-
const { currentSource } = this.getCurrentSource(viewNode);
|
|
2703
|
-
const
|
|
2771
|
+
const { currentSource, fileNode } = this.getCurrentSource(viewNode);
|
|
2772
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2704
2773
|
const viewIndex = code.indexOf(' {');
|
|
2705
2774
|
const viewRefs = await this.references({
|
|
2706
2775
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2707
|
-
line: lsp2tspNumber(currentSource.
|
|
2708
|
-
offset: lsp2tspNumber(currentSource.
|
|
2776
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2777
|
+
offset: lsp2tspNumber(currentSource.start.character + viewIndex),
|
|
2709
2778
|
});
|
|
2710
2779
|
let filterViewRefs = [];
|
|
2711
2780
|
if (node.parentNode instanceof View) {
|
|
@@ -2728,8 +2797,8 @@ class NaslServer {
|
|
|
2728
2797
|
// const viewIndex = code.indexOf(' {');
|
|
2729
2798
|
// const viewRefs = await naslServer.references({
|
|
2730
2799
|
// file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2731
|
-
// line: lsp2tspNumber(currentSource.
|
|
2732
|
-
// offset: lsp2tspNumber(currentSource.
|
|
2800
|
+
// line: lsp2tspNumber(currentSource.start.line),
|
|
2801
|
+
// offset: lsp2tspNumber(currentSource.start.character + viewIndex),
|
|
2733
2802
|
// });
|
|
2734
2803
|
// refsList = [...viewRefs.refs];
|
|
2735
2804
|
// }
|
|
@@ -2738,14 +2807,14 @@ class NaslServer {
|
|
|
2738
2807
|
*/
|
|
2739
2808
|
if (node instanceof ViewElement) {
|
|
2740
2809
|
if (currentSource) {
|
|
2741
|
-
const
|
|
2810
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2742
2811
|
const prefix = '__elements.';
|
|
2743
2812
|
const prefixIndex = code.indexOf(prefix) !== -1 ? code.indexOf(prefix) : 0;
|
|
2744
2813
|
const methodsNameIndex = prefixIndex + prefix.length;
|
|
2745
2814
|
const methods = await this.references({
|
|
2746
2815
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2747
|
-
line: lsp2tspNumber(currentSource.
|
|
2748
|
-
offset: lsp2tspNumber(currentSource.
|
|
2816
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2817
|
+
offset: lsp2tspNumber(currentSource.start.character + methodsNameIndex),
|
|
2749
2818
|
});
|
|
2750
2819
|
const methodRefs: tsProtocol.ReferencesResponseItem[] = [];
|
|
2751
2820
|
methods.refs.forEach((item) => {
|
|
@@ -2764,7 +2833,7 @@ class NaslServer {
|
|
|
2764
2833
|
}
|
|
2765
2834
|
if (node instanceof Process) {
|
|
2766
2835
|
if (currentSource) {
|
|
2767
|
-
const
|
|
2836
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2768
2837
|
const prefix = '__ProcessIdentification__';
|
|
2769
2838
|
let positions = [];
|
|
2770
2839
|
let pos = code.indexOf(prefix);
|
|
@@ -2778,8 +2847,8 @@ class NaslServer {
|
|
|
2778
2847
|
const promises = positions.map((item) =>
|
|
2779
2848
|
this.references({
|
|
2780
2849
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2781
|
-
line: lsp2tspNumber(currentSource.
|
|
2782
|
-
offset: lsp2tspNumber(currentSource.
|
|
2850
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2851
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2783
2852
|
})
|
|
2784
2853
|
);
|
|
2785
2854
|
const results = await Promise.all(promises);
|
|
@@ -2789,9 +2858,9 @@ class NaslServer {
|
|
|
2789
2858
|
}
|
|
2790
2859
|
}
|
|
2791
2860
|
if ((node instanceof Param || node instanceof Return) && node.parentNode instanceof Process) {
|
|
2792
|
-
const { currentSource } = this.getCurrentSource(node.parentNode);
|
|
2861
|
+
const { currentSource, fileNode } = this.getCurrentSource(node.parentNode);
|
|
2793
2862
|
if (currentSource) {
|
|
2794
|
-
const
|
|
2863
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2795
2864
|
const prefix = '__ProcessIdentification__';
|
|
2796
2865
|
const positions = [];
|
|
2797
2866
|
let pos = code.indexOf(prefix);
|
|
@@ -2809,8 +2878,8 @@ class NaslServer {
|
|
|
2809
2878
|
const promises = positions.map((item) =>
|
|
2810
2879
|
this.references({
|
|
2811
2880
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2812
|
-
line: lsp2tspNumber(currentSource.
|
|
2813
|
-
offset: lsp2tspNumber(currentSource.
|
|
2881
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2882
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2814
2883
|
})
|
|
2815
2884
|
);
|
|
2816
2885
|
const results = await Promise.all(promises);
|
|
@@ -2821,7 +2890,7 @@ class NaslServer {
|
|
|
2821
2890
|
}
|
|
2822
2891
|
if (node instanceof ProcessElement) {
|
|
2823
2892
|
if (currentSource) {
|
|
2824
|
-
const
|
|
2893
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2825
2894
|
const prefix = '__ProcessIdentification__';
|
|
2826
2895
|
let positions = [];
|
|
2827
2896
|
let pos = code.indexOf(prefix);
|
|
@@ -2834,8 +2903,8 @@ class NaslServer {
|
|
|
2834
2903
|
const promises = positions.map((item) =>
|
|
2835
2904
|
this.references({
|
|
2836
2905
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2837
|
-
line: lsp2tspNumber(currentSource.
|
|
2838
|
-
offset: lsp2tspNumber(currentSource.
|
|
2906
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2907
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2839
2908
|
})
|
|
2840
2909
|
);
|
|
2841
2910
|
const results = await Promise.all(promises);
|
|
@@ -2845,9 +2914,9 @@ class NaslServer {
|
|
|
2845
2914
|
}
|
|
2846
2915
|
}
|
|
2847
2916
|
if (node instanceof Return && node.parentNode instanceof ProcessElement) {
|
|
2848
|
-
const { currentSource } = this.getCurrentSource(node.parentNode);
|
|
2917
|
+
const { currentSource, fileNode } = this.getCurrentSource(node.parentNode);
|
|
2849
2918
|
if (currentSource) {
|
|
2850
|
-
const
|
|
2919
|
+
const code = this.getNodeCode(fileNode, currentSource);
|
|
2851
2920
|
const prefix = '__ProcessIdentification__';
|
|
2852
2921
|
const positions = [];
|
|
2853
2922
|
let pos = code.indexOf(prefix);
|
|
@@ -2868,8 +2937,8 @@ class NaslServer {
|
|
|
2868
2937
|
const promises = positions.map((item) =>
|
|
2869
2938
|
this.references({
|
|
2870
2939
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
2871
|
-
line: lsp2tspNumber(currentSource.
|
|
2872
|
-
offset: lsp2tspNumber(currentSource.
|
|
2940
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
2941
|
+
offset: lsp2tspNumber(currentSource.start.character + item),
|
|
2873
2942
|
})
|
|
2874
2943
|
);
|
|
2875
2944
|
const results = await Promise.all(promises);
|
|
@@ -3613,8 +3682,8 @@ class NaslServer {
|
|
|
3613
3682
|
handlingCurrentSourceException(currentSource: SourceMapItem, node: BaseNode) {
|
|
3614
3683
|
// 如果有前面的一些注解,元素在最后一行输出的值就给最后一行
|
|
3615
3684
|
if (node instanceof EntityProperty) {
|
|
3616
|
-
if (currentSource.
|
|
3617
|
-
currentSource.
|
|
3685
|
+
if (currentSource.start.line !== currentSource.end.line) {
|
|
3686
|
+
currentSource.start = { ...currentSource.start, line: currentSource.end.line };
|
|
3618
3687
|
}
|
|
3619
3688
|
}
|
|
3620
3689
|
}
|
|
@@ -3624,12 +3693,12 @@ class NaslServer {
|
|
|
3624
3693
|
const { currentSource, fileNode } = this.getCurrentSource(node);
|
|
3625
3694
|
if (currentSource && fileNode) {
|
|
3626
3695
|
const range = {
|
|
3627
|
-
line: lsp2tspNumber(currentSource.
|
|
3628
|
-
offset: lsp2tspNumber(currentSource.
|
|
3696
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
3697
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
3629
3698
|
};
|
|
3630
3699
|
// foreach 在最后一行自动补全
|
|
3631
3700
|
if (node.concept === 'ForEachStatement') {
|
|
3632
|
-
range.line = currentSource.
|
|
3701
|
+
range.line = currentSource.end.line;
|
|
3633
3702
|
range.offset = 0;
|
|
3634
3703
|
} else if (node.concept === 'BindAttribute') {
|
|
3635
3704
|
range.offset += 7;
|
|
@@ -3796,7 +3865,7 @@ class NaslServer {
|
|
|
3796
3865
|
}
|
|
3797
3866
|
// 如果 入参不是虚拟节点的,就不去请求类型
|
|
3798
3867
|
// 只有虚拟节点的入参,才没有类型
|
|
3799
|
-
if (node.concept === 'Param' && node.parentKey !== 'virtualParams' && node.parentKey !== 'item') {
|
|
3868
|
+
if (node.concept === 'Param' && (node.parentKey !== 'virtualParams' && node.parentKey !== 'item' && node.parentNode.concept !== 'AnonymousFunction')) {
|
|
3800
3869
|
return;
|
|
3801
3870
|
}
|
|
3802
3871
|
if (
|
|
@@ -3831,36 +3900,40 @@ class NaslServer {
|
|
|
3831
3900
|
newQuickInfoNodes.push(itemDetail);
|
|
3832
3901
|
const fileDetail = {
|
|
3833
3902
|
file: filePath,
|
|
3834
|
-
line: lsp2tspNumber(item.
|
|
3835
|
-
offset: lsp2tspNumber(item.
|
|
3903
|
+
line: lsp2tspNumber(item.start.line),
|
|
3904
|
+
offset: lsp2tspNumber(item.start.character),
|
|
3905
|
+
};
|
|
3906
|
+
|
|
3907
|
+
const getCode = (range: SourceMapItem) => {
|
|
3908
|
+
return this.tsFiles.get(filePath)?.slice(range.start.offset, range.end.offset) ?? '';
|
|
3836
3909
|
};
|
|
3837
3910
|
|
|
3838
3911
|
// 位置计算偏移
|
|
3839
3912
|
if ('getQuickInfoOffset' in node) {
|
|
3840
|
-
Object.assign(fileDetail, (node as any).getQuickInfoOffset(fileDetail, item
|
|
3913
|
+
Object.assign(fileDetail, (node as any).getQuickInfoOffset(fileDetail, getCode(item)));
|
|
3841
3914
|
}
|
|
3842
3915
|
|
|
3843
3916
|
// 位置计算偏移2
|
|
3844
3917
|
// TODO: 之后考虑把这些偏移量计算全都挪到节点内部去
|
|
3845
3918
|
if (
|
|
3846
3919
|
node.concept === 'BinaryExpression' ||
|
|
3847
|
-
node.concept === 'CallLogic' ||
|
|
3848
3920
|
node.concept === 'CallFunction' ||
|
|
3849
3921
|
node.concept === 'CallInterface'
|
|
3850
3922
|
) {
|
|
3923
|
+
const code = getCode(item);
|
|
3851
3924
|
// 如果没有括号 ,括号就在外面,就 -1
|
|
3852
3925
|
// 有括号就找到括号的位置 然后 -1
|
|
3853
3926
|
let indexOf = 0;
|
|
3854
|
-
if (!
|
|
3927
|
+
if (!code.includes('(')) {
|
|
3855
3928
|
indexOf = -1;
|
|
3856
3929
|
} else {
|
|
3857
3930
|
// 如果有泛型先往前找一找
|
|
3858
|
-
if (
|
|
3859
|
-
indexOf = Math.min(
|
|
3931
|
+
if (code.includes('<')) {
|
|
3932
|
+
indexOf = Math.min(code.indexOf('<'), code.indexOf('('));
|
|
3860
3933
|
} else {
|
|
3861
|
-
indexOf =
|
|
3934
|
+
indexOf = code.indexOf('(');
|
|
3862
3935
|
}
|
|
3863
|
-
const subStr =
|
|
3936
|
+
const subStr = code.substring(0, indexOf);
|
|
3864
3937
|
const codeArr = subStr?.split('.');
|
|
3865
3938
|
const lastLen = codeArr?.[codeArr.length - 1]?.length;
|
|
3866
3939
|
indexOf = subStr.length - lastLen;
|
|
@@ -3872,28 +3945,31 @@ class NaslServer {
|
|
|
3872
3945
|
node.concept === 'QueryFieldExpression' ||
|
|
3873
3946
|
node.concept === 'QueryGroupByExpression'
|
|
3874
3947
|
) {
|
|
3875
|
-
|
|
3876
|
-
|
|
3948
|
+
const code = getCode(item);
|
|
3949
|
+
if (code.includes('.')) {
|
|
3950
|
+
const codeArr = code?.split('.');
|
|
3877
3951
|
const lastLen = codeArr?.[codeArr.length - 1]?.length;
|
|
3878
3952
|
// MemberExpression取最后一位当做类型
|
|
3879
|
-
const indexOf =
|
|
3880
|
-
fileDetail.offset
|
|
3953
|
+
const indexOf = code.length - lastLen;
|
|
3954
|
+
fileDetail.offset = fileDetail.offset + indexOf;
|
|
3881
3955
|
}
|
|
3882
3956
|
} else if (node.concept === 'Match') {
|
|
3957
|
+
const code = getCode(item);
|
|
3883
3958
|
// 去查return 后面的返回值,变成函数调用
|
|
3884
|
-
if (
|
|
3885
|
-
fileDetail.line = item.
|
|
3959
|
+
if (code?.endsWith(';\n')) {
|
|
3960
|
+
fileDetail.line = item.end.line - 1;
|
|
3886
3961
|
} else {
|
|
3887
|
-
fileDetail.line = item.
|
|
3962
|
+
fileDetail.line = item.end.line;
|
|
3888
3963
|
}
|
|
3889
|
-
const indexOf =
|
|
3890
|
-
let newCode =
|
|
3964
|
+
const indexOf = code.indexOf('return __MatchExpressionFuntion');
|
|
3965
|
+
let newCode = code.substring(0, indexOf);
|
|
3891
3966
|
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
3892
3967
|
fileDetail.offset = newCode.length + 'return '.length;
|
|
3893
3968
|
} else if (['NewComposite', 'NewList', 'NewMap'].includes(node.concept)) {
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3969
|
+
const code = getCode(item);
|
|
3970
|
+
fileDetail.line = item.end.line;
|
|
3971
|
+
const indexOf = code.indexOf('return __newComposite');
|
|
3972
|
+
let newCode = code.substring(0, indexOf);
|
|
3897
3973
|
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
3898
3974
|
fileDetail.offset = newCode.length + 'return '.length;
|
|
3899
3975
|
} else if (['OqlQueryComponent'].includes(node.concept)) {
|
|
@@ -3913,7 +3989,13 @@ class NaslServer {
|
|
|
3913
3989
|
|
|
3914
3990
|
types.set(node, Object.freeze(nodeTypeAnnotation) as TypeAnnotation);
|
|
3915
3991
|
|
|
3916
|
-
|
|
3992
|
+
const type = itemType ? (Object.isFrozen(itemType) ? itemType : Object.freeze(itemType)) : null;
|
|
3993
|
+
|
|
3994
|
+
if (type) {
|
|
3995
|
+
(node as any).__nodeType = type;
|
|
3996
|
+
} else {
|
|
3997
|
+
delete (node as any).__nodeType;
|
|
3998
|
+
}
|
|
3917
3999
|
});
|
|
3918
4000
|
|
|
3919
4001
|
await utils.timeSlicing(Array.from(getFromOthers.entries()), ([node]) => {
|
|
@@ -3948,7 +4030,7 @@ class NaslServer {
|
|
|
3948
4030
|
if (typeAnnotation.typeName === 'List' && typeAnnotation.typeKind === 'generic') {
|
|
3949
4031
|
const {typeArguments} = typeAnnotation;
|
|
3950
4032
|
if (typeArguments.length && typeArguments[0].isComplexType()) {
|
|
3951
|
-
node.__TypeAnnotation
|
|
4033
|
+
delete node.__TypeAnnotation;
|
|
3952
4034
|
return;
|
|
3953
4035
|
}
|
|
3954
4036
|
}
|
|
@@ -3961,12 +4043,12 @@ class NaslServer {
|
|
|
3961
4043
|
}
|
|
3962
4044
|
} else {
|
|
3963
4045
|
// 清空原来已经赋值上去的类型,可能原来有现在没有了
|
|
3964
|
-
node.__TypeAnnotation
|
|
4046
|
+
delete node.__TypeAnnotation;
|
|
3965
4047
|
}
|
|
3966
4048
|
} catch (err) {
|
|
3967
|
-
if (globalThis.window) {
|
|
3968
|
-
|
|
3969
|
-
}
|
|
4049
|
+
// if (globalThis.window) {
|
|
4050
|
+
// console.log(err);
|
|
4051
|
+
// }
|
|
3970
4052
|
}
|
|
3971
4053
|
});
|
|
3972
4054
|
return types;
|
|
@@ -4120,7 +4202,7 @@ class NaslServer {
|
|
|
4120
4202
|
) {
|
|
4121
4203
|
const { currentSource, fileNode } = matchExpression?.getCurrentSource();
|
|
4122
4204
|
fileNode.sourceMap.forEach((item, itemNode) => {
|
|
4123
|
-
if (itemNode.concept === matchExpression.concept && item
|
|
4205
|
+
if (itemNode.concept === matchExpression.concept && isSameRange(item, currentSource)) {
|
|
4124
4206
|
const jsonNode = jsoner.queryNodeByPath(json, itemNode.getNodePath(false));
|
|
4125
4207
|
jsonNode.typeAnnotation = matchExpression.__TypeAnnotation;
|
|
4126
4208
|
}
|
|
@@ -4429,8 +4511,8 @@ class NaslServer {
|
|
|
4429
4511
|
*/
|
|
4430
4512
|
const oldRefs = await this.references({
|
|
4431
4513
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
4432
|
-
line: lsp2tspNumber(currentSource.
|
|
4433
|
-
offset: lsp2tspNumber(currentSource.
|
|
4514
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
4515
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
4434
4516
|
});
|
|
4435
4517
|
oldRefs.refs.forEach((ref) => this.filesToCheck.add(ref.file));
|
|
4436
4518
|
// 更新文件之后
|
|
@@ -4438,8 +4520,8 @@ class NaslServer {
|
|
|
4438
4520
|
|
|
4439
4521
|
const newRefs2 = await this.references({
|
|
4440
4522
|
file: (fileNode as FileNode).getEmbeddedFilePath(),
|
|
4441
|
-
line: lsp2tspNumber(currentSource.
|
|
4442
|
-
offset: lsp2tspNumber(currentSource.
|
|
4523
|
+
line: lsp2tspNumber(currentSource.start.line),
|
|
4524
|
+
offset: lsp2tspNumber(currentSource.start.character),
|
|
4443
4525
|
});
|
|
4444
4526
|
newRefs2.refs.forEach((ref) => this.filesToCheck.add(ref.file));
|
|
4445
4527
|
}
|
|
@@ -4574,9 +4656,14 @@ class NaslServer {
|
|
|
4574
4656
|
return;
|
|
4575
4657
|
}
|
|
4576
4658
|
|
|
4577
|
-
|
|
4659
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4660
|
+
console.time('重新生成 TS 文件');
|
|
4661
|
+
}
|
|
4578
4662
|
const result = (fileNode as FileNode).toEmbeddedTSFile();
|
|
4579
|
-
|
|
4663
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4664
|
+
console.timeEnd('重新生成 TS 文件');
|
|
4665
|
+
console.log('重新生成 TS 文件', (fileNode as FileNode).getEmbeddedFilePath());
|
|
4666
|
+
}
|
|
4580
4667
|
|
|
4581
4668
|
// 当前操作的节点
|
|
4582
4669
|
// 如果当前没有生成tsFile
|
|
@@ -4623,13 +4710,19 @@ class NaslServer {
|
|
|
4623
4710
|
if (this.changeStackList.length) {
|
|
4624
4711
|
this.changeFileNext();
|
|
4625
4712
|
} else {
|
|
4626
|
-
|
|
4713
|
+
if (process.env.NODE_ENV === 'development') {
|
|
4714
|
+
console.info('校验以下文件', Array.from(this.filesToCheck));
|
|
4715
|
+
}
|
|
4627
4716
|
await this.getDiagnosticRecordsAndPushAll(Array.from(this.filesToCheck));
|
|
4628
4717
|
this.filesToCheck.clear();
|
|
4629
4718
|
}
|
|
4630
4719
|
});
|
|
4631
4720
|
}
|
|
4632
4721
|
}
|
|
4722
|
+
|
|
4723
|
+
private getNodeCode(fileNode: BaseNode, range: SourceMapItem) {
|
|
4724
|
+
return (this.tsFiles.get((fileNode as any).getEmbeddedFilePath()) ?? '').slice(range.start.offset, range.end.offset)
|
|
4725
|
+
}
|
|
4633
4726
|
}
|
|
4634
4727
|
|
|
4635
4728
|
export { NaslServer };
|