brighterscript 1.0.0-alpha.24 → 1.0.0-alpha.25
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/CHANGELOG.md +493 -233
- package/README.md +45 -139
- package/bsconfig.schema.json +41 -0
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +25 -0
- package/dist/AstValidationSegmenter.js +152 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +39 -4
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +7 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/CodeActionUtil.d.ts +3 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +3 -2
- package/dist/CommentFlagProcessor.js +5 -4
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.d.ts +3 -2
- package/dist/DependencyGraph.js +11 -10
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.js +9 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +1 -0
- package/dist/DiagnosticFilterer.js +5 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +61 -13
- package/dist/DiagnosticMessages.js +116 -19
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +41 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
- package/dist/FunctionScope.d.ts +28 -0
- package/dist/FunctionScope.js +52 -0
- package/dist/FunctionScope.js.map +1 -0
- package/dist/KeyedThrottler.d.ts +3 -3
- package/dist/KeyedThrottler.js +3 -3
- package/dist/KeyedThrottler.js.map +1 -1
- package/dist/LanguageServer.d.ts +23 -11
- package/dist/LanguageServer.js +150 -69
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +11 -3
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +21 -3
- package/dist/PluginInterface.js +74 -6
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +158 -79
- package/dist/Program.js +831 -695
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +130 -103
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +87 -133
- package/dist/Scope.js +450 -510
- package/dist/Scope.js.map +1 -1
- package/dist/Stopwatch.js +1 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +89 -34
- package/dist/SymbolTable.js +239 -114
- package/dist/SymbolTable.js.map +1 -1
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +4 -6
- package/dist/XmlScope.js +74 -69
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +48 -0
- package/dist/astUtils/CachedLookups.js +323 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +9 -5
- package/dist/astUtils/{AstEditor.js → Editor.js} +10 -4
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +68 -64
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +10 -10
- package/dist/astUtils/creators.js +26 -16
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +5 -5
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +132 -104
- package/dist/astUtils/reflection.js +220 -174
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +208 -126
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +12 -12
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +53 -35
- package/dist/astUtils/visitors.js +29 -3
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +178 -33
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +9 -9
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +10 -2
- package/dist/bscPlugin/BscPlugin.js +33 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +131 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +6 -0
- package/dist/bscPlugin/FileWriter.js +24 -0
- package/dist/bscPlugin/FileWriter.js.map +1 -0
- package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
- package/dist/bscPlugin/SignatureHelpUtil.js +135 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +14 -11
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +16 -16
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +52 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +517 -26
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +7 -7
- package/dist/bscPlugin/hover/HoverProcessor.js +123 -125
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +371 -53
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +2 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +85 -23
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +83 -6
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
- package/dist/bscPlugin/serialize/BslibManager.js +40 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +33 -9
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +13 -5
- package/dist/bscPlugin/validation/BrsFileValidator.js +259 -49
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +230 -14
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +54 -27
- package/dist/bscPlugin/validation/ScopeValidator.js +483 -286
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2454 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +104 -13
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +3 -3
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +8 -2
- package/dist/diagnosticUtils.js +47 -17
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -10
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +26 -0
- package/dist/files/AssetFile.js +26 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +523 -493
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +112 -111
- package/dist/files/BrsFile.js +741 -1032
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1728 -1232
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +104 -0
- package/dist/files/BscFile.js +16 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +20 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/LazyFileData.spec.d.ts +1 -0
- package/dist/files/LazyFileData.spec.js +27 -0
- package/dist/files/LazyFileData.spec.js.map +1 -0
- package/dist/files/XmlFile.d.ts +70 -32
- package/dist/files/XmlFile.js +106 -118
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +325 -262
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +48 -40
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +84 -24
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -21
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +389 -161
- package/dist/interfaces.js +27 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Character.spec.js +5 -5
- package/dist/lexer/Character.spec.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +12 -5
- package/dist/lexer/Lexer.js +28 -13
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +181 -135
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +9 -1
- package/dist/lexer/Token.js +9 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +8 -0
- package/dist/lexer/TokenKind.js +24 -4
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +162 -0
- package/dist/parser/AstNode.js +225 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +165 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +4 -7
- package/dist/parser/BrsTranspileState.js +4 -12
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +126 -176
- package/dist/parser/Expression.js +523 -405
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +151 -145
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +43 -201
- package/dist/parser/Parser.js +446 -962
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1002 -846
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +9 -8
- package/dist/parser/SGParser.js +10 -8
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +27 -38
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +98 -35
- package/dist/parser/SGTypes.js +169 -99
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +183 -131
- package/dist/parser/Statement.js +549 -387
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +45 -21
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +7 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +3 -2
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +33 -23
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +96 -94
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +22 -16
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +8 -8
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +61 -20
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +8 -8
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +129 -21
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +5 -5
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +36 -36
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +67 -22
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +59 -59
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +12 -12
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/Relational.spec.js +13 -13
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +96 -57
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +89 -89
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js +82 -33
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +19 -19
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +22 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +98 -302
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +9 -10
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +8 -9
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/Function.spec.js +44 -35
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +5 -5
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +20 -20
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +16 -78
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +35 -33
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +48 -35
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +6 -6
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +6 -6
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +2 -2
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.js +8 -8
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +5 -6
- package/dist/preprocessor/Preprocessor.js +5 -5
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +25 -25
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
- package/dist/preprocessor/PreprocessorParser.js +7 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/roku-types/data.json +5892 -10081
- package/dist/roku-types/index.d.ts +622 -1719
- package/dist/types/ArrayType.d.ts +10 -9
- package/dist/types/ArrayType.js +65 -60
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +36 -68
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +11 -0
- package/dist/types/AssociativeArrayType.js +52 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +9 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +8 -5
- package/dist/types/BooleanType.js +14 -7
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -6
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +32 -21
- package/dist/types/BscType.js +118 -21
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +25 -0
- package/dist/types/BscTypeKind.js +30 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
- package/dist/types/BuiltInInterfaceAdder.js +164 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +58 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +77 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +26 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +8 -5
- package/dist/types/DoubleType.js +18 -16
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -6
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +9 -5
- package/dist/types/DynamicType.js +15 -4
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +16 -5
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +30 -12
- package/dist/types/EnumType.js +43 -17
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/EnumType.spec.d.ts +1 -0
- package/dist/types/EnumType.spec.js +33 -0
- package/dist/types/EnumType.spec.js.map +1 -0
- package/dist/types/FloatType.d.ts +8 -5
- package/dist/types/FloatType.js +18 -16
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -6
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +13 -8
- package/dist/types/FunctionType.js +30 -14
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +152 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +8 -5
- package/dist/types/IntegerType.js +18 -16
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -6
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +12 -13
- package/dist/types/InterfaceType.js +20 -48
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +90 -56
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +7 -5
- package/dist/types/InvalidType.js +13 -7
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -6
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +8 -5
- package/dist/types/LongIntegerType.js +17 -15
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -6
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +12 -0
- package/dist/types/NamespaceType.js +28 -0
- package/dist/types/NamespaceType.js.map +1 -0
- package/dist/types/ObjectType.d.ts +9 -8
- package/dist/types/ObjectType.js +21 -11
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +3 -3
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +63 -0
- package/dist/types/ReferenceType.js +423 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +137 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +11 -5
- package/dist/types/StringType.js +18 -7
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -5
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +22 -17
- package/dist/types/TypedFunctionType.js +78 -60
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/TypedFunctionType.spec.js +105 -20
- package/dist/types/TypedFunctionType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +8 -6
- package/dist/types/UninitializedType.js +13 -7
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +123 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +130 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +8 -5
- package/dist/types/VoidType.js +14 -7
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +3 -3
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helper.spec.d.ts +1 -0
- package/dist/types/helper.spec.js +145 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +19 -37
- package/dist/types/helpers.js +159 -99
- package/dist/types/helpers.js.map +1 -1
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util.d.ts +132 -137
- package/dist/util.js +796 -362
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +8 -25
- package/dist/validators/ClassValidator.js +96 -176
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -152
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -12
- package/dist/types/CustomType.js +0 -44
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -16
- package/dist/types/LazyType.js +0 -44
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/serialize/BslibInjector.spec.d.ts} +0 -0
package/dist/KeyedThrottler.js
CHANGED
|
@@ -17,9 +17,9 @@ class KeyedThrottler {
|
|
|
17
17
|
return this.throttlers[key].run(job);
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
* Get a promise that resolves the next time the throttler becomes idle.
|
|
21
|
+
* If no throttler exists, this will resolve immediately
|
|
22
|
+
*/
|
|
23
23
|
async onIdleOnce(key, resolveImmediatelyIfIdle = true) {
|
|
24
24
|
const throttler = this.throttlers[key];
|
|
25
25
|
if (throttler) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyedThrottler.js","sourceRoot":"","sources":["../src/KeyedThrottler.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,MAAa,cAAc;IACvB,YACa,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;QAKlB,eAAU,GAAG,EAA+B,CAAC;IAFrD,CAAC;IAID;;OAEG;IACI,GAAG,CAAC,GAAW,EAAE,GAAQ;QAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACvB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpD;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED;;;
|
|
1
|
+
{"version":3,"file":"KeyedThrottler.js","sourceRoot":"","sources":["../src/KeyedThrottler.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,MAAa,cAAc;IACvB,YACa,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;QAKlB,eAAU,GAAG,EAA+B,CAAC;IAFrD,CAAC;IAID;;OAEG;IACI,GAAG,CAAC,GAAW,EAAE,GAAQ;QAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACvB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpD;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU,CAAC,GAAW,EAAE,wBAAwB,GAAG,IAAI;QAChE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,SAAS,EAAE;YACX,OAAO,SAAS,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;SACzD;aAAM;YACH,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SAC5B;IACL,CAAC;CACJ;AA/BD,wCA+BC"}
|
package/dist/LanguageServer.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { InitializeParams, ServerCapabilities, ExecuteCommandParams, Worksp
|
|
|
3
3
|
import { FileChangeType } from 'vscode-languageserver/node';
|
|
4
4
|
import { ProgramBuilder } from './ProgramBuilder';
|
|
5
5
|
import { Throttler } from './Throttler';
|
|
6
|
+
import { BusyStatusTracker } from './BusyStatusTracker';
|
|
6
7
|
export declare class LanguageServer {
|
|
7
8
|
private connection;
|
|
8
9
|
projects: Project[];
|
|
@@ -34,10 +35,12 @@ export declare class LanguageServer {
|
|
|
34
35
|
private sendDiagnosticsThrottler;
|
|
35
36
|
private boundValidateAll;
|
|
36
37
|
private validateAllThrottled;
|
|
38
|
+
busyStatusTracker: BusyStatusTracker;
|
|
37
39
|
run(): void;
|
|
40
|
+
private busyStatusIndex;
|
|
41
|
+
private sendBusyStatus;
|
|
38
42
|
/**
|
|
39
43
|
* Called when the client starts initialization
|
|
40
|
-
* @param params
|
|
41
44
|
*/
|
|
42
45
|
onInitialize(params: InitializeParams): {
|
|
43
46
|
capabilities: ServerCapabilities<any>;
|
|
@@ -65,7 +68,6 @@ export declare class LanguageServer {
|
|
|
65
68
|
private getWorkspacePaths;
|
|
66
69
|
/**
|
|
67
70
|
* Called when the client has finished initializing
|
|
68
|
-
* @param params
|
|
69
71
|
*/
|
|
70
72
|
private onInitialized;
|
|
71
73
|
/**
|
|
@@ -82,17 +84,24 @@ export declare class LanguageServer {
|
|
|
82
84
|
*/
|
|
83
85
|
private documentFileResolver;
|
|
84
86
|
private getConfigFilePath;
|
|
87
|
+
/**
|
|
88
|
+
* A unique project counter to help distinguish log entries in lsp mode
|
|
89
|
+
*/
|
|
90
|
+
private projectCounter;
|
|
91
|
+
/**
|
|
92
|
+
* @param projectPath path to the project
|
|
93
|
+
* @param workspacePath path to the workspace in which all project should reside or are referenced by
|
|
94
|
+
* @param projectNumber an optional project number to assign to the project. Used when reloading projects that should keep the same number
|
|
95
|
+
*/
|
|
85
96
|
private createProject;
|
|
86
97
|
private createStandaloneFileProject;
|
|
87
98
|
private getProjects;
|
|
88
99
|
/**
|
|
89
100
|
* Provide a list of completion items based on the current cursor position
|
|
90
|
-
* @param textDocumentPosition
|
|
91
101
|
*/
|
|
92
102
|
private onCompletion;
|
|
93
103
|
/**
|
|
94
104
|
* Provide a full completion item from the selection
|
|
95
|
-
* @param item
|
|
96
105
|
*/
|
|
97
106
|
private onCompletionResolve;
|
|
98
107
|
private onCodeAction;
|
|
@@ -119,13 +128,11 @@ export declare class LanguageServer {
|
|
|
119
128
|
* The CLIENT is in charge of what files to watch, so all client
|
|
120
129
|
* implementations should ensure that all valid project
|
|
121
130
|
* file types are watched (.brs,.bs,.xml,manifest, and any json/text/image files)
|
|
122
|
-
* @param params
|
|
123
131
|
*/
|
|
124
132
|
private onDidChangeWatchedFiles;
|
|
125
133
|
/**
|
|
126
134
|
* This only operates on files that match the specified files globs, so it is safe to throw
|
|
127
135
|
* any file changes you receive with no unexpected side-effects
|
|
128
|
-
* @param changes
|
|
129
136
|
*/
|
|
130
137
|
handleFileChanges(project: Project, changes: {
|
|
131
138
|
type: FileChangeType;
|
|
@@ -134,7 +141,7 @@ export declare class LanguageServer {
|
|
|
134
141
|
/**
|
|
135
142
|
* This only operates on files that match the specified files globs, so it is safe to throw
|
|
136
143
|
* any file changes you receive with no unexpected side-effects
|
|
137
|
-
* @
|
|
144
|
+
* @returns true if the file was handled by this project, false if it was not
|
|
138
145
|
*/
|
|
139
146
|
private handleFileChange;
|
|
140
147
|
private onHover;
|
|
@@ -142,21 +149,23 @@ export declare class LanguageServer {
|
|
|
142
149
|
private validateTextDocument;
|
|
143
150
|
private validateAll;
|
|
144
151
|
onWorkspaceSymbol(params: WorkspaceSymbolParams): Promise<SymbolInformation[]>;
|
|
145
|
-
onDocumentSymbol(params: DocumentSymbolParams): Promise<import("vscode-languageserver
|
|
152
|
+
onDocumentSymbol(params: DocumentSymbolParams): Promise<import("vscode-languageserver/node").DocumentSymbol[]>;
|
|
146
153
|
private onDefinition;
|
|
147
154
|
private onSignatureHelp;
|
|
148
155
|
private onReferences;
|
|
156
|
+
private onValidateSettled;
|
|
149
157
|
private onFullSemanticTokens;
|
|
150
158
|
private diagnosticCollection;
|
|
151
159
|
private sendDiagnostics;
|
|
152
160
|
onExecuteCommand(params: ExecuteCommandParams): Promise<import("./Program").FileTranspileResult>;
|
|
153
|
-
/**
|
|
154
|
-
* @param srcPath The absolute path to the source file on disk
|
|
155
|
-
*/
|
|
156
161
|
private transpileFile;
|
|
157
162
|
dispose(): void;
|
|
158
163
|
}
|
|
159
164
|
export interface Project {
|
|
165
|
+
/**
|
|
166
|
+
* A unique number for this project, generated during this current language server session. Mostly used so we can identify which project is doing logging
|
|
167
|
+
*/
|
|
168
|
+
projectNumber: number;
|
|
160
169
|
firstRunPromise: Promise<any>;
|
|
161
170
|
builder: ProgramBuilder;
|
|
162
171
|
/**
|
|
@@ -175,3 +184,6 @@ export interface Project {
|
|
|
175
184
|
export declare enum CustomCommands {
|
|
176
185
|
TranspileFile = "TranspileFile"
|
|
177
186
|
}
|
|
187
|
+
export declare enum NotificationName {
|
|
188
|
+
busyStatus = "busyStatus"
|
|
189
|
+
}
|
package/dist/LanguageServer.js
CHANGED
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.CustomCommands = exports.LanguageServer = void 0;
|
|
9
|
+
exports.NotificationName = exports.CustomCommands = exports.LanguageServer = void 0;
|
|
10
10
|
require("array-flat-polyfill");
|
|
11
11
|
const fastGlob = require("fast-glob");
|
|
12
12
|
const path = require("path");
|
|
@@ -24,6 +24,7 @@ const KeyedThrottler_1 = require("./KeyedThrottler");
|
|
|
24
24
|
const DiagnosticCollection_1 = require("./DiagnosticCollection");
|
|
25
25
|
const reflection_1 = require("./astUtils/reflection");
|
|
26
26
|
const SemanticTokenUtils_1 = require("./SemanticTokenUtils");
|
|
27
|
+
const BusyStatusTracker_1 = require("./BusyStatusTracker");
|
|
27
28
|
class LanguageServer {
|
|
28
29
|
constructor() {
|
|
29
30
|
this.connection = undefined;
|
|
@@ -53,6 +54,12 @@ class LanguageServer {
|
|
|
53
54
|
this.validateThrottler = new Throttler_1.Throttler(0);
|
|
54
55
|
this.sendDiagnosticsThrottler = new Throttler_1.Throttler(0);
|
|
55
56
|
this.boundValidateAll = this.validateAll.bind(this);
|
|
57
|
+
this.busyStatusTracker = new BusyStatusTracker_1.BusyStatusTracker();
|
|
58
|
+
this.busyStatusIndex = -1;
|
|
59
|
+
/**
|
|
60
|
+
* A unique project counter to help distinguish log entries in lsp mode
|
|
61
|
+
*/
|
|
62
|
+
this.projectCounter = 0;
|
|
56
63
|
this.diagnosticCollection = new DiagnosticCollection_1.DiagnosticCollection();
|
|
57
64
|
}
|
|
58
65
|
createConnection() {
|
|
@@ -66,6 +73,10 @@ class LanguageServer {
|
|
|
66
73
|
// Create a connection for the server. The connection uses Node's IPC as a transport.
|
|
67
74
|
// Also include all preview / proposed LSP features.
|
|
68
75
|
this.connection = this.createConnection();
|
|
76
|
+
// Send the current status of the busyStatusTracker anytime it changes
|
|
77
|
+
this.busyStatusTracker.on('change', (status) => {
|
|
78
|
+
this.sendBusyStatus(status);
|
|
79
|
+
});
|
|
69
80
|
//listen to all of the output log events and pipe them into the debug channel in the extension
|
|
70
81
|
this.loggerSubscription = Logger_1.Logger.subscribe((text) => {
|
|
71
82
|
this.connection.tracer.log(text);
|
|
@@ -120,9 +131,17 @@ class LanguageServer {
|
|
|
120
131
|
// Listen on the connection
|
|
121
132
|
this.connection.listen();
|
|
122
133
|
}
|
|
134
|
+
sendBusyStatus(status) {
|
|
135
|
+
this.busyStatusIndex = ++this.busyStatusIndex <= 0 ? 0 : this.busyStatusIndex;
|
|
136
|
+
this.connection.sendNotification(NotificationName.busyStatus, {
|
|
137
|
+
status: status,
|
|
138
|
+
timestamp: Date.now(),
|
|
139
|
+
index: this.busyStatusIndex,
|
|
140
|
+
activeRuns: [...this.busyStatusTracker.activeRuns]
|
|
141
|
+
});
|
|
142
|
+
}
|
|
123
143
|
/**
|
|
124
144
|
* Called when the client starts initialization
|
|
125
|
-
* @param params
|
|
126
145
|
*/
|
|
127
146
|
onInitialize(params) {
|
|
128
147
|
let clientCapabilities = params.capabilities;
|
|
@@ -284,7 +303,6 @@ class LanguageServer {
|
|
|
284
303
|
}
|
|
285
304
|
/**
|
|
286
305
|
* Called when the client has finished initializing
|
|
287
|
-
* @param params
|
|
288
306
|
*/
|
|
289
307
|
async onInitialized() {
|
|
290
308
|
let projectCreatedDeferred = new deferred_1.Deferred();
|
|
@@ -324,7 +342,6 @@ class LanguageServer {
|
|
|
324
342
|
if (waitForFirstProject) {
|
|
325
343
|
await this.initialProjectsCreated;
|
|
326
344
|
}
|
|
327
|
-
let status;
|
|
328
345
|
for (let project of this.getProjects()) {
|
|
329
346
|
try {
|
|
330
347
|
await project.firstRunPromise;
|
|
@@ -337,7 +354,6 @@ class LanguageServer {
|
|
|
337
354
|
this.sendCriticalFailure(`BrighterScript language server failed to start: \n${e.message}`);
|
|
338
355
|
}
|
|
339
356
|
}
|
|
340
|
-
this.connection.sendNotification('build-status', status ? status : 'success');
|
|
341
357
|
}
|
|
342
358
|
/**
|
|
343
359
|
* Event handler for when the program wants to load file contents.
|
|
@@ -363,7 +379,7 @@ class LanguageServer {
|
|
|
363
379
|
};
|
|
364
380
|
//if the client supports configuration, look for config group called "brightscript"
|
|
365
381
|
if (this.hasConfigurationCapability) {
|
|
366
|
-
await this.connection.workspace.getConfiguration({
|
|
382
|
+
config = await this.connection.workspace.getConfiguration({
|
|
367
383
|
scopeUri: scopeUri,
|
|
368
384
|
section: 'brightscript'
|
|
369
385
|
});
|
|
@@ -392,7 +408,12 @@ class LanguageServer {
|
|
|
392
408
|
//no config file could be found
|
|
393
409
|
return undefined;
|
|
394
410
|
}
|
|
395
|
-
|
|
411
|
+
/**
|
|
412
|
+
* @param projectPath path to the project
|
|
413
|
+
* @param workspacePath path to the workspace in which all project should reside or are referenced by
|
|
414
|
+
* @param projectNumber an optional project number to assign to the project. Used when reloading projects that should keep the same number
|
|
415
|
+
*/
|
|
416
|
+
async createProject(projectPath, workspacePath = projectPath, projectNumber) {
|
|
396
417
|
workspacePath !== null && workspacePath !== void 0 ? workspacePath : (workspacePath = projectPath);
|
|
397
418
|
let project = this.projects.find((x) => x.projectPath === projectPath);
|
|
398
419
|
//skip this project if we already have it
|
|
@@ -400,6 +421,9 @@ class LanguageServer {
|
|
|
400
421
|
return;
|
|
401
422
|
}
|
|
402
423
|
let builder = new ProgramBuilder_1.ProgramBuilder();
|
|
424
|
+
projectNumber !== null && projectNumber !== void 0 ? projectNumber : (projectNumber = this.projectCounter++);
|
|
425
|
+
builder.logger.prefix = `[prj${projectNumber}]`;
|
|
426
|
+
builder.logger.log(`Created project #${projectNumber} for: "${projectPath}"`);
|
|
403
427
|
//flush diagnostics every time the program finishes validating
|
|
404
428
|
builder.plugins.add({
|
|
405
429
|
name: 'bsc-language-server',
|
|
@@ -421,21 +445,11 @@ class LanguageServer {
|
|
|
421
445
|
//config file doesn't exist...let `brighterscript` resolve the default way
|
|
422
446
|
configFilePath = undefined;
|
|
423
447
|
}
|
|
424
|
-
|
|
425
|
-
cwd: cwd,
|
|
426
|
-
project: configFilePath,
|
|
427
|
-
watch: false,
|
|
428
|
-
createPackage: false,
|
|
429
|
-
deploy: false,
|
|
430
|
-
copyToStaging: false,
|
|
431
|
-
showDiagnosticsInConsole: false
|
|
432
|
-
});
|
|
433
|
-
firstRunPromise.catch((err) => {
|
|
434
|
-
console.error(err);
|
|
435
|
-
});
|
|
448
|
+
const firstRunDeferred = new deferred_1.Deferred();
|
|
436
449
|
let newProject = {
|
|
450
|
+
projectNumber: projectNumber,
|
|
437
451
|
builder: builder,
|
|
438
|
-
firstRunPromise:
|
|
452
|
+
firstRunPromise: firstRunDeferred.promise,
|
|
439
453
|
projectPath: projectPath,
|
|
440
454
|
workspacePath: workspacePath,
|
|
441
455
|
isFirstRunComplete: false,
|
|
@@ -444,19 +458,31 @@ class LanguageServer {
|
|
|
444
458
|
isStandaloneFileProject: false
|
|
445
459
|
};
|
|
446
460
|
this.projects.push(newProject);
|
|
447
|
-
|
|
461
|
+
try {
|
|
462
|
+
await builder.run({
|
|
463
|
+
cwd: cwd,
|
|
464
|
+
project: configFilePath,
|
|
465
|
+
watch: false,
|
|
466
|
+
createPackage: false,
|
|
467
|
+
deploy: false,
|
|
468
|
+
copyToStaging: false,
|
|
469
|
+
showDiagnosticsInConsole: false
|
|
470
|
+
});
|
|
448
471
|
newProject.isFirstRunComplete = true;
|
|
449
472
|
newProject.isFirstRunSuccessful = true;
|
|
450
|
-
|
|
473
|
+
firstRunDeferred.resolve();
|
|
474
|
+
}
|
|
475
|
+
catch (e) {
|
|
476
|
+
builder.logger.error(e);
|
|
477
|
+
firstRunDeferred.reject(e);
|
|
451
478
|
newProject.isFirstRunComplete = true;
|
|
452
479
|
newProject.isFirstRunSuccessful = false;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
});
|
|
480
|
+
}
|
|
481
|
+
//if we found a deprecated brsconfig.json, add a diagnostic warning the user
|
|
482
|
+
if (configFilePath && path.basename(configFilePath) === 'brsconfig.json') {
|
|
483
|
+
builder.addDiagnostic(configFilePath, Object.assign(Object.assign({}, DiagnosticMessages_1.DiagnosticMessages.brsConfigJsonIsDeprecated()), { range: util_1.util.createRange(0, 0, 0, 0) }));
|
|
484
|
+
return this.sendDiagnostics();
|
|
485
|
+
}
|
|
460
486
|
}
|
|
461
487
|
async createStandaloneFileProject(srcPath) {
|
|
462
488
|
//skip this workspace if we already have it
|
|
@@ -489,6 +515,7 @@ class LanguageServer {
|
|
|
489
515
|
console.error(err);
|
|
490
516
|
});
|
|
491
517
|
let newProject = {
|
|
518
|
+
projectNumber: this.projectCounter++,
|
|
492
519
|
builder: builder,
|
|
493
520
|
firstRunPromise: firstRunPromise,
|
|
494
521
|
projectPath: srcPath,
|
|
@@ -517,7 +544,6 @@ class LanguageServer {
|
|
|
517
544
|
}
|
|
518
545
|
/**
|
|
519
546
|
* Provide a list of completion items based on the current cursor position
|
|
520
|
-
* @param textDocumentPosition
|
|
521
547
|
*/
|
|
522
548
|
async onCompletion(params) {
|
|
523
549
|
//ensure programs are initialized
|
|
@@ -525,17 +551,24 @@ class LanguageServer {
|
|
|
525
551
|
let filePath = util_1.util.uriToPath(params.textDocument.uri);
|
|
526
552
|
//wait until the file has settled
|
|
527
553
|
await this.keyedThrottler.onIdleOnce(filePath, true);
|
|
554
|
+
// make sure validation is complete
|
|
555
|
+
await this.validateAllThrottled();
|
|
556
|
+
//wait for the validation cycle to settle
|
|
557
|
+
await this.onValidateSettled();
|
|
528
558
|
let completions = this
|
|
529
559
|
.getProjects()
|
|
530
560
|
.flatMap(workspace => workspace.builder.program.getCompletions(filePath, params.position));
|
|
561
|
+
//only send one completion if name and type are the same
|
|
562
|
+
let completionsMap = new Map();
|
|
531
563
|
for (let completion of completions) {
|
|
532
564
|
completion.commitCharacters = ['.'];
|
|
565
|
+
let key = `${completion.sortText}-${completion.label}-${completion.kind}`;
|
|
566
|
+
completionsMap.set(key, completion);
|
|
533
567
|
}
|
|
534
|
-
return
|
|
568
|
+
return [...completionsMap.values()];
|
|
535
569
|
}
|
|
536
570
|
/**
|
|
537
571
|
* Provide a full completion item from the selection
|
|
538
|
-
* @param item
|
|
539
572
|
*/
|
|
540
573
|
onCompletionResolve(item) {
|
|
541
574
|
if (item.data === 1) {
|
|
@@ -549,6 +582,7 @@ class LanguageServer {
|
|
|
549
582
|
return item;
|
|
550
583
|
}
|
|
551
584
|
async onCodeAction(params) {
|
|
585
|
+
var _a;
|
|
552
586
|
//ensure programs are initialized
|
|
553
587
|
await this.waitAllProjectFirstRuns();
|
|
554
588
|
let srcPath = util_1.util.uriToPath(params.textDocument.uri);
|
|
@@ -562,7 +596,7 @@ class LanguageServer {
|
|
|
562
596
|
//clone the diagnostics for each code action, since certain diagnostics can have circular reference properties that kill the language server if serialized
|
|
563
597
|
for (const codeAction of codeActions) {
|
|
564
598
|
if (codeAction.diagnostics) {
|
|
565
|
-
codeAction.diagnostics = codeAction.diagnostics.map(x => util_1.util.toDiagnostic(x, params.textDocument.uri));
|
|
599
|
+
codeAction.diagnostics = (_a = codeAction.diagnostics) === null || _a === void 0 ? void 0 : _a.map(x => util_1.util.toDiagnostic(x, params.textDocument.uri));
|
|
566
600
|
}
|
|
567
601
|
}
|
|
568
602
|
return codeActions;
|
|
@@ -592,7 +626,7 @@ class LanguageServer {
|
|
|
592
626
|
if (project.isStandaloneFileProject === false) {
|
|
593
627
|
this.removeProject(project);
|
|
594
628
|
//create a new workspace/brs program
|
|
595
|
-
await this.createProject(project.projectPath, project.workspacePath);
|
|
629
|
+
await this.createProject(project.projectPath, project.workspacePath, project.projectNumber);
|
|
596
630
|
//handle temp workspace
|
|
597
631
|
}
|
|
598
632
|
else {
|
|
@@ -669,12 +703,10 @@ class LanguageServer {
|
|
|
669
703
|
* The CLIENT is in charge of what files to watch, so all client
|
|
670
704
|
* implementations should ensure that all valid project
|
|
671
705
|
* file types are watched (.brs,.bs,.xml,manifest, and any json/text/image files)
|
|
672
|
-
* @param params
|
|
673
706
|
*/
|
|
674
707
|
async onDidChangeWatchedFiles(params) {
|
|
675
708
|
//ensure programs are initialized
|
|
676
709
|
await this.waitAllProjectFirstRuns();
|
|
677
|
-
this.connection.sendNotification('build-status', 'building');
|
|
678
710
|
let projects = this.getProjects();
|
|
679
711
|
//convert all file paths to absolute paths
|
|
680
712
|
let changes = params.changes.map(x => {
|
|
@@ -743,37 +775,33 @@ class LanguageServer {
|
|
|
743
775
|
//give every workspace the chance to handle file changes
|
|
744
776
|
await Promise.all(projects.map((project) => this.handleFileChanges(project, changes)));
|
|
745
777
|
}
|
|
746
|
-
this.connection.sendNotification('build-status', 'success');
|
|
747
778
|
}
|
|
748
779
|
/**
|
|
749
780
|
* This only operates on files that match the specified files globs, so it is safe to throw
|
|
750
781
|
* any file changes you receive with no unexpected side-effects
|
|
751
|
-
* @param changes
|
|
752
782
|
*/
|
|
753
783
|
async handleFileChanges(project, changes) {
|
|
754
784
|
//this loop assumes paths are both file paths and folder paths, which eliminates the need to detect.
|
|
755
785
|
//All functions below can handle being given a file path AND a folder path, and will only operate on the one they are looking for
|
|
756
|
-
let consumeCount = 0;
|
|
757
786
|
await Promise.all(changes.map(async (change) => {
|
|
758
787
|
await this.keyedThrottler.run(change.srcPath, async () => {
|
|
759
|
-
|
|
788
|
+
if (await this.handleFileChange(project, change)) {
|
|
789
|
+
await this.validateAllThrottled();
|
|
790
|
+
}
|
|
760
791
|
});
|
|
761
792
|
}));
|
|
762
|
-
if (consumeCount > 0) {
|
|
763
|
-
await this.validateAllThrottled();
|
|
764
|
-
}
|
|
765
793
|
}
|
|
766
794
|
/**
|
|
767
795
|
* This only operates on files that match the specified files globs, so it is safe to throw
|
|
768
796
|
* any file changes you receive with no unexpected side-effects
|
|
769
|
-
* @
|
|
797
|
+
* @returns true if the file was handled by this project, false if it was not
|
|
770
798
|
*/
|
|
771
799
|
async handleFileChange(project, change) {
|
|
772
800
|
const { program, options, rootDir } = project.builder;
|
|
773
801
|
//deleted
|
|
774
802
|
if (change.type === node_1.FileChangeType.Deleted) {
|
|
775
803
|
//try to act on this path as a directory
|
|
776
|
-
project.builder.
|
|
804
|
+
project.builder.removeFilesInFolder(change.srcPath);
|
|
777
805
|
//if this is a file loaded in the program, remove it
|
|
778
806
|
if (program.hasFile(change.srcPath)) {
|
|
779
807
|
program.removeFile(change.srcPath);
|
|
@@ -870,7 +898,6 @@ class LanguageServer {
|
|
|
870
898
|
//throttle file processing. first call is run immediately, and then the last call is processed.
|
|
871
899
|
await this.keyedThrottler.run(filePath, () => {
|
|
872
900
|
var _a;
|
|
873
|
-
this.connection.sendNotification('build-status', 'building');
|
|
874
901
|
let documentText = document.getText();
|
|
875
902
|
for (const project of this.getProjects()) {
|
|
876
903
|
//only add or replace existing files. All of the files in the project should
|
|
@@ -889,7 +916,7 @@ class LanguageServer {
|
|
|
889
916
|
await this.validateAllThrottled();
|
|
890
917
|
}
|
|
891
918
|
catch (e) {
|
|
892
|
-
this.sendCriticalFailure(`Critical error parsing
|
|
919
|
+
this.sendCriticalFailure(`Critical error parsing/validating ${filePath}: ${e.message}`);
|
|
893
920
|
}
|
|
894
921
|
}
|
|
895
922
|
async validateAll() {
|
|
@@ -899,13 +926,15 @@ class LanguageServer {
|
|
|
899
926
|
await this.synchronizeStandaloneProjects();
|
|
900
927
|
let projects = this.getProjects();
|
|
901
928
|
//validate all programs
|
|
902
|
-
await Promise.all(projects.map((
|
|
929
|
+
await Promise.all(projects.map((project) => {
|
|
930
|
+
project.builder.program.validate();
|
|
931
|
+
return project;
|
|
932
|
+
}));
|
|
903
933
|
}
|
|
904
934
|
catch (e) {
|
|
905
935
|
this.connection.console.error(e);
|
|
906
936
|
this.sendCriticalFailure(`Critical error validating project: ${e.message}${(_a = e.stack) !== null && _a !== void 0 ? _a : ''}`);
|
|
907
937
|
}
|
|
908
|
-
this.connection.sendNotification('build-status', 'success');
|
|
909
938
|
}
|
|
910
939
|
async onWorkspaceSymbol(params) {
|
|
911
940
|
await this.waitAllProjectFirstRuns();
|
|
@@ -947,7 +976,7 @@ class LanguageServer {
|
|
|
947
976
|
try {
|
|
948
977
|
const signatures = util_1.util.flatMap(await Promise.all(this.getProjects().map(project => project.builder.program.getSignatureHelp(filepath, params.position))), c => c);
|
|
949
978
|
const activeSignature = signatures.length > 0 ? 0 : null;
|
|
950
|
-
const activeParameter = activeSignature
|
|
979
|
+
const activeParameter = activeSignature !== null ? (_a = signatures[activeSignature]) === null || _a === void 0 ? void 0 : _a.index : null;
|
|
951
980
|
let results = {
|
|
952
981
|
signatures: signatures.map((s) => s.signature),
|
|
953
982
|
activeSignature: activeSignature,
|
|
@@ -970,20 +999,35 @@ class LanguageServer {
|
|
|
970
999
|
const srcPath = util_1.util.uriToPath(params.textDocument.uri);
|
|
971
1000
|
const results = util_1.util.flatMap(await Promise.all(this.getProjects().map(project => {
|
|
972
1001
|
return project.builder.program.getReferences(srcPath, position);
|
|
973
|
-
})), c => c);
|
|
1002
|
+
})), c => c !== null && c !== void 0 ? c : []);
|
|
974
1003
|
return results.filter((r) => r);
|
|
975
1004
|
}
|
|
1005
|
+
onValidateSettled() {
|
|
1006
|
+
return Promise.all([
|
|
1007
|
+
//wait for the validator to start running (or timeout if it never did)
|
|
1008
|
+
this.validateThrottler.onRunOnce(100),
|
|
1009
|
+
//wait for the validator to stop running (or resolve immediately if it's already idle)
|
|
1010
|
+
this.validateThrottler.onIdleOnce(true)
|
|
1011
|
+
]);
|
|
1012
|
+
}
|
|
976
1013
|
async onFullSemanticTokens(params) {
|
|
977
1014
|
await this.waitAllProjectFirstRuns();
|
|
1015
|
+
//wait for the file to settle (in case there are multiple file changes in quick succession)
|
|
978
1016
|
await this.keyedThrottler.onIdleOnce(util_1.util.uriToPath(params.textDocument.uri), true);
|
|
1017
|
+
// make sure validation is complete
|
|
1018
|
+
await this.validateAllThrottled();
|
|
1019
|
+
//wait for the validation cycle to settle
|
|
1020
|
+
await this.onValidateSettled();
|
|
979
1021
|
const srcPath = util_1.util.uriToPath(params.textDocument.uri);
|
|
980
1022
|
for (const project of this.projects) {
|
|
981
1023
|
//find the first program that has this file, since it would be incredibly inefficient to generate semantic tokens for the same file multiple times.
|
|
982
1024
|
if (project.builder.program.hasFile(srcPath)) {
|
|
983
1025
|
let semanticTokens = project.builder.program.getSemanticTokens(srcPath);
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1026
|
+
if (semanticTokens !== undefined) {
|
|
1027
|
+
return {
|
|
1028
|
+
data: (0, SemanticTokenUtils_1.encodeSemanticTokens)(semanticTokens)
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
987
1031
|
}
|
|
988
1032
|
}
|
|
989
1033
|
}
|
|
@@ -1012,9 +1056,6 @@ class LanguageServer {
|
|
|
1012
1056
|
return result;
|
|
1013
1057
|
}
|
|
1014
1058
|
}
|
|
1015
|
-
/**
|
|
1016
|
-
* @param srcPath The absolute path to the source file on disk
|
|
1017
|
-
*/
|
|
1018
1059
|
async transpileFile(srcPath) {
|
|
1019
1060
|
//wait all program first runs
|
|
1020
1061
|
await this.waitAllProjectFirstRuns();
|
|
@@ -1035,22 +1076,35 @@ __decorate([
|
|
|
1035
1076
|
AddStackToErrorMessage
|
|
1036
1077
|
], LanguageServer.prototype, "onInitialize", null);
|
|
1037
1078
|
__decorate([
|
|
1038
|
-
|
|
1079
|
+
TrackBusyStatus
|
|
1080
|
+
], LanguageServer.prototype, "getProjectPaths", null);
|
|
1081
|
+
__decorate([
|
|
1082
|
+
TrackBusyStatus
|
|
1083
|
+
], LanguageServer.prototype, "syncProjects", null);
|
|
1084
|
+
__decorate([
|
|
1085
|
+
AddStackToErrorMessage,
|
|
1086
|
+
TrackBusyStatus
|
|
1039
1087
|
], LanguageServer.prototype, "onInitialized", null);
|
|
1040
1088
|
__decorate([
|
|
1041
|
-
|
|
1089
|
+
TrackBusyStatus
|
|
1090
|
+
], LanguageServer.prototype, "createProject", null);
|
|
1091
|
+
__decorate([
|
|
1092
|
+
AddStackToErrorMessage,
|
|
1093
|
+
TrackBusyStatus
|
|
1042
1094
|
], LanguageServer.prototype, "onCompletion", null);
|
|
1043
1095
|
__decorate([
|
|
1044
1096
|
AddStackToErrorMessage
|
|
1045
1097
|
], LanguageServer.prototype, "onCompletionResolve", null);
|
|
1046
1098
|
__decorate([
|
|
1047
|
-
AddStackToErrorMessage
|
|
1099
|
+
AddStackToErrorMessage,
|
|
1100
|
+
TrackBusyStatus
|
|
1048
1101
|
], LanguageServer.prototype, "onCodeAction", null);
|
|
1049
1102
|
__decorate([
|
|
1050
1103
|
AddStackToErrorMessage
|
|
1051
1104
|
], LanguageServer.prototype, "onDidChangeConfiguration", null);
|
|
1052
1105
|
__decorate([
|
|
1053
|
-
AddStackToErrorMessage
|
|
1106
|
+
AddStackToErrorMessage,
|
|
1107
|
+
TrackBusyStatus
|
|
1054
1108
|
], LanguageServer.prototype, "onDidChangeWatchedFiles", null);
|
|
1055
1109
|
__decorate([
|
|
1056
1110
|
AddStackToErrorMessage
|
|
@@ -1059,34 +1113,49 @@ __decorate([
|
|
|
1059
1113
|
AddStackToErrorMessage
|
|
1060
1114
|
], LanguageServer.prototype, "onDocumentClose", null);
|
|
1061
1115
|
__decorate([
|
|
1062
|
-
AddStackToErrorMessage
|
|
1116
|
+
AddStackToErrorMessage,
|
|
1117
|
+
TrackBusyStatus
|
|
1063
1118
|
], LanguageServer.prototype, "validateTextDocument", null);
|
|
1064
1119
|
__decorate([
|
|
1065
|
-
|
|
1120
|
+
TrackBusyStatus
|
|
1121
|
+
], LanguageServer.prototype, "validateAll", null);
|
|
1122
|
+
__decorate([
|
|
1123
|
+
AddStackToErrorMessage,
|
|
1124
|
+
TrackBusyStatus
|
|
1066
1125
|
], LanguageServer.prototype, "onWorkspaceSymbol", null);
|
|
1067
1126
|
__decorate([
|
|
1068
|
-
AddStackToErrorMessage
|
|
1127
|
+
AddStackToErrorMessage,
|
|
1128
|
+
TrackBusyStatus
|
|
1069
1129
|
], LanguageServer.prototype, "onDocumentSymbol", null);
|
|
1070
1130
|
__decorate([
|
|
1071
|
-
AddStackToErrorMessage
|
|
1131
|
+
AddStackToErrorMessage,
|
|
1132
|
+
TrackBusyStatus
|
|
1072
1133
|
], LanguageServer.prototype, "onDefinition", null);
|
|
1073
1134
|
__decorate([
|
|
1074
|
-
AddStackToErrorMessage
|
|
1135
|
+
AddStackToErrorMessage,
|
|
1136
|
+
TrackBusyStatus
|
|
1075
1137
|
], LanguageServer.prototype, "onSignatureHelp", null);
|
|
1076
1138
|
__decorate([
|
|
1077
|
-
AddStackToErrorMessage
|
|
1139
|
+
AddStackToErrorMessage,
|
|
1140
|
+
TrackBusyStatus
|
|
1078
1141
|
], LanguageServer.prototype, "onReferences", null);
|
|
1079
1142
|
__decorate([
|
|
1080
|
-
AddStackToErrorMessage
|
|
1143
|
+
AddStackToErrorMessage,
|
|
1144
|
+
TrackBusyStatus
|
|
1081
1145
|
], LanguageServer.prototype, "onFullSemanticTokens", null);
|
|
1082
1146
|
__decorate([
|
|
1083
|
-
AddStackToErrorMessage
|
|
1147
|
+
AddStackToErrorMessage,
|
|
1148
|
+
TrackBusyStatus
|
|
1084
1149
|
], LanguageServer.prototype, "onExecuteCommand", null);
|
|
1085
1150
|
exports.LanguageServer = LanguageServer;
|
|
1086
1151
|
var CustomCommands;
|
|
1087
1152
|
(function (CustomCommands) {
|
|
1088
1153
|
CustomCommands["TranspileFile"] = "TranspileFile";
|
|
1089
1154
|
})(CustomCommands = exports.CustomCommands || (exports.CustomCommands = {}));
|
|
1155
|
+
var NotificationName;
|
|
1156
|
+
(function (NotificationName) {
|
|
1157
|
+
NotificationName["busyStatus"] = "busyStatus";
|
|
1158
|
+
})(NotificationName = exports.NotificationName || (exports.NotificationName = {}));
|
|
1090
1159
|
/**
|
|
1091
1160
|
* Wraps a method. If there's an error (either sync or via a promise),
|
|
1092
1161
|
* this appends the error's stack trace at the end of the error message so that the connection will
|
|
@@ -1118,4 +1187,16 @@ function AddStackToErrorMessage(target, propertyKey, descriptor) {
|
|
|
1118
1187
|
}
|
|
1119
1188
|
};
|
|
1120
1189
|
}
|
|
1190
|
+
/**
|
|
1191
|
+
* An annotation used to wrap the method in a busyStatus tracking call
|
|
1192
|
+
*/
|
|
1193
|
+
function TrackBusyStatus(target, propertyKey, descriptor) {
|
|
1194
|
+
let originalMethod = descriptor.value;
|
|
1195
|
+
//wrapping the original method
|
|
1196
|
+
descriptor.value = function value(...args) {
|
|
1197
|
+
return this.busyStatusTracker.run(() => {
|
|
1198
|
+
return originalMethod.apply(this, args);
|
|
1199
|
+
}, originalMethod.name);
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1121
1202
|
//# sourceMappingURL=LanguageServer.js.map
|