brighterscript 1.0.0-alpha.23 → 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 +585 -218
- 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 +79 -15
- package/dist/DiagnosticMessages.js +134 -21
- 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 +222 -87
- 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 +162 -81
- package/dist/Program.js +903 -732
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +132 -104
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +95 -134
- package/dist/Scope.js +477 -551
- 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 +95 -29
- package/dist/SymbolTable.js +256 -102
- 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 -68
- 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 -100
- package/dist/astUtils/reflection.js +225 -166
- 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 +54 -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 +12 -2
- package/dist/bscPlugin/BscPlugin.js +41 -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.d.ts +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +21 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +86 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +57 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +544 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- 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 +17 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +188 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +513 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +3 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +102 -29
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +167 -6
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- 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/BrsFileTranspileProcessor.d.ts +16 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +123 -0
- 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 +22 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +316 -29
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +264 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- 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 +56 -8
- package/dist/bscPlugin/validation/ScopeValidator.js +514 -116
- 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 +107 -8
- 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 +529 -486
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +124 -112
- package/dist/files/BrsFile.js +819 -1131
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1869 -1277
- 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 -117
- 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 +49 -41
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +104 -40
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -18
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +440 -150
- 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 +187 -134
- 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 +9 -0
- package/dist/lexer/TokenKind.js +30 -5
- 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 -167
- package/dist/parser/Expression.js +524 -394
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +152 -146
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +45 -196
- package/dist/parser/Parser.js +470 -926
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1034 -805
- 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 +208 -122
- package/dist/parser/Statement.js +599 -364
- 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 +123 -81
- 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 +221 -81
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +287 -105
- 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.d.ts +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
- 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 +111 -300
- 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 +107 -90
- 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 +3 -3
- 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 +15 -11
- 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 +6544 -10519
- package/dist/roku-types/index.d.ts +662 -1934
- 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 +10 -5
- package/dist/types/DynamicType.js +16 -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 +167 -131
- package/dist/util.js +890 -350
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +7 -25
- package/dist/validators/ClassValidator.js +103 -194
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -149
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.d.ts +0 -8
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +0 -40
- 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/hover/HoverProcessor.spec.d.ts} +0 -0
package/dist/Program.d.ts
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
import type { CodeAction,
|
|
2
|
-
import {
|
|
3
|
-
import type { BsConfig } from './BsConfig';
|
|
1
|
+
import type { CodeAction, Position, Range, SignatureInformation, Location } from 'vscode-languageserver';
|
|
2
|
+
import type { BsConfig, FinalizedBsConfig } from './BsConfig';
|
|
4
3
|
import { Scope } from './Scope';
|
|
5
|
-
import { BrsFile } from './files/BrsFile';
|
|
6
|
-
import { XmlFile } from './files/XmlFile';
|
|
7
|
-
import type { BsDiagnostic,
|
|
4
|
+
import type { BrsFile, ProvidedSymbolInfo } from './files/BrsFile';
|
|
5
|
+
import type { XmlFile } from './files/XmlFile';
|
|
6
|
+
import type { BsDiagnostic, FileObj, SemanticToken, FileLink, Hover } from './interfaces';
|
|
7
|
+
import type { BscFile } from './files/BscFile';
|
|
8
8
|
import { XmlScope } from './XmlScope';
|
|
9
9
|
import { Logger } from './Logger';
|
|
10
10
|
import PluginInterface from './PluginInterface';
|
|
11
|
-
import type { FunctionStatement
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
definitions?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface TranspileObj {
|
|
19
|
-
file: BscFile;
|
|
20
|
-
outputPath: string;
|
|
21
|
-
}
|
|
11
|
+
import type { FunctionStatement } from './parser/Statement';
|
|
12
|
+
import { Editor } from './astUtils/Editor';
|
|
13
|
+
import type { Statement } from './parser/AstNode';
|
|
14
|
+
import type { FileData } from './files/LazyFileData';
|
|
15
|
+
import type { UnresolvedSymbol } from './AstValidationSegmenter';
|
|
22
16
|
export interface SignatureInfoObj {
|
|
23
17
|
index: number;
|
|
24
18
|
key: string;
|
|
25
19
|
signature: SignatureInformation;
|
|
26
20
|
}
|
|
27
21
|
export declare class Program {
|
|
28
|
-
/**
|
|
29
|
-
* The root directory for this program
|
|
30
|
-
*/
|
|
31
|
-
options: BsConfig;
|
|
32
22
|
constructor(
|
|
33
23
|
/**
|
|
34
24
|
* The root directory for this program
|
|
35
25
|
*/
|
|
36
26
|
options: BsConfig, logger?: Logger, plugins?: PluginInterface);
|
|
27
|
+
options: FinalizedBsConfig;
|
|
37
28
|
logger: Logger;
|
|
29
|
+
/**
|
|
30
|
+
* An editor that plugins can use to modify program-level things during the build flow. Don't use this to edit files (they have their own `.editor`)
|
|
31
|
+
*/
|
|
32
|
+
editor: Editor;
|
|
33
|
+
/**
|
|
34
|
+
* A factory that creates `File` instances
|
|
35
|
+
*/
|
|
36
|
+
private fileFactory;
|
|
38
37
|
private createGlobalScope;
|
|
38
|
+
private recursivelyAddNodeToSymbolTable;
|
|
39
|
+
/**
|
|
40
|
+
* Do all setup required for the global symbol table.
|
|
41
|
+
*/
|
|
42
|
+
private populateGlobalSymbolTable;
|
|
39
43
|
/**
|
|
40
44
|
* A graph of all files and their dependencies.
|
|
41
45
|
* For example:
|
|
@@ -44,6 +48,7 @@ export declare class Program {
|
|
|
44
48
|
*/
|
|
45
49
|
private dependencyGraph;
|
|
46
50
|
private diagnosticFilterer;
|
|
51
|
+
private diagnosticAdjuster;
|
|
47
52
|
/**
|
|
48
53
|
* A scope that contains all built-in global functions.
|
|
49
54
|
* All scopes should directly or indirectly inherit from this scope
|
|
@@ -58,23 +63,31 @@ export declare class Program {
|
|
|
58
63
|
* Should only be set from `this.validate()`
|
|
59
64
|
*/
|
|
60
65
|
private diagnostics;
|
|
66
|
+
private fileSymbolInformation;
|
|
67
|
+
addFileSymbolInfo(file: BrsFile): void;
|
|
68
|
+
getFileSymbolInfo(file: BrsFile): {
|
|
69
|
+
provides: ProvidedSymbolInfo;
|
|
70
|
+
requires: UnresolvedSymbol[];
|
|
71
|
+
};
|
|
61
72
|
/**
|
|
62
73
|
* The path to bslib.brs (the BrightScript runtime for certain BrighterScript features)
|
|
63
74
|
*/
|
|
64
|
-
get bslibPkgPath():
|
|
75
|
+
get bslibPkgPath(): string;
|
|
65
76
|
get bslibPrefix(): "rokucommunity_bslib" | "bslib";
|
|
66
77
|
/**
|
|
67
|
-
* A map of every file loaded
|
|
78
|
+
* A map of every file loaded into this program, indexed by its original file location
|
|
68
79
|
*/
|
|
69
|
-
|
|
80
|
+
files: Record<string, BscFile>;
|
|
70
81
|
/**
|
|
71
|
-
* A map of every file loaded into this program, indexed by its
|
|
82
|
+
* A map of every file loaded into this program, indexed by its destPath
|
|
72
83
|
*/
|
|
73
|
-
private
|
|
84
|
+
private destMap;
|
|
74
85
|
/**
|
|
75
|
-
*
|
|
86
|
+
* Plugins can contribute multiple virtual files for a single physical file.
|
|
87
|
+
* This collection links the virtual files back to the physical file that produced them.
|
|
88
|
+
* The key is the standardized and lower-cased srcPath
|
|
76
89
|
*/
|
|
77
|
-
|
|
90
|
+
private fileClusters;
|
|
78
91
|
private scopes;
|
|
79
92
|
protected addScope(scope: Scope): void;
|
|
80
93
|
/**
|
|
@@ -91,6 +104,10 @@ export declare class Program {
|
|
|
91
104
|
file: XmlFile;
|
|
92
105
|
scope: XmlScope;
|
|
93
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Keeps a set of all the components that need to have their types updated during the current validation cycle
|
|
109
|
+
*/
|
|
110
|
+
private componentSymbolsToUpdate;
|
|
94
111
|
/**
|
|
95
112
|
* Register (or replace) the reference to a component in the component map
|
|
96
113
|
*/
|
|
@@ -99,6 +116,18 @@ export declare class Program {
|
|
|
99
116
|
* Remove the specified component from the components map
|
|
100
117
|
*/
|
|
101
118
|
private unregisterComponent;
|
|
119
|
+
/**
|
|
120
|
+
* Adds a component described in an XML to the set of components that needs to be updated this validation cycle.
|
|
121
|
+
* @param xmlFile XML file with <component> tag
|
|
122
|
+
*/
|
|
123
|
+
private addDeferredComponentTypeSymbolCreation;
|
|
124
|
+
private getComponentKey;
|
|
125
|
+
/**
|
|
126
|
+
* Updates the global symbol table with the first component in this.components to have the same name as the component in the file
|
|
127
|
+
* @param componentKey key getting a component from `this.components`
|
|
128
|
+
* @param componentName the unprefixed name of the component that will be added (e.g. 'MyLabel' NOT 'roSgNodeMyLabel')
|
|
129
|
+
*/
|
|
130
|
+
private updateComponentSymbolInGlobalScope;
|
|
102
131
|
/**
|
|
103
132
|
* re-attach the dependency graph with a new key for any component who changed
|
|
104
133
|
* their position in their own named array (only matters when there are multiple
|
|
@@ -118,15 +147,15 @@ export declare class Program {
|
|
|
118
147
|
addDiagnostics(diagnostics: BsDiagnostic[]): void;
|
|
119
148
|
/**
|
|
120
149
|
* Determine if the specified file is loaded in this program right now.
|
|
121
|
-
* @param filePath
|
|
150
|
+
* @param filePath the absolute or relative path to the file
|
|
122
151
|
* @param normalizePath should the provided path be normalized before use
|
|
123
152
|
*/
|
|
124
153
|
hasFile(filePath: string, normalizePath?: boolean): boolean;
|
|
125
154
|
/**
|
|
126
155
|
* roku filesystem is case INsensitive, so find the scope by key case insensitive
|
|
127
|
-
* @param scopeName
|
|
156
|
+
* @param scopeName xml scope names are their `destPath`. Source scope is stored with the key `"source"`
|
|
128
157
|
*/
|
|
129
|
-
getScopeByName(scopeName: string): Scope;
|
|
158
|
+
getScopeByName(scopeName: string): Scope | undefined;
|
|
130
159
|
/**
|
|
131
160
|
* Return all scopes
|
|
132
161
|
*/
|
|
@@ -146,16 +175,34 @@ export declare class Program {
|
|
|
146
175
|
/**
|
|
147
176
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
148
177
|
* If file contents are provided, those are used, Otherwise, the file is loaded from the file system
|
|
149
|
-
* @param srcDestOrPkgPath the absolute path,
|
|
150
|
-
* @param
|
|
178
|
+
* @param srcDestOrPkgPath the absolute path, the pkg path (i.e. `pkg:/path/to/file.brs`), or the destPath (i.e. `path/to/file.brs` relative to `pkg:/`)
|
|
179
|
+
* @param fileData the file contents. omit or pass `undefined` to prevent loading the data at this time
|
|
151
180
|
*/
|
|
152
|
-
setFile<T extends BscFile>(srcDestOrPkgPath: string,
|
|
181
|
+
setFile<T extends BscFile>(srcDestOrPkgPath: string, fileData?: FileData): T;
|
|
153
182
|
/**
|
|
154
183
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
155
184
|
* @param fileEntry an object that specifies src and dest for the file.
|
|
156
|
-
* @param
|
|
185
|
+
* @param fileData the file contents. omit or pass `undefined` to prevent loading the data at this time
|
|
186
|
+
*/
|
|
187
|
+
setFile<T extends BscFile>(fileEntry: FileObj, fileData: FileData): T;
|
|
188
|
+
/**
|
|
189
|
+
* Given a srcPath, a destPath, or both, resolve whichever is missing, relative to rootDir.
|
|
190
|
+
* @param fileParam an object representing file paths
|
|
191
|
+
* @param rootDir must be a pre-normalized path
|
|
157
192
|
*/
|
|
158
|
-
|
|
193
|
+
private getPaths;
|
|
194
|
+
/**
|
|
195
|
+
* Remove any leading `pkg:/` found in the path
|
|
196
|
+
*/
|
|
197
|
+
private removePkgPrefix;
|
|
198
|
+
/**
|
|
199
|
+
* Is this file a .brs file found somewhere within the `pkg:/source/` folder?
|
|
200
|
+
*/
|
|
201
|
+
private isSourceBrsFile;
|
|
202
|
+
/**
|
|
203
|
+
* Is this file a .brs file found somewhere within the `pkg:/source/` folder?
|
|
204
|
+
*/
|
|
205
|
+
private isComponentsXmlFile;
|
|
159
206
|
/**
|
|
160
207
|
* Ensure source scope is created.
|
|
161
208
|
* Note: automatically called internally, and no-op if it exists already.
|
|
@@ -163,34 +210,39 @@ export declare class Program {
|
|
|
163
210
|
createSourceScope(): void;
|
|
164
211
|
/**
|
|
165
212
|
* Remove a set of files from the program
|
|
166
|
-
* @param
|
|
213
|
+
* @param srcPaths can be an array of srcPath or destPath strings
|
|
167
214
|
* @param normalizePath should this function repair and standardize the filePaths? Passing false should have a performance boost if you can guarantee your paths are already sanitized
|
|
168
215
|
*/
|
|
169
216
|
removeFiles(srcPaths: string[], normalizePath?: boolean): void;
|
|
170
217
|
/**
|
|
171
218
|
* Remove a file from the program
|
|
172
|
-
* @param filePath can be a srcPath, a
|
|
219
|
+
* @param filePath can be a srcPath, a destPath, or a destPath with leading `pkg:/`
|
|
173
220
|
* @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
|
|
174
221
|
*/
|
|
175
|
-
removeFile(filePath: string, normalizePath?: boolean): void;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
222
|
+
removeFile(filePath: string, normalizePath?: boolean, keepSymbolInformation?: boolean): void;
|
|
223
|
+
lastValidationInfo: Map<string, {
|
|
224
|
+
symbolsNotDefinedInEveryScope: {
|
|
225
|
+
symbol: UnresolvedSymbol;
|
|
226
|
+
scope: Scope;
|
|
227
|
+
}[];
|
|
228
|
+
duplicateSymbolsInSameScope: {
|
|
229
|
+
symbol: UnresolvedSymbol;
|
|
230
|
+
scope: Scope;
|
|
231
|
+
}[];
|
|
232
|
+
symbolsNotConsistentAcrossScopes: {
|
|
233
|
+
symbol: UnresolvedSymbol;
|
|
234
|
+
scopes: Scope[];
|
|
235
|
+
}[];
|
|
236
|
+
}>;
|
|
182
237
|
/**
|
|
183
238
|
* Traverse the entire project, and validate all scopes
|
|
184
239
|
*/
|
|
185
240
|
validate(): void;
|
|
241
|
+
private detectIncompatibleSymbolsAcrossScopes;
|
|
186
242
|
/**
|
|
187
243
|
* Flag all duplicate component names
|
|
188
244
|
*/
|
|
189
245
|
private detectDuplicateComponentNames;
|
|
190
|
-
/**
|
|
191
|
-
* Determine at least one scope has the file
|
|
192
|
-
*/
|
|
193
|
-
private fileIsIncludedInAnyScope;
|
|
194
246
|
/**
|
|
195
247
|
* Get the files for a list of filePaths
|
|
196
248
|
* @param filePaths can be an array of srcPath or a destPath strings
|
|
@@ -199,63 +251,50 @@ export declare class Program {
|
|
|
199
251
|
getFiles<T extends BscFile>(filePaths: string[], normalizePath?: boolean): T[];
|
|
200
252
|
/**
|
|
201
253
|
* Get the file at the given path
|
|
202
|
-
* @param filePath can be a srcPath
|
|
254
|
+
* @param filePath can be a srcPath or a destPath
|
|
203
255
|
* @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
|
|
204
256
|
*/
|
|
205
257
|
getFile<T extends BscFile>(filePath: string, normalizePath?: boolean): T;
|
|
206
258
|
/**
|
|
207
259
|
* Get a list of all scopes the file is loaded into
|
|
208
|
-
* @param file
|
|
260
|
+
* @param file the file
|
|
209
261
|
*/
|
|
210
|
-
getScopesForFile(file:
|
|
262
|
+
getScopesForFile(file: BscFile | string): Scope[];
|
|
211
263
|
/**
|
|
212
264
|
* Get the first found scope for a file.
|
|
213
265
|
*/
|
|
214
|
-
getFirstScopeForFile(file:
|
|
266
|
+
getFirstScopeForFile(file: BscFile): Scope | undefined;
|
|
215
267
|
getStatementsByName(name: string, originFile: BrsFile, namespaceName?: string): FileLink<Statement>[];
|
|
216
268
|
getStatementsForXmlFile(scope: XmlScope, filterName?: string): FileLink<FunctionStatement>[];
|
|
217
269
|
/**
|
|
218
270
|
* Find all available completion items at the given position
|
|
219
|
-
* @param
|
|
220
|
-
* @param
|
|
221
|
-
* @param columnIndex
|
|
271
|
+
* @param filePath can be a srcPath or a destPath
|
|
272
|
+
* @param position the position (line & column) where completions should be found
|
|
222
273
|
*/
|
|
223
|
-
getCompletions(
|
|
274
|
+
getCompletions(filePath: string, position: Position): import("vscode-languageserver").CompletionItem[];
|
|
224
275
|
/**
|
|
225
276
|
* Goes through each file and builds a list of workspace symbols for the program. Used by LanguageServer's onWorkspaceSymbol functionality
|
|
226
277
|
*/
|
|
227
|
-
getWorkspaceSymbols(): SymbolInformation[];
|
|
278
|
+
getWorkspaceSymbols(): import("vscode-languageserver").SymbolInformation[];
|
|
228
279
|
/**
|
|
229
280
|
* Given a position in a file, if the position is sitting on some type of identifier,
|
|
230
281
|
* go to the definition of that identifier (where this thing was first defined)
|
|
231
|
-
* @param srcPath The absolute path to the source file on disk
|
|
232
282
|
*/
|
|
233
283
|
getDefinition(srcPath: string, position: Position): Location[];
|
|
234
284
|
/**
|
|
235
|
-
*
|
|
285
|
+
* Get hover information for a file and position
|
|
236
286
|
*/
|
|
237
|
-
getHover(srcPath: string, position: Position):
|
|
287
|
+
getHover(srcPath: string, position: Position): Hover[];
|
|
238
288
|
/**
|
|
239
289
|
* Compute code actions for the given file and range
|
|
240
|
-
* @param srcPath The absolute path to the source file on disk
|
|
241
290
|
*/
|
|
242
291
|
getCodeActions(srcPath: string, range: Range): CodeAction[];
|
|
243
292
|
/**
|
|
244
293
|
* Get semantic tokens for the specified file
|
|
245
294
|
*/
|
|
246
|
-
getSemanticTokens(srcPath: string): SemanticToken[];
|
|
295
|
+
getSemanticTokens(srcPath: string): SemanticToken[] | undefined;
|
|
247
296
|
getSignatureHelp(filepath: string, position: Position): SignatureInfoObj[];
|
|
248
|
-
private getPartialStatementInfo;
|
|
249
|
-
private getPartialItemCounts;
|
|
250
|
-
/**
|
|
251
|
-
* @param srcPath The absolute path to the source file on disk
|
|
252
|
-
*/
|
|
253
297
|
getReferences(srcPath: string, position: Position): Location[] | Promise<Location[]>;
|
|
254
|
-
/**
|
|
255
|
-
* Get a list of all script imports, relative to the specified pkgPath
|
|
256
|
-
* @param sourcePkgPath - the pkgPath of the source that wants to resolve script imports.
|
|
257
|
-
*/
|
|
258
|
-
getScriptImportCompletions(sourcePkgPath: string, scriptImport: FileReference): CompletionItem[];
|
|
259
298
|
/**
|
|
260
299
|
* Transpile a single file and get the result as a string.
|
|
261
300
|
* This does not write anything to the file system.
|
|
@@ -265,14 +304,31 @@ export declare class Program {
|
|
|
265
304
|
* @param filePath can be a srcPath or a destPath
|
|
266
305
|
*/
|
|
267
306
|
getTranspiledFileContents(filePath: string): Promise<FileTranspileResult>;
|
|
307
|
+
private getTranspiledFileContentsPipeline;
|
|
308
|
+
/**
|
|
309
|
+
* Get the absolute output path for a file
|
|
310
|
+
*/
|
|
311
|
+
private getOutputPath;
|
|
312
|
+
private getStagingDir;
|
|
313
|
+
/**
|
|
314
|
+
* Prepare the program for building
|
|
315
|
+
* @param files the list of files that should be prepared
|
|
316
|
+
*/
|
|
317
|
+
private prepare;
|
|
318
|
+
/**
|
|
319
|
+
* Generate the contents of every file
|
|
320
|
+
*/
|
|
321
|
+
private serialize;
|
|
322
|
+
/**
|
|
323
|
+
* Write the entire project to disk
|
|
324
|
+
*/
|
|
325
|
+
private write;
|
|
326
|
+
private buildPipeline;
|
|
268
327
|
/**
|
|
269
|
-
*
|
|
270
|
-
*
|
|
328
|
+
* Build the project. This transpiles/transforms/copies all files and moves them to the staging directory
|
|
329
|
+
* @param options the list of options used to build the program
|
|
271
330
|
*/
|
|
272
|
-
|
|
273
|
-
private beforeProgramTranspile;
|
|
274
|
-
transpile(fileEntries: FileObj[], stagingFolderPath: string): Promise<void>;
|
|
275
|
-
private afterProgramTranspile;
|
|
331
|
+
build(options?: ProgramBuildOptions): Promise<void>;
|
|
276
332
|
/**
|
|
277
333
|
* Find a list of files in the program that have a function with the given name (case INsensitive)
|
|
278
334
|
*/
|
|
@@ -281,17 +337,42 @@ export declare class Program {
|
|
|
281
337
|
* Find a list of files in the program that have a class with the given name (case INsensitive)
|
|
282
338
|
*/
|
|
283
339
|
findFilesForClass(className: string): BscFile[];
|
|
340
|
+
findFilesForNamespace(name: string): BscFile[];
|
|
341
|
+
findFilesForEnum(name: string): BscFile[];
|
|
342
|
+
private _manifest;
|
|
343
|
+
/**
|
|
344
|
+
* Modify a parsed manifest map by reading `bs_const` and injecting values from `options.manifest.bs_const`
|
|
345
|
+
* @param parsedManifest The manifest map to read from and modify
|
|
346
|
+
*/
|
|
347
|
+
private buildBsConstsIntoParsedManifest;
|
|
348
|
+
/**
|
|
349
|
+
* Try to find and load the manifest into memory
|
|
350
|
+
* @param manifestFileObj A pointer to a potential manifest file object found during loading
|
|
351
|
+
* @param replaceIfAlreadyLoaded should we overwrite the internal `_manifest` if it already exists
|
|
352
|
+
*/
|
|
353
|
+
loadManifest(manifestFileObj?: FileObj, replaceIfAlreadyLoaded?: boolean): void;
|
|
284
354
|
/**
|
|
285
355
|
* Get a map of the manifest information
|
|
286
356
|
*/
|
|
287
357
|
getManifest(): Map<string, string>;
|
|
288
|
-
private _manifest;
|
|
289
358
|
dispose(): void;
|
|
290
359
|
}
|
|
291
360
|
export interface FileTranspileResult {
|
|
292
361
|
srcPath: string;
|
|
362
|
+
destPath: string;
|
|
293
363
|
pkgPath: string;
|
|
294
364
|
code: string;
|
|
295
|
-
map:
|
|
365
|
+
map: string;
|
|
296
366
|
typedef: string;
|
|
297
367
|
}
|
|
368
|
+
export interface ProgramBuildOptions {
|
|
369
|
+
/**
|
|
370
|
+
* The directory where the final built files should be placed. This directory will be cleared before running
|
|
371
|
+
*/
|
|
372
|
+
stagingDir?: string;
|
|
373
|
+
/**
|
|
374
|
+
* An array of files to build. If omitted, the entire list of files from the program will be used instead.
|
|
375
|
+
* Typically you will want to leave this blank
|
|
376
|
+
*/
|
|
377
|
+
files?: BscFile[];
|
|
378
|
+
}
|