brighterscript 1.0.0-alpha.3 → 1.0.0-alpha.31
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 +1249 -285
- package/README.md +61 -131
- package/bsconfig.schema.json +68 -2
- 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 +42 -0
- package/dist/AstValidationSegmenter.js +232 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +51 -6
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.d.ts +5 -6
- package/dist/Cache.js +12 -11
- 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 +11 -2
- package/dist/CodeActionUtil.js +17 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +7 -6
- package/dist/CommentFlagProcessor.js +10 -7
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +67 -0
- package/dist/CrossScopeValidator.js +625 -0
- package/dist/CrossScopeValidator.js.map +1 -0
- package/dist/DependencyGraph.d.ts +8 -3
- package/dist/DependencyGraph.js +49 -16
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.d.ts +5 -3
- package/dist/DiagnosticCollection.js +18 -16
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +8 -4
- package/dist/DiagnosticFilterer.js +77 -44
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticManager.d.ts +56 -0
- package/dist/DiagnosticManager.js +218 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +187 -20
- package/dist/DiagnosticMessages.js +247 -29
- 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 +72 -47
- package/dist/LanguageServer.js +544 -312
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +9 -10
- package/dist/Logger.js +36 -30
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +29 -7
- package/dist/PluginInterface.js +90 -7
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +199 -100
- package/dist/Program.js +1056 -700
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +29 -18
- package/dist/ProgramBuilder.js +170 -132
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +144 -109
- package/dist/Scope.js +533 -552
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.d.ts +14 -0
- package/dist/SemanticTokenUtils.js +85 -0
- package/dist/SemanticTokenUtils.js.map +1 -0
- package/dist/Stopwatch.d.ts +4 -0
- package/dist/Stopwatch.js +8 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +91 -24
- package/dist/SymbolTable.js +290 -64
- package/dist/SymbolTable.js.map +1 -1
- package/dist/SymbolTypeFlag.d.ts +9 -0
- package/dist/SymbolTypeFlag.js +14 -0
- package/dist/SymbolTypeFlag.js.map +1 -0
- 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 +5 -15
- package/dist/XmlScope.js +35 -87
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +50 -0
- package/dist/astUtils/CachedLookups.js +331 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/Editor.d.ts +69 -0
- package/dist/astUtils/Editor.js +245 -0
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/Editor.spec.js +258 -0
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +33 -10
- package/dist/astUtils/creators.js +224 -30
- 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 +146 -82
- package/dist/astUtils/reflection.js +308 -132
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +267 -162
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +14 -14
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +115 -53
- package/dist/astUtils/visitors.js +70 -13
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +465 -51
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -8
- package/dist/astUtils/xml.js +10 -5
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +22 -1
- package/dist/bscPlugin/BscPlugin.js +88 -0
- 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 +137 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +26 -17
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +94 -20
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +60 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +601 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2139 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +210 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -0
- package/dist/bscPlugin/definition/DefinitionProvider.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 +18 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +218 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +737 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
- package/dist/bscPlugin/references/ReferencesProvider.js +56 -0
- package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.d.ts +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +14 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +144 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +504 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
- 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/symbols/DocumentSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
- package/dist/bscPlugin/symbols/symbolUtils.js +140 -0
- package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +21 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +199 -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/BrsFileAfterValidator.d.ts +7 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +34 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +462 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +758 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +123 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1026 -0
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2897 -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 +117 -11
- 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 +10 -3
- package/dist/diagnosticUtils.js +58 -21
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -12
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +24 -0
- package/dist/files/AssetFile.js +25 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +858 -153
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +147 -82
- package/dist/files/BrsFile.js +853 -911
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +3056 -836
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +101 -0
- package/dist/files/BscFile.js +15 -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 +73 -41
- package/dist/files/XmlFile.js +126 -138
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +450 -318
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +62 -52
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
- package/dist/files/tests/optionalChaning.spec.js +152 -0
- package/dist/files/tests/optionalChaning.spec.js.map +1 -0
- package/dist/globalCallables.d.ts +3 -1
- package/dist/globalCallables.js +416 -162
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +25 -3
- package/dist/index.js +42 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +717 -119
- package/dist/interfaces.js +21 -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 +40 -9
- package/dist/lexer/Lexer.js +191 -49
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +775 -563
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +11 -3
- package/dist/lexer/Token.js +10 -2
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +27 -1
- package/dist/lexer/TokenKind.js +112 -5
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/logging.d.ts +9 -0
- package/dist/logging.js +16 -0
- package/dist/logging.js.map +1 -0
- package/dist/parser/AstNode.d.ts +181 -0
- package/dist/parser/AstNode.js +246 -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 +12 -2
- package/dist/parser/BrsTranspileState.js +6 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +454 -210
- package/dist/parser/Expression.js +953 -498
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +200 -95
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +106 -120
- package/dist/parser/Parser.js +1432 -931
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1383 -456
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +44 -6
- package/dist/parser/SGParser.js +212 -185
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +30 -28
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +293 -50
- package/dist/parser/SGTypes.js +540 -187
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +759 -247
- package/dist/parser/Statement.js +1785 -607
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +45 -34
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +18 -8
- package/dist/parser/TranspileState.js +76 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +10 -9
- package/dist/parser/tests/Parser.spec.js +18 -14
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +79 -69
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +53 -47
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +217 -196
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +48 -42
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +31 -31
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +157 -120
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +202 -139
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +25 -25
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +150 -41
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +18 -18
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +257 -257
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +160 -90
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +38 -38
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +196 -98
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +42 -42
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +42 -42
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/Relational.spec.js +44 -44
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +230 -90
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +377 -148
- 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 +126 -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 +37 -37
- 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 +45 -45
- 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.d.ts +1 -0
- package/dist/parser/tests/statement/Enum.spec.js +745 -0
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
- package/dist/parser/tests/statement/For.spec.d.ts +1 -0
- package/dist/parser/tests/statement/For.spec.js +45 -0
- package/dist/parser/tests/statement/For.spec.js.map +1 -0
- package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ForEach.spec.js +36 -0
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
- package/dist/parser/tests/statement/Function.spec.js +208 -198
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +16 -15
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +51 -51
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/LibraryStatement.spec.js +18 -18
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +123 -163
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +125 -108
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +51 -49
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +110 -97
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +13 -12
- 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 +26 -15
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +6 -6
- package/dist/preprocessor/Manifest.js +17 -38
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.d.ts +1 -0
- package/dist/preprocessor/Manifest.spec.js +78 -103
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/roku-types/data.json +19369 -0
- package/dist/roku-types/index.d.ts +5497 -0
- package/dist/roku-types/index.js +11 -0
- package/dist/roku-types/index.js.map +1 -0
- package/dist/types/ArrayType.d.ts +9 -5
- package/dist/types/ArrayType.js +68 -24
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +39 -11
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +14 -0
- package/dist/types/AssociativeArrayType.js +60 -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 +10 -5
- package/dist/types/BooleanType.js +21 -9
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -4
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +29 -3
- package/dist/types/BscType.js +121 -0
- 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 +25 -0
- package/dist/types/BuiltInInterfaceAdder.js +201 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +16 -0
- package/dist/types/ClassType.js +57 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +76 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +27 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +10 -5
- package/dist/types/DoubleType.js +25 -18
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -4
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +12 -5
- package/dist/types/DynamicType.js +22 -6
- 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 +40 -0
- package/dist/types/EnumType.js +80 -0
- package/dist/types/EnumType.js.map +1 -0
- 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 +10 -5
- package/dist/types/FloatType.js +25 -18
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -4
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +10 -22
- package/dist/types/FunctionType.js +26 -63
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +157 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +10 -5
- package/dist/types/IntegerType.js +25 -18
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -4
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +14 -6
- package/dist/types/InterfaceType.js +26 -15
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.d.ts +1 -0
- package/dist/types/InterfaceType.spec.js +227 -0
- package/dist/types/InterfaceType.spec.js.map +1 -0
- package/dist/types/InvalidType.d.ts +9 -5
- package/dist/types/InvalidType.js +20 -9
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -4
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +10 -5
- package/dist/types/LongIntegerType.js +25 -18
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -4
- 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 +10 -5
- package/dist/types/ObjectType.js +23 -9
- 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 +79 -0
- package/dist/types/ReferenceType.js +522 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +151 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +13 -5
- package/dist/types/StringType.js +25 -9
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -3
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +33 -0
- package/dist/types/TypedFunctionType.js +106 -0
- package/dist/types/TypedFunctionType.js.map +1 -0
- package/dist/types/TypedFunctionType.spec.d.ts +1 -0
- package/dist/types/TypedFunctionType.spec.js +122 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -0
- package/dist/types/UninitializedType.d.ts +8 -6
- package/dist/types/UninitializedType.js +15 -9
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +127 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +129 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +10 -5
- package/dist/types/VoidType.js +20 -9
- 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 +144 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +26 -0
- package/dist/types/helpers.js +191 -0
- package/dist/types/helpers.js.map +1 -0
- 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 +218 -106
- package/dist/util.js +1310 -320
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +9 -15
- package/dist/validators/ClassValidator.js +81 -134
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +169 -138
- package/dist/astUtils/index.d.ts +0 -7
- package/dist/astUtils/index.js +0 -26
- package/dist/astUtils/index.js.map +0 -1
- package/dist/lexer/index.d.ts +0 -3
- package/dist/lexer/index.js +0 -17
- package/dist/lexer/index.js.map +0 -1
- package/dist/parser/index.d.ts +0 -3
- package/dist/parser/index.js +0 -16
- package/dist/parser/index.js.map +0 -1
- package/dist/preprocessor/Chunk.d.ts +0 -82
- package/dist/preprocessor/Chunk.js +0 -77
- package/dist/preprocessor/Chunk.js.map +0 -1
- package/dist/preprocessor/Preprocessor.d.ts +0 -60
- package/dist/preprocessor/Preprocessor.js +0 -156
- package/dist/preprocessor/Preprocessor.js.map +0 -1
- package/dist/preprocessor/Preprocessor.spec.js +0 -152
- package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
- package/dist/preprocessor/PreprocessorParser.js +0 -194
- package/dist/preprocessor/PreprocessorParser.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
- package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
- package/dist/preprocessor/index.d.ts +0 -3
- package/dist/preprocessor/index.js +0 -16
- package/dist/preprocessor/index.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -10
- package/dist/types/CustomType.js +0 -35
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/FunctionType.spec.js +0 -29
- package/dist/types/FunctionType.spec.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -15
- package/dist/types/LazyType.js +0 -32
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/{preprocessor/Preprocessor.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
package/dist/Program.d.ts
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import type { CodeAction,
|
|
2
|
-
import {
|
|
3
|
-
import type { BsConfig } from './BsConfig';
|
|
1
|
+
import type { CodeAction, Position, Range, SignatureInformation, Location, DocumentSymbol } from 'vscode-languageserver';
|
|
2
|
+
import type { BsConfig, FinalizedBsConfig } from './BsConfig';
|
|
4
3
|
import { Scope } from './Scope';
|
|
5
|
-
import {
|
|
6
|
-
import { XmlFile } from './files/XmlFile';
|
|
7
|
-
import type { BsDiagnostic, FileReference, FileObj, BscFile } from './interfaces';
|
|
4
|
+
import type { FileObj, SemanticToken, FileLink, Hover } from './interfaces';
|
|
8
5
|
import { XmlScope } from './XmlScope';
|
|
9
|
-
import { Logger } from './
|
|
6
|
+
import type { Logger } from './logging';
|
|
10
7
|
import PluginInterface from './PluginInterface';
|
|
11
|
-
import type { FunctionStatement
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
8
|
+
import type { FunctionStatement } from './parser/Statement';
|
|
9
|
+
import { Editor } from './astUtils/Editor';
|
|
10
|
+
import type { Statement } from './parser/AstNode';
|
|
11
|
+
import type { FileData } from './files/LazyFileData';
|
|
12
|
+
import type { UnresolvedSymbol } from './AstValidationSegmenter';
|
|
13
|
+
import type { BscFile } from './files/BscFile';
|
|
14
|
+
import { CrossScopeValidator } from './CrossScopeValidator';
|
|
15
|
+
import { DiagnosticManager } from './DiagnosticManager';
|
|
16
|
+
import type { ProvidedSymbolInfo, BrsFile } from './files/BrsFile';
|
|
17
|
+
import type { XmlFile } from './files/XmlFile';
|
|
21
18
|
export interface SignatureInfoObj {
|
|
22
19
|
index: number;
|
|
23
20
|
key: string;
|
|
24
21
|
signature: SignatureInformation;
|
|
25
22
|
}
|
|
26
|
-
export interface FileLink<T> {
|
|
27
|
-
item: T;
|
|
28
|
-
file: BrsFile;
|
|
29
|
-
}
|
|
30
23
|
export declare class Program {
|
|
31
|
-
/**
|
|
32
|
-
* The root directory for this program
|
|
33
|
-
*/
|
|
34
|
-
options: BsConfig;
|
|
35
24
|
constructor(
|
|
36
25
|
/**
|
|
37
26
|
* The root directory for this program
|
|
38
27
|
*/
|
|
39
|
-
options: BsConfig, logger?: Logger, plugins?: PluginInterface);
|
|
28
|
+
options: BsConfig, logger?: Logger, plugins?: PluginInterface, diagnosticsManager?: DiagnosticManager);
|
|
29
|
+
options: FinalizedBsConfig;
|
|
40
30
|
logger: Logger;
|
|
31
|
+
/**
|
|
32
|
+
* 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`)
|
|
33
|
+
*/
|
|
34
|
+
editor: Editor;
|
|
35
|
+
/**
|
|
36
|
+
* A factory that creates `File` instances
|
|
37
|
+
*/
|
|
38
|
+
private fileFactory;
|
|
41
39
|
private createGlobalScope;
|
|
40
|
+
private recursivelyAddNodeToSymbolTable;
|
|
41
|
+
/**
|
|
42
|
+
* Do all setup required for the global symbol table.
|
|
43
|
+
*/
|
|
44
|
+
private populateGlobalSymbolTable;
|
|
42
45
|
/**
|
|
43
46
|
* A graph of all files and their dependencies.
|
|
44
47
|
* For example:
|
|
@@ -46,7 +49,7 @@ export declare class Program {
|
|
|
46
49
|
* lib2.brs -> [lib3.brs] //via an import statement
|
|
47
50
|
*/
|
|
48
51
|
private dependencyGraph;
|
|
49
|
-
|
|
52
|
+
diagnostics: DiagnosticManager;
|
|
50
53
|
/**
|
|
51
54
|
* A scope that contains all built-in global functions.
|
|
52
55
|
* All scopes should directly or indirectly inherit from this scope
|
|
@@ -56,28 +59,31 @@ export declare class Program {
|
|
|
56
59
|
* Plugins which can provide extra diagnostics or transform AST
|
|
57
60
|
*/
|
|
58
61
|
plugins: PluginInterface;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
private fileSymbolInformation;
|
|
63
|
+
addFileSymbolInfo(file: BrsFile): void;
|
|
64
|
+
getFileSymbolInfo(file: BrsFile): {
|
|
65
|
+
provides: ProvidedSymbolInfo;
|
|
66
|
+
requires: UnresolvedSymbol[];
|
|
67
|
+
};
|
|
64
68
|
/**
|
|
65
69
|
* The path to bslib.brs (the BrightScript runtime for certain BrighterScript features)
|
|
66
70
|
*/
|
|
67
|
-
get bslibPkgPath():
|
|
71
|
+
get bslibPkgPath(): string;
|
|
68
72
|
get bslibPrefix(): "rokucommunity_bslib" | "bslib";
|
|
69
73
|
/**
|
|
70
|
-
* A map of every file loaded
|
|
74
|
+
* A map of every file loaded into this program, indexed by its original file location
|
|
71
75
|
*/
|
|
72
|
-
|
|
76
|
+
files: Record<string, BscFile>;
|
|
73
77
|
/**
|
|
74
|
-
* A map of every file loaded into this program, indexed by its
|
|
78
|
+
* A map of every file loaded into this program, indexed by its destPath
|
|
75
79
|
*/
|
|
76
|
-
private
|
|
80
|
+
private destMap;
|
|
77
81
|
/**
|
|
78
|
-
*
|
|
82
|
+
* Plugins can contribute multiple virtual files for a single physical file.
|
|
83
|
+
* This collection links the virtual files back to the physical file that produced them.
|
|
84
|
+
* The key is the standardized and lower-cased srcPath
|
|
79
85
|
*/
|
|
80
|
-
|
|
86
|
+
private fileClusters;
|
|
81
87
|
private scopes;
|
|
82
88
|
protected addScope(scope: Scope): void;
|
|
83
89
|
/**
|
|
@@ -94,6 +100,14 @@ export declare class Program {
|
|
|
94
100
|
file: XmlFile;
|
|
95
101
|
scope: XmlScope;
|
|
96
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* Get the sorted names of custom components
|
|
105
|
+
*/
|
|
106
|
+
getSortedComponentNames(): string[];
|
|
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;
|
|
97
111
|
/**
|
|
98
112
|
* Register (or replace) the reference to a component in the component map
|
|
99
113
|
*/
|
|
@@ -102,6 +116,18 @@ export declare class Program {
|
|
|
102
116
|
* Remove the specified component from the components map
|
|
103
117
|
*/
|
|
104
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;
|
|
105
131
|
/**
|
|
106
132
|
* re-attach the dependency graph with a new key for any component who changed
|
|
107
133
|
* their position in their own named array (only matters when there are multiple
|
|
@@ -112,24 +138,22 @@ export declare class Program {
|
|
|
112
138
|
* Get a list of all files that are included in the project but are not referenced
|
|
113
139
|
* by any scope in the program.
|
|
114
140
|
*/
|
|
115
|
-
getUnreferencedFiles():
|
|
141
|
+
getUnreferencedFiles(): BscFile[];
|
|
116
142
|
/**
|
|
117
|
-
* Get the list of errors for the entire program.
|
|
118
|
-
* by walking through every file, so call this sparingly.
|
|
143
|
+
* Get the list of errors for the entire program.
|
|
119
144
|
*/
|
|
120
|
-
getDiagnostics(): BsDiagnostic[];
|
|
121
|
-
addDiagnostics(diagnostics: BsDiagnostic[]): void;
|
|
145
|
+
getDiagnostics(): import("./interfaces").BsDiagnostic[];
|
|
122
146
|
/**
|
|
123
147
|
* Determine if the specified file is loaded in this program right now.
|
|
124
|
-
* @param filePath
|
|
148
|
+
* @param filePath the absolute or relative path to the file
|
|
125
149
|
* @param normalizePath should the provided path be normalized before use
|
|
126
150
|
*/
|
|
127
151
|
hasFile(filePath: string, normalizePath?: boolean): boolean;
|
|
128
152
|
/**
|
|
129
153
|
* roku filesystem is case INsensitive, so find the scope by key case insensitive
|
|
130
|
-
* @param scopeName
|
|
154
|
+
* @param scopeName xml scope names are their `destPath`. Source scope is stored with the key `"source"`
|
|
131
155
|
*/
|
|
132
|
-
getScopeByName(scopeName: string): Scope;
|
|
156
|
+
getScopeByName(scopeName: string): Scope | undefined;
|
|
133
157
|
/**
|
|
134
158
|
* Return all scopes
|
|
135
159
|
*/
|
|
@@ -149,16 +173,34 @@ export declare class Program {
|
|
|
149
173
|
/**
|
|
150
174
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
151
175
|
* If file contents are provided, those are used, Otherwise, the file is loaded from the file system
|
|
152
|
-
* @param srcDestOrPkgPath the absolute path,
|
|
153
|
-
* @param
|
|
176
|
+
* @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:/`)
|
|
177
|
+
* @param fileData the file contents. omit or pass `undefined` to prevent loading the data at this time
|
|
154
178
|
*/
|
|
155
|
-
setFile<T extends BscFile>(srcDestOrPkgPath: string,
|
|
179
|
+
setFile<T extends BscFile>(srcDestOrPkgPath: string, fileData?: FileData): T;
|
|
156
180
|
/**
|
|
157
181
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
158
182
|
* @param fileEntry an object that specifies src and dest for the file.
|
|
159
|
-
* @param
|
|
183
|
+
* @param fileData the file contents. omit or pass `undefined` to prevent loading the data at this time
|
|
184
|
+
*/
|
|
185
|
+
setFile<T extends BscFile>(fileEntry: FileObj, fileData: FileData): T;
|
|
186
|
+
/**
|
|
187
|
+
* Given a srcPath, a destPath, or both, resolve whichever is missing, relative to rootDir.
|
|
188
|
+
* @param fileParam an object representing file paths
|
|
189
|
+
* @param rootDir must be a pre-normalized path
|
|
160
190
|
*/
|
|
161
|
-
|
|
191
|
+
private getPaths;
|
|
192
|
+
/**
|
|
193
|
+
* Remove any leading `pkg:/` found in the path
|
|
194
|
+
*/
|
|
195
|
+
private removePkgPrefix;
|
|
196
|
+
/**
|
|
197
|
+
* Is this file a .brs file found somewhere within the `pkg:/source/` folder?
|
|
198
|
+
*/
|
|
199
|
+
private isSourceBrsFile;
|
|
200
|
+
/**
|
|
201
|
+
* Is this file a .brs file found somewhere within the `pkg:/source/` folder?
|
|
202
|
+
*/
|
|
203
|
+
private isComponentsXmlFile;
|
|
162
204
|
/**
|
|
163
205
|
* Ensure source scope is created.
|
|
164
206
|
* Note: automatically called internally, and no-op if it exists already.
|
|
@@ -166,110 +208,167 @@ export declare class Program {
|
|
|
166
208
|
createSourceScope(): void;
|
|
167
209
|
/**
|
|
168
210
|
* Remove a set of files from the program
|
|
169
|
-
* @param srcPaths
|
|
211
|
+
* @param srcPaths can be an array of srcPath or destPath strings
|
|
212
|
+
* @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
|
|
170
213
|
*/
|
|
171
|
-
removeFiles(srcPaths: string[]): void;
|
|
214
|
+
removeFiles(srcPaths: string[], normalizePath?: boolean): void;
|
|
172
215
|
/**
|
|
173
216
|
* Remove a file from the program
|
|
174
|
-
* @param filePath can be a srcPath, a
|
|
217
|
+
* @param filePath can be a srcPath, a destPath, or a destPath with leading `pkg:/`
|
|
175
218
|
* @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
|
|
176
|
-
|
|
177
|
-
*/
|
|
178
|
-
removeFile(filePath: string, normalizePath?: boolean): void;
|
|
179
|
-
/**
|
|
180
|
-
* Remove all files from the program that are in the specified folder path (recursive)
|
|
181
|
-
* @param folderSrcPath The absolute path to the folder on disk
|
|
182
|
-
* @param normalizePath should the provided path be normalized before use?
|
|
183
219
|
*/
|
|
184
|
-
|
|
220
|
+
removeFile(filePath: string, normalizePath?: boolean, keepSymbolInformation?: boolean): void;
|
|
221
|
+
crossScopeValidation: CrossScopeValidator;
|
|
222
|
+
private isFirstValidation;
|
|
185
223
|
/**
|
|
186
224
|
* Traverse the entire project, and validate all scopes
|
|
187
|
-
* @param force - if true, then all scopes are force to validate, even if they aren't marked as dirty
|
|
188
225
|
*/
|
|
189
226
|
validate(): void;
|
|
227
|
+
private logValidationMetrics;
|
|
228
|
+
private getScopesForCrossScopeValidation;
|
|
190
229
|
/**
|
|
191
230
|
* Flag all duplicate component names
|
|
192
231
|
*/
|
|
193
232
|
private detectDuplicateComponentNames;
|
|
194
233
|
/**
|
|
195
|
-
*
|
|
234
|
+
* Get the files for a list of filePaths
|
|
235
|
+
* @param filePaths can be an array of srcPath or a destPath strings
|
|
236
|
+
* @param normalizePath should this function repair and standardize the paths? Passing false should have a performance boost if you can guarantee your paths are already sanitized
|
|
196
237
|
*/
|
|
197
|
-
|
|
238
|
+
getFiles<T extends BscFile>(filePaths: string[], normalizePath?: boolean): T[];
|
|
198
239
|
/**
|
|
199
240
|
* Get the file at the given path
|
|
200
|
-
* @param filePath can be a srcPath
|
|
241
|
+
* @param filePath can be a srcPath or a destPath
|
|
201
242
|
* @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
|
|
202
243
|
*/
|
|
203
244
|
getFile<T extends BscFile>(filePath: string, normalizePath?: boolean): T;
|
|
245
|
+
/**
|
|
246
|
+
* Gets a sorted list of all scopeNames, always beginning with "global", "source", then any others in alphabetical order
|
|
247
|
+
*/
|
|
248
|
+
private getSortedScopeNames;
|
|
204
249
|
/**
|
|
205
250
|
* Get a list of all scopes the file is loaded into
|
|
206
|
-
* @param file
|
|
251
|
+
* @param file the file
|
|
207
252
|
*/
|
|
208
|
-
getScopesForFile(file:
|
|
253
|
+
getScopesForFile(file: BscFile | string): Scope[];
|
|
254
|
+
/**
|
|
255
|
+
* Get the first found scope for a file.
|
|
256
|
+
*/
|
|
257
|
+
getFirstScopeForFile(file: BscFile): Scope | undefined;
|
|
209
258
|
getStatementsByName(name: string, originFile: BrsFile, namespaceName?: string): FileLink<Statement>[];
|
|
210
259
|
getStatementsForXmlFile(scope: XmlScope, filterName?: string): FileLink<FunctionStatement>[];
|
|
211
260
|
/**
|
|
212
261
|
* Find all available completion items at the given position
|
|
213
|
-
* @param
|
|
214
|
-
* @param
|
|
215
|
-
* @param columnIndex
|
|
262
|
+
* @param filePath can be a srcPath or a destPath
|
|
263
|
+
* @param position the position (line & column) where completions should be found
|
|
216
264
|
*/
|
|
217
|
-
getCompletions(
|
|
265
|
+
getCompletions(filePath: string, position: Position): import("vscode-languageserver-types").CompletionItem[];
|
|
218
266
|
/**
|
|
219
267
|
* Goes through each file and builds a list of workspace symbols for the program. Used by LanguageServer's onWorkspaceSymbol functionality
|
|
220
268
|
*/
|
|
221
|
-
getWorkspaceSymbols():
|
|
269
|
+
getWorkspaceSymbols(): import("vscode-languageserver-types").WorkspaceSymbol[];
|
|
222
270
|
/**
|
|
223
271
|
* Given a position in a file, if the position is sitting on some type of identifier,
|
|
224
272
|
* go to the definition of that identifier (where this thing was first defined)
|
|
225
|
-
* @param srcPath The absolute path to the source file on disk
|
|
226
273
|
*/
|
|
227
274
|
getDefinition(srcPath: string, position: Position): Location[];
|
|
228
275
|
/**
|
|
229
|
-
*
|
|
276
|
+
* Get hover information for a file and position
|
|
230
277
|
*/
|
|
231
|
-
getHover(srcPath: string, position: Position):
|
|
278
|
+
getHover(srcPath: string, position: Position): Hover[];
|
|
279
|
+
/**
|
|
280
|
+
* Get full list of document symbols for a file
|
|
281
|
+
* @param srcPath path to the file
|
|
282
|
+
*/
|
|
283
|
+
getDocumentSymbols(srcPath: string): DocumentSymbol[] | undefined;
|
|
232
284
|
/**
|
|
233
285
|
* Compute code actions for the given file and range
|
|
234
|
-
* @param srcPath The absolute path to the source file on disk
|
|
235
286
|
*/
|
|
236
287
|
getCodeActions(srcPath: string, range: Range): CodeAction[];
|
|
288
|
+
/**
|
|
289
|
+
* Get semantic tokens for the specified file
|
|
290
|
+
*/
|
|
291
|
+
getSemanticTokens(srcPath: string): SemanticToken[] | undefined;
|
|
237
292
|
getSignatureHelp(filepath: string, position: Position): SignatureInfoObj[];
|
|
238
|
-
|
|
239
|
-
private getPartialItemCounts;
|
|
293
|
+
getReferences(srcPath: string, position: Position): Location[];
|
|
240
294
|
/**
|
|
241
|
-
*
|
|
295
|
+
* Transpile a single file and get the result as a string.
|
|
296
|
+
* This does not write anything to the file system.
|
|
297
|
+
*
|
|
298
|
+
* This should only be called by `LanguageServer`.
|
|
299
|
+
* Internal usage should call `_getTranspiledFileContents` instead.
|
|
300
|
+
* @param filePath can be a srcPath or a destPath
|
|
242
301
|
*/
|
|
243
|
-
|
|
302
|
+
getTranspiledFileContents(filePath: string): Promise<FileTranspileResult>;
|
|
303
|
+
private getTranspiledFileContentsPipeline;
|
|
244
304
|
/**
|
|
245
|
-
* Get
|
|
246
|
-
* @param sourcePkgPath - the pkgPath of the source that wants to resolve script imports.
|
|
305
|
+
* Get the absolute output path for a file
|
|
247
306
|
*/
|
|
248
|
-
|
|
307
|
+
private getOutputPath;
|
|
308
|
+
private getStagingDir;
|
|
249
309
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* @param srcPath The absolute path to the source file on disk
|
|
310
|
+
* Prepare the program for building
|
|
311
|
+
* @param files the list of files that should be prepared
|
|
253
312
|
*/
|
|
254
|
-
|
|
255
|
-
srcPath: string;
|
|
256
|
-
pkgPath: string;
|
|
257
|
-
code: string;
|
|
258
|
-
map: import("source-map").SourceMapGenerator;
|
|
259
|
-
};
|
|
260
|
-
transpile(fileEntries: FileObj[], stagingFolderPath: string): Promise<void>;
|
|
313
|
+
private prepare;
|
|
261
314
|
/**
|
|
262
|
-
*
|
|
315
|
+
* Generate the contents of every file
|
|
316
|
+
*/
|
|
317
|
+
private serialize;
|
|
318
|
+
/**
|
|
319
|
+
* Write the entire project to disk
|
|
263
320
|
*/
|
|
264
|
-
|
|
321
|
+
private write;
|
|
322
|
+
private buildPipeline;
|
|
323
|
+
/**
|
|
324
|
+
* Build the project. This transpiles/transforms/copies all files and moves them to the staging directory
|
|
325
|
+
* @param options the list of options used to build the program
|
|
326
|
+
*/
|
|
327
|
+
build(options?: ProgramBuildOptions): Promise<void>;
|
|
265
328
|
/**
|
|
266
329
|
* Find a list of files in the program that have a function with the given name (case INsensitive)
|
|
267
330
|
*/
|
|
268
|
-
|
|
331
|
+
findFilesForFunction(functionName: string): BscFile[];
|
|
269
332
|
/**
|
|
270
|
-
*
|
|
333
|
+
* Find a list of files in the program that have a class with the given name (case INsensitive)
|
|
271
334
|
*/
|
|
272
|
-
|
|
335
|
+
findFilesForClass(className: string): BscFile[];
|
|
336
|
+
findFilesForNamespace(name: string): BscFile[];
|
|
337
|
+
findFilesForEnum(name: string): BscFile[];
|
|
273
338
|
private _manifest;
|
|
339
|
+
/**
|
|
340
|
+
* Modify a parsed manifest map by reading `bs_const` and injecting values from `options.manifest.bs_const`
|
|
341
|
+
* @param parsedManifest The manifest map to read from and modify
|
|
342
|
+
*/
|
|
343
|
+
private buildBsConstsIntoParsedManifest;
|
|
344
|
+
/**
|
|
345
|
+
* Try to find and load the manifest into memory
|
|
346
|
+
* @param manifestFileObj A pointer to a potential manifest file object found during loading
|
|
347
|
+
* @param replaceIfAlreadyLoaded should we overwrite the internal `_manifest` if it already exists
|
|
348
|
+
*/
|
|
349
|
+
loadManifest(manifestFileObj?: FileObj, replaceIfAlreadyLoaded?: boolean): void;
|
|
350
|
+
/**
|
|
351
|
+
* Get a map of the manifest information
|
|
352
|
+
*/
|
|
353
|
+
getManifest(): Map<string, string>;
|
|
274
354
|
dispose(): void;
|
|
275
355
|
}
|
|
356
|
+
export interface FileTranspileResult {
|
|
357
|
+
srcPath: string;
|
|
358
|
+
destPath: string;
|
|
359
|
+
pkgPath: string;
|
|
360
|
+
code: string;
|
|
361
|
+
map: string;
|
|
362
|
+
typedef: string;
|
|
363
|
+
}
|
|
364
|
+
export interface ProgramBuildOptions {
|
|
365
|
+
/**
|
|
366
|
+
* The directory where the final built files should be placed. This directory will be cleared before running
|
|
367
|
+
*/
|
|
368
|
+
stagingDir?: string;
|
|
369
|
+
/**
|
|
370
|
+
* An array of files to build. If omitted, the entire list of files from the program will be used instead.
|
|
371
|
+
* Typically you will want to leave this blank
|
|
372
|
+
*/
|
|
373
|
+
files?: BscFile[];
|
|
374
|
+
}
|