brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.50
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/README.md +76 -138
- package/bsconfig.schema.json +121 -5
- 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 +45 -0
- package/dist/AstValidationSegmenter.js +322 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +72 -39
- package/dist/BusyStatusTracker.d.ts +61 -0
- package/dist/BusyStatusTracker.js +148 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.d.ts +3 -8
- package/dist/Cache.js +9 -14
- 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 +12 -4
- package/dist/CodeActionUtil.js +22 -5
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +7 -6
- package/dist/CommentFlagProcessor.js +11 -8
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +68 -0
- package/dist/CrossScopeValidator.js +642 -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 +21 -5
- package/dist/DiagnosticCollection.js +77 -24
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +27 -6
- package/dist/DiagnosticFilterer.js +273 -60
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticManager.d.ts +82 -0
- package/dist/DiagnosticManager.js +406 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +558 -196
- package/dist/DiagnosticMessages.js +870 -340
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +45 -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 +100 -105
- package/dist/LanguageServer.js +444 -745
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +17 -13
- package/dist/Logger.js +64 -34
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +32 -10
- package/dist/PluginInterface.js +117 -7
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +241 -98
- package/dist/Program.js +1432 -717
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +47 -23
- package/dist/ProgramBuilder.js +224 -178
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +149 -109
- package/dist/Scope.js +557 -550
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.js +5 -1
- package/dist/SemanticTokenUtils.js.map +1 -1
- 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 +136 -24
- package/dist/SymbolTable.js +565 -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 +34 -90
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +50 -0
- package/dist/astUtils/CachedLookups.js +334 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/CachedLookups.spec.js +39 -0
- package/dist/astUtils/CachedLookups.spec.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 +54 -19
- package/dist/astUtils/creators.js +242 -42
- 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 +196 -85
- package/dist/astUtils/reflection.js +497 -144
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +267 -167
- 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 +116 -53
- package/dist/astUtils/visitors.js +95 -15
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +629 -51
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -8
- package/dist/astUtils/xml.js +12 -7
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +24 -4
- package/dist/bscPlugin/BscPlugin.js +88 -4
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +143 -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 +6 -5
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +173 -27
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +138 -21
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +65 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +633 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2512 -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 +212 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -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 +230 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +991 -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 +57 -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 +164 -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 +564 -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 +33 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
- package/dist/bscPlugin/serialize/BslibManager.js +46 -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 +75 -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 +141 -0
- package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +27 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +418 -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 +75 -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 +37 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +638 -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 +1517 -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 +141 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1323 -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 +6135 -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 +36 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +126 -27
- package/dist/cli.js.map +1 -1
- package/dist/common/Sequencer.d.ts +53 -0
- package/dist/common/Sequencer.js +233 -0
- package/dist/common/Sequencer.js.map +1 -0
- package/dist/common/Sequencer.spec.d.ts +1 -0
- package/dist/common/Sequencer.spec.js +75 -0
- package/dist/common/Sequencer.spec.js.map +1 -0
- package/dist/deferred.d.ts +5 -3
- package/dist/deferred.js +10 -0
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +10 -3
- package/dist/diagnosticUtils.js +64 -25
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.d.ts +2 -2
- 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 +1213 -259
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +145 -87
- package/dist/files/BrsFile.js +836 -934
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +4226 -902
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +102 -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 +21 -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 +80 -41
- package/dist/files/XmlFile.js +161 -137
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +444 -336
- 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 +424 -184
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +32 -4
- package/dist/index.js +54 -7
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +942 -125
- 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 +51 -12
- package/dist/lexer/Lexer.js +215 -65
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +812 -568
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +27 -11
- package/dist/lexer/Token.js +10 -2
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +40 -2
- package/dist/lexer/TokenKind.js +147 -10
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/logging.d.ts +14 -0
- package/dist/logging.js +29 -0
- package/dist/logging.js.map +1 -0
- package/dist/lsp/ActionQueue.d.ts +35 -0
- package/dist/lsp/ActionQueue.js +115 -0
- package/dist/lsp/ActionQueue.js.map +1 -0
- package/dist/lsp/ActionQueue.spec.d.ts +1 -0
- package/dist/lsp/ActionQueue.spec.js +80 -0
- package/dist/lsp/ActionQueue.spec.js.map +1 -0
- package/dist/lsp/DocumentManager.d.ts +63 -0
- package/dist/lsp/DocumentManager.js +122 -0
- package/dist/lsp/DocumentManager.js.map +1 -0
- package/dist/lsp/DocumentManager.spec.d.ts +1 -0
- package/dist/lsp/DocumentManager.spec.js +103 -0
- package/dist/lsp/DocumentManager.spec.js.map +1 -0
- package/dist/lsp/LspProject.d.ts +239 -0
- package/dist/lsp/LspProject.js +3 -0
- package/dist/lsp/LspProject.js.map +1 -0
- package/dist/lsp/PathFilterer.d.ts +75 -0
- package/dist/lsp/PathFilterer.js +196 -0
- package/dist/lsp/PathFilterer.js.map +1 -0
- package/dist/lsp/PathFilterer.spec.d.ts +1 -0
- package/dist/lsp/PathFilterer.spec.js +182 -0
- package/dist/lsp/PathFilterer.spec.js.map +1 -0
- package/dist/lsp/Project.d.ts +168 -0
- package/dist/lsp/Project.js +437 -0
- package/dist/lsp/Project.js.map +1 -0
- package/dist/lsp/Project.spec.d.ts +1 -0
- package/dist/lsp/Project.spec.js +267 -0
- package/dist/lsp/Project.spec.js.map +1 -0
- package/dist/lsp/ProjectManager.d.ts +242 -0
- package/dist/lsp/ProjectManager.js +824 -0
- package/dist/lsp/ProjectManager.js.map +1 -0
- package/dist/lsp/ProjectManager.spec.d.ts +1 -0
- package/dist/lsp/ProjectManager.spec.js +913 -0
- package/dist/lsp/ProjectManager.spec.js.map +1 -0
- package/dist/lsp/ReaderWriterManager.d.ts +21 -0
- package/dist/lsp/ReaderWriterManager.js +60 -0
- package/dist/lsp/ReaderWriterManager.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.d.ts +99 -0
- package/dist/lsp/worker/MessageHandler.js +138 -0
- package/dist/lsp/worker/MessageHandler.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.spec.d.ts +1 -0
- package/dist/lsp/worker/MessageHandler.spec.js +64 -0
- package/dist/lsp/worker/MessageHandler.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.d.ts +38 -0
- package/dist/lsp/worker/WorkerPool.js +78 -0
- package/dist/lsp/worker/WorkerPool.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.spec.d.ts +1 -0
- package/dist/lsp/worker/WorkerPool.spec.js +59 -0
- package/dist/lsp/worker/WorkerPool.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.d.ts +143 -0
- package/dist/lsp/worker/WorkerThreadProject.js +189 -0
- package/dist/lsp/worker/WorkerThreadProject.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.d.ts +2 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js +71 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.d.ts +15 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js +58 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js.map +1 -0
- package/dist/lsp/worker/run.d.ts +1 -0
- package/dist/lsp/worker/run.js +14 -0
- package/dist/lsp/worker/run.js.map +1 -0
- package/dist/parser/AstNode.d.ts +203 -0
- package/dist/parser/AstNode.js +303 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +1455 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.d.ts +56 -0
- package/dist/parser/BrightScriptDocParser.js +294 -0
- package/dist/parser/BrightScriptDocParser.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
- package/dist/parser/BrightScriptDocParser.spec.js +310 -0
- package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +22 -3
- package/dist/parser/BrsTranspileState.js +19 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +553 -221
- package/dist/parser/Expression.js +1414 -505
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Expression.spec.d.ts +1 -0
- package/dist/parser/Expression.spec.js +40 -0
- package/dist/parser/Expression.spec.js.map +1 -0
- package/dist/parser/Parser.Class.spec.js +255 -125
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +117 -124
- package/dist/parser/Parser.js +1669 -982
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +2111 -525
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +29 -13
- package/dist/parser/SGParser.js +85 -56
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +30 -45
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +134 -46
- package/dist/parser/SGTypes.js +206 -115
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +849 -267
- package/dist/parser/Statement.js +2412 -625
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +133 -36
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +26 -12
- package/dist/parser/TranspileState.js +115 -24
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +3 -9
- package/dist/parser/tests/Parser.spec.js +7 -13
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +83 -75
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +85 -51
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +382 -239
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +52 -45
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +51 -43
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +41 -34
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +173 -55
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +20 -20
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +291 -282
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +193 -110
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +260 -115
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +76 -60
- 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 +50 -50
- 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 +281 -94
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +747 -192
- 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 +44 -44
- 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 +500 -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 +61 -55
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +29 -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 +744 -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 +226 -215
- 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 +64 -61
- 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 +22 -22
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +127 -168
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +131 -117
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +14 -13
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +11 -8
- 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 +20347 -0
- package/dist/roku-types/index.d.ts +5726 -0
- package/dist/roku-types/index.js +11 -0
- package/dist/roku-types/index.js.map +1 -0
- package/dist/types/ArrayType.d.ts +12 -5
- package/dist/types/ArrayType.js +89 -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 +15 -0
- package/dist/types/AssociativeArrayType.js +64 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +10 -0
- package/dist/types/BaseFunctionType.js +26 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +9 -5
- package/dist/types/BooleanType.js +19 -8
- 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 +41 -3
- package/dist/types/BscType.js +152 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +28 -0
- package/dist/types/BscTypeKind.js +33 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +28 -0
- package/dist/types/BuiltInInterfaceAdder.js +212 -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/CallFuncableType.d.ts +24 -0
- package/dist/types/CallFuncableType.js +91 -0
- package/dist/types/CallFuncableType.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +60 -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 +22 -0
- package/dist/types/ComponentType.js +107 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +10 -5
- package/dist/types/DoubleType.js +21 -17
- 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 +13 -5
- package/dist/types/DynamicType.js +26 -5
- 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 +42 -0
- package/dist/types/EnumType.js +98 -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 +21 -17
- 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 +8 -22
- package/dist/types/FunctionType.js +25 -63
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +29 -0
- package/dist/types/InheritableType.js +173 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/InlineInterfaceType.d.ts +5 -0
- package/dist/types/InlineInterfaceType.js +17 -0
- package/dist/types/InlineInterfaceType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +10 -5
- package/dist/types/IntegerType.js +21 -17
- 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 +30 -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/IntersectionType.d.ts +29 -0
- package/dist/types/IntersectionType.js +253 -0
- package/dist/types/IntersectionType.js.map +1 -0
- package/dist/types/IntersectionType.spec.d.ts +1 -0
- package/dist/types/IntersectionType.spec.js +150 -0
- package/dist/types/IntersectionType.spec.js.map +1 -0
- package/dist/types/InvalidType.d.ts +10 -5
- package/dist/types/InvalidType.js +21 -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 +21 -17
- 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 +12 -5
- package/dist/types/ObjectType.js +25 -8
- 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 +123 -0
- package/dist/types/ReferenceType.js +720 -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 +12 -5
- package/dist/types/StringType.js +23 -8
- 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/TypeStatementType.d.ts +18 -0
- package/dist/types/TypeStatementType.js +45 -0
- package/dist/types/TypeStatementType.js.map +1 -0
- package/dist/types/TypedFunctionType.d.ts +34 -0
- package/dist/types/TypedFunctionType.js +147 -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 +11 -6
- package/dist/types/UninitializedType.js +20 -11
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +27 -0
- package/dist/types/UnionType.js +193 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +205 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +11 -5
- package/dist/types/VoidType.js +22 -8
- 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 +174 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +51 -0
- package/dist/types/helpers.js +323 -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/types/roFunctionType.d.ts +11 -0
- package/dist/types/roFunctionType.js +37 -0
- package/dist/types/roFunctionType.js.map +1 -0
- package/dist/types/roFunctionType.spec.d.ts +1 -0
- package/dist/types/roFunctionType.spec.js +20 -0
- package/dist/types/roFunctionType.spec.js.map +1 -0
- package/dist/util.d.ts +288 -187
- package/dist/util.js +2018 -575
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +9 -15
- package/dist/validators/ClassValidator.js +93 -138
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +185 -138
- package/CHANGELOG.md +0 -1188
- 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/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +0 -7
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +0 -63
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.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/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.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/{bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/Preprocessor.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,23 +1,91 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { Range, CodeAction, Position, CompletionItem, Location, DocumentSymbol, WorkspaceSymbol, Disposable, FileChangeType, CodeDescription, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag } from 'vscode-languageserver-protocol';
|
|
2
4
|
import type { Scope } from './Scope';
|
|
3
5
|
import type { BrsFile } from './files/BrsFile';
|
|
4
6
|
import type { XmlFile } from './files/XmlFile';
|
|
5
|
-
import type {
|
|
7
|
+
import type { TypedFunctionType } from './types/TypedFunctionType';
|
|
6
8
|
import type { ParseMode } from './parser/Parser';
|
|
7
9
|
import type { Program } from './Program';
|
|
8
10
|
import type { ProgramBuilder } from './ProgramBuilder';
|
|
9
|
-
import type {
|
|
11
|
+
import type { FunctionStatement, NamespaceStatement } from './parser/Statement';
|
|
12
|
+
import type { AstNode, Expression } from './parser/AstNode';
|
|
10
13
|
import type { TranspileState } from './parser/TranspileState';
|
|
11
14
|
import type { SourceNode } from 'source-map';
|
|
12
15
|
import type { BscType } from './types/BscType';
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
import type { Identifier, Token } from './lexer/Token';
|
|
17
|
+
import type { SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver';
|
|
18
|
+
import type { SymbolTable } from './SymbolTable';
|
|
19
|
+
import type { SymbolTypeFlag } from './SymbolTypeFlag';
|
|
20
|
+
import type { Editor } from './astUtils/Editor';
|
|
21
|
+
import type { BscFile } from './files/BscFile';
|
|
22
|
+
import type { FileFactory } from './files/Factory';
|
|
23
|
+
import type { LazyFileData } from './files/LazyFileData';
|
|
24
|
+
import type { BscTypeKind } from './types/BscTypeKind';
|
|
25
|
+
export interface BsDiagnostic {
|
|
26
|
+
/**
|
|
27
|
+
* The location at which the message applies
|
|
28
|
+
*/
|
|
29
|
+
location: Location;
|
|
30
|
+
/**
|
|
31
|
+
* The diagnostic's severity. Can be omitted. If omitted it is up to the
|
|
32
|
+
* client to interpret diagnostics as error, warning, info or hint.
|
|
33
|
+
*/
|
|
34
|
+
severity?: DiagnosticSeverity;
|
|
35
|
+
/**
|
|
36
|
+
* The diagnostic's code, which usually appear in the user interface.
|
|
37
|
+
*/
|
|
38
|
+
code?: number | string;
|
|
15
39
|
/**
|
|
16
|
-
*
|
|
40
|
+
* An optional property to describe the error code.
|
|
41
|
+
* Requires the code field (above) to be present/not null.
|
|
42
|
+
*
|
|
43
|
+
* @since 3.16.0
|
|
44
|
+
*/
|
|
45
|
+
codeDescription?: CodeDescription;
|
|
46
|
+
/**
|
|
47
|
+
* A human-readable string describing the source of this
|
|
48
|
+
* diagnostic, e.g. 'typescript' or 'super lint'. It usually
|
|
49
|
+
* appears in the user interface.
|
|
50
|
+
*/
|
|
51
|
+
source?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The diagnostic's message. It usually appears in the user interface
|
|
54
|
+
*/
|
|
55
|
+
message: string;
|
|
56
|
+
/**
|
|
57
|
+
* Additional metadata about the diagnostic.
|
|
58
|
+
*
|
|
59
|
+
* @since 3.15.0
|
|
60
|
+
*/
|
|
61
|
+
tags?: DiagnosticTag[];
|
|
62
|
+
/**
|
|
63
|
+
* An array of related diagnostic information, e.g. when symbol-names within
|
|
64
|
+
* a scope collide all definitions can be marked via this property.
|
|
65
|
+
*/
|
|
66
|
+
relatedInformation?: DiagnosticRelatedInformation[];
|
|
67
|
+
/**
|
|
68
|
+
* A data entry field that is preserved between a `textDocument/publishDiagnostics`
|
|
69
|
+
* notification and `textDocument/codeAction` request.
|
|
70
|
+
*
|
|
71
|
+
* @since 3.16.0
|
|
17
72
|
*/
|
|
18
73
|
data?: any;
|
|
74
|
+
/**
|
|
75
|
+
* The code used for this diagnostic in v0
|
|
76
|
+
*/
|
|
77
|
+
legacyCode?: number | string;
|
|
78
|
+
}
|
|
79
|
+
export interface DiagnosticContext {
|
|
80
|
+
scopeSpecific?: boolean;
|
|
81
|
+
scope?: Scope;
|
|
82
|
+
tags?: string[];
|
|
83
|
+
segment?: AstNode;
|
|
84
|
+
}
|
|
85
|
+
export interface DiagnosticContextPair {
|
|
86
|
+
diagnostic: BsDiagnostic;
|
|
87
|
+
context?: DiagnosticContext;
|
|
19
88
|
}
|
|
20
|
-
export declare type BscFile = BrsFile | XmlFile;
|
|
21
89
|
export interface Callable {
|
|
22
90
|
file: BscFile;
|
|
23
91
|
name: string;
|
|
@@ -25,7 +93,7 @@ export interface Callable {
|
|
|
25
93
|
* Is the callable declared as "sub". If falsey, assumed declared as "function"
|
|
26
94
|
*/
|
|
27
95
|
isSub: boolean;
|
|
28
|
-
type:
|
|
96
|
+
type: TypedFunctionType;
|
|
29
97
|
/**
|
|
30
98
|
* A short description of the callable. Should be a short sentence.
|
|
31
99
|
*/
|
|
@@ -54,29 +122,13 @@ export interface Callable {
|
|
|
54
122
|
*/
|
|
55
123
|
functionStatement: FunctionStatement;
|
|
56
124
|
}
|
|
57
|
-
export interface FunctionCall {
|
|
58
|
-
/**
|
|
59
|
-
* The full range of this function call (from the start of the function name to its closing paren)
|
|
60
|
-
*/
|
|
61
|
-
range: Range;
|
|
62
|
-
functionExpression: FunctionExpression;
|
|
63
|
-
file: BscFile;
|
|
64
|
-
name: string;
|
|
65
|
-
args: CallableArg[];
|
|
66
|
-
nameRange: Range;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* An argument for an expression call.
|
|
70
|
-
*/
|
|
71
|
-
export interface CallableArg {
|
|
72
|
-
text: string;
|
|
73
|
-
type: BscType;
|
|
74
|
-
range: Range;
|
|
75
|
-
}
|
|
76
125
|
export interface CallableParam {
|
|
77
126
|
name: string;
|
|
78
127
|
type: BscType;
|
|
79
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Is this parameter required or optional?
|
|
130
|
+
*/
|
|
131
|
+
isOptional: boolean;
|
|
80
132
|
/**
|
|
81
133
|
* Indicates that an unlimited number of arguments can be passed in
|
|
82
134
|
*/
|
|
@@ -91,12 +143,12 @@ export interface FileObj {
|
|
|
91
143
|
*/
|
|
92
144
|
export interface FileReference {
|
|
93
145
|
/**
|
|
94
|
-
* The
|
|
146
|
+
* The destPath for the referenced file.
|
|
95
147
|
*/
|
|
96
|
-
|
|
148
|
+
destPath: string;
|
|
97
149
|
text: string;
|
|
98
150
|
/**
|
|
99
|
-
* The file that is doing the import. Note this is NOT the file the
|
|
151
|
+
* The file that is doing the import. Note this is NOT the file the destPath points to.
|
|
100
152
|
*/
|
|
101
153
|
sourceFile: XmlFile | BrsFile;
|
|
102
154
|
/**
|
|
@@ -109,7 +161,7 @@ export interface FileReference {
|
|
|
109
161
|
}
|
|
110
162
|
export interface VariableDeclaration {
|
|
111
163
|
name: string;
|
|
112
|
-
|
|
164
|
+
getType: () => BscType;
|
|
113
165
|
/**
|
|
114
166
|
* The range for the variable name
|
|
115
167
|
*/
|
|
@@ -151,170 +203,713 @@ export interface CommentFlag {
|
|
|
151
203
|
affectedRange: Range;
|
|
152
204
|
codes: DiagnosticCode[] | null;
|
|
153
205
|
}
|
|
154
|
-
export
|
|
155
|
-
|
|
206
|
+
export interface PluginFactoryOptions {
|
|
207
|
+
/**
|
|
208
|
+
* What version of brighterscript is activating this plugin? (Useful for picking different plugins or behavior based on the version of brighterscript)
|
|
209
|
+
*/
|
|
210
|
+
version: string;
|
|
211
|
+
}
|
|
212
|
+
export declare type PluginFactory = (options?: PluginFactoryOptions) => Plugin;
|
|
213
|
+
/**
|
|
214
|
+
* @deprecated use `PluginFactory` instead
|
|
215
|
+
*/
|
|
216
|
+
export declare type CompilerPluginFactory = PluginFactory;
|
|
217
|
+
/**
|
|
218
|
+
* @deprecated use `Plugin` instead
|
|
219
|
+
*/
|
|
220
|
+
export declare type CompilerPlugin = Plugin;
|
|
221
|
+
export interface Plugin {
|
|
156
222
|
name: string;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Called before a new program is created
|
|
225
|
+
*/
|
|
226
|
+
beforeProvideProgram?(event: BeforeProvideProgramEvent): any;
|
|
227
|
+
provideProgram?(event: ProvideProgramEvent): any;
|
|
228
|
+
/**
|
|
229
|
+
* Called after a new program is created
|
|
230
|
+
*/
|
|
231
|
+
afterProvideProgram?(event: AfterProvideProgramEvent): any;
|
|
232
|
+
/**
|
|
233
|
+
* Called before the program gets prepared for building
|
|
234
|
+
*/
|
|
235
|
+
beforePrepareProgram?(event: BeforePrepareProgramEvent): any;
|
|
236
|
+
/**
|
|
237
|
+
* Called when the program gets prepared for building
|
|
238
|
+
*/
|
|
239
|
+
prepareProgram?(event: PrepareProgramEvent): any;
|
|
240
|
+
/**
|
|
241
|
+
* Called after the program gets prepared for building
|
|
242
|
+
*/
|
|
243
|
+
afterPrepareProgram?(event: AfterPrepareProgramEvent): any;
|
|
244
|
+
/**
|
|
245
|
+
* Called before the entire program is validated
|
|
246
|
+
*/
|
|
247
|
+
beforeValidateProgram?(event: BeforeValidateProgramEvent): any;
|
|
248
|
+
/**
|
|
249
|
+
* Called before the entire program is validated
|
|
250
|
+
*/
|
|
251
|
+
validateProgram?(event: ValidateProgramEvent): any;
|
|
252
|
+
/**
|
|
253
|
+
* Called after the program has been validated
|
|
254
|
+
*/
|
|
255
|
+
afterValidateProgram?(event: AfterValidateProgramEvent): any;
|
|
256
|
+
/**
|
|
257
|
+
* Called right before the program is disposed/destroyed
|
|
258
|
+
*/
|
|
259
|
+
beforeRemoveProgram?(event: BeforeRemoveProgramEvent): any;
|
|
260
|
+
removeProgram?(event: RemoveProgramEvent): any;
|
|
261
|
+
afterRemoveProgram?(event: AfterRemoveProgramEvent): any;
|
|
262
|
+
/**
|
|
263
|
+
* Emitted before the program starts collecting completions
|
|
264
|
+
*/
|
|
265
|
+
beforeProvideCompletions?(event: BeforeProvideCompletionsEvent): any;
|
|
266
|
+
/**
|
|
267
|
+
* Use this event to contribute completions
|
|
268
|
+
*/
|
|
269
|
+
provideCompletions?(event: ProvideCompletionsEvent): any;
|
|
270
|
+
/**
|
|
271
|
+
* Emitted after the program has finished collecting completions, but before they are sent to the client
|
|
272
|
+
*/
|
|
273
|
+
afterProvideCompletions?(event: AfterProvideCompletionsEvent): any;
|
|
274
|
+
/**
|
|
275
|
+
* Called before the `provideHover` hook. Use this if you need to prepare any of the in-memory objects before the `provideHover` gets called
|
|
276
|
+
*/
|
|
277
|
+
beforeProvideHover?(event: BeforeProvideHoverEvent): any;
|
|
278
|
+
/**
|
|
279
|
+
* Called when bsc looks for hover information. Use this if your plugin wants to contribute hover information.
|
|
280
|
+
*/
|
|
281
|
+
provideHover?(event: ProvideHoverEvent): any;
|
|
282
|
+
/**
|
|
283
|
+
* Called after the `provideHover` hook. Use this if you want to intercept or sanitize the hover data (even from other plugins) before it gets sent to the client.
|
|
284
|
+
*/
|
|
285
|
+
afterProvideHover?(event: AfterProvideHoverEvent): any;
|
|
286
|
+
/**
|
|
287
|
+
* Called after a scope was created
|
|
288
|
+
*/
|
|
289
|
+
beforeProvideScope?(event: BeforeProvideScopeEvent): any;
|
|
290
|
+
provideScope?(event: ProvideScopeEvent): any;
|
|
291
|
+
afterProvideScope?(event: AfterProvideScopeEvent): any;
|
|
292
|
+
beforeRemoveScope?(event: BeforeRemoveProgramEvent): any;
|
|
293
|
+
removeScope?(event: RemoveScopeEvent): any;
|
|
294
|
+
afterRemoveScope?(event: AfterRemoveScopeEvent): any;
|
|
295
|
+
/**
|
|
296
|
+
* Called before the `provideDefinition` hook
|
|
297
|
+
*/
|
|
298
|
+
beforeProvideDefinition?(event: BeforeProvideDefinitionEvent): any;
|
|
299
|
+
/**
|
|
300
|
+
* Provide one or more `Location`s where the symbol at the given position was originally defined
|
|
301
|
+
* @param event
|
|
302
|
+
*/
|
|
303
|
+
provideDefinition?(event: ProvideDefinitionEvent): any;
|
|
304
|
+
/**
|
|
305
|
+
* Called after `provideDefinition`. Use this if you want to intercept or sanitize the definition data provided by bsc or other plugins
|
|
306
|
+
* @param event
|
|
307
|
+
*/
|
|
308
|
+
afterProvideDefinition?(event: AfterProvideDefinitionEvent): any;
|
|
309
|
+
/**
|
|
310
|
+
* Called before the `provideReferences` hook
|
|
311
|
+
*/
|
|
312
|
+
beforeProvideReferences?(event: BeforeProvideReferencesEvent): any;
|
|
313
|
+
/**
|
|
314
|
+
* Provide all of the `Location`s where the symbol at the given position is located
|
|
315
|
+
* @param event
|
|
316
|
+
*/
|
|
317
|
+
provideReferences?(event: ProvideReferencesEvent): any;
|
|
318
|
+
/**
|
|
319
|
+
* Called after `provideReferences`. Use this if you want to intercept or sanitize the references data provided by bsc or other plugins
|
|
320
|
+
* @param event
|
|
321
|
+
*/
|
|
322
|
+
afterProvideReferences?(event: AfterProvideReferencesEvent): any;
|
|
323
|
+
/**
|
|
324
|
+
* Called before the `provideDocumentSymbols` hook
|
|
325
|
+
*/
|
|
326
|
+
beforeProvideDocumentSymbols?(event: BeforeProvideDocumentSymbolsEvent): any;
|
|
327
|
+
/**
|
|
328
|
+
* Provide all of the `DocumentSymbol`s for the given file
|
|
329
|
+
* @param event
|
|
330
|
+
*/
|
|
331
|
+
provideDocumentSymbols?(event: ProvideDocumentSymbolsEvent): any;
|
|
332
|
+
/**
|
|
333
|
+
* Called after `provideDocumentSymbols`. Use this if you want to intercept or sanitize the document symbols data provided by bsc or other plugins
|
|
334
|
+
* @param event
|
|
335
|
+
*/
|
|
336
|
+
afterProvideDocumentSymbols?(event: AfterProvideDocumentSymbolsEvent): any;
|
|
337
|
+
/**
|
|
338
|
+
* Called before the `provideWorkspaceSymbols` hook
|
|
339
|
+
*/
|
|
340
|
+
beforeProvideWorkspaceSymbols?(event: BeforeProvideWorkspaceSymbolsEvent): any;
|
|
341
|
+
/**
|
|
342
|
+
* Provide all of the workspace symbols for the entire project
|
|
343
|
+
* @param event
|
|
344
|
+
*/
|
|
345
|
+
provideWorkspaceSymbols?(event: ProvideWorkspaceSymbolsEvent): any;
|
|
346
|
+
/**
|
|
347
|
+
* Called after `provideWorkspaceSymbols`. Use this if you want to intercept or sanitize the workspace symbols data provided by bsc or other plugins
|
|
348
|
+
* @param event
|
|
349
|
+
*/
|
|
350
|
+
afterProvideWorkspaceSymbols?(event: AfterProvideWorkspaceSymbolsEvent): any;
|
|
351
|
+
beforeValidateScope?(event: BeforeValidateScopeEvent): any;
|
|
352
|
+
validateScope?(event: ValidateScopeEvent): any;
|
|
353
|
+
afterValidateScope?(event: AfterValidateScopeEvent): any;
|
|
354
|
+
beforeProvideCodeActions?(event: BeforeProvideCodeActionsEvent): any;
|
|
355
|
+
provideCodeActions?(event: ProvideCodeActionsEvent): any;
|
|
356
|
+
afterProvideCodeActions?(event: AfterProvideCodeActionsEvent): any;
|
|
357
|
+
beforeProvideSemanticTokens?(event: BeforeProvideSemanticTokensEvent): any;
|
|
358
|
+
provideSemanticTokens?(event: ProvideSemanticTokensEvent): any;
|
|
359
|
+
afterProvideSemanticTokens?(event: AfterProvideSemanticTokensEvent): any;
|
|
360
|
+
/**
|
|
361
|
+
* Called before plugins are asked to provide files to the program. (excludes virtual files produced by `provideFile` events).
|
|
362
|
+
* Call the `setFileData()` method to override the file contents.
|
|
363
|
+
*/
|
|
364
|
+
beforeProvideFile?(event: BeforeProvideFileEvent): any;
|
|
365
|
+
/**
|
|
366
|
+
* Give plugins the opportunity to handle processing a file. (excludes virtual files produced by `provideFile` events)
|
|
367
|
+
*/
|
|
368
|
+
provideFile?(event: ProvideFileEvent): any;
|
|
369
|
+
/**
|
|
370
|
+
* Called after a file was added to the program. (excludes virtual files produced by `provideFile` events)
|
|
371
|
+
*/
|
|
372
|
+
afterProvideFile?(event: AfterProvideFileEvent): any;
|
|
373
|
+
/**
|
|
374
|
+
* Called before a file is added to the program.
|
|
375
|
+
* Includes physical files as well as any virtual files produced by `provideFile` events
|
|
376
|
+
*/
|
|
377
|
+
beforeAddFile?(event: BeforeAddFileEvent): any;
|
|
378
|
+
/**
|
|
379
|
+
* Called after a file has been added to the program.
|
|
380
|
+
* Includes physical files as well as any virtual files produced by `provideFile` events
|
|
381
|
+
*/
|
|
382
|
+
afterAddFile?(event: AfterAddFileEvent): any;
|
|
383
|
+
/**
|
|
384
|
+
* Called before a file is removed from the program. This includes physical and virtual files
|
|
385
|
+
*/
|
|
386
|
+
beforeRemoveFile?(event: BeforeRemoveFileEvent): any;
|
|
387
|
+
/**
|
|
388
|
+
* Called after a file has been removed from the program. This includes physical and virtual files
|
|
389
|
+
*/
|
|
390
|
+
afterRemoveFile?(event: AfterRemoveFileEvent): any;
|
|
391
|
+
/**
|
|
392
|
+
* Called before each file is validated
|
|
393
|
+
*/
|
|
394
|
+
beforeValidateFile?(event: BeforeValidateFileEvent): any;
|
|
395
|
+
/**
|
|
396
|
+
* Called during the file validation process. If your plugin contributes file validations, this is a good place to contribute them.
|
|
397
|
+
*/
|
|
398
|
+
validateFile?(event: ValidateFileEvent): any;
|
|
399
|
+
/**
|
|
400
|
+
* Called after each file is validated
|
|
401
|
+
*/
|
|
402
|
+
afterValidateFile?(event: AfterValidateFileEvent): any;
|
|
403
|
+
/**
|
|
404
|
+
* Called right before the program builds (i.e. generates the code and puts it in the outDir
|
|
405
|
+
*/
|
|
406
|
+
beforeBuildProgram?(event: BeforeBuildProgramEvent): any;
|
|
407
|
+
/**
|
|
408
|
+
* Called right after the program builds (i.e. generates the code and puts it in the outDir
|
|
409
|
+
*/
|
|
410
|
+
afterBuildProgram?(event: AfterBuildProgramEvent): any;
|
|
411
|
+
/**
|
|
412
|
+
* Before preparing the file for building
|
|
413
|
+
*/
|
|
414
|
+
beforePrepareFile?(event: BeforePrepareFileEvent): any;
|
|
415
|
+
/**
|
|
416
|
+
* Prepare the file for building
|
|
417
|
+
*/
|
|
418
|
+
prepareFile?(event: PrepareFileEvent): any;
|
|
419
|
+
/**
|
|
420
|
+
* After preparing the file for building
|
|
421
|
+
*/
|
|
422
|
+
afterPrepareFile?(event: AfterPrepareFileEvent): any;
|
|
423
|
+
/**
|
|
424
|
+
* Before the program turns all file objects into their final buffers
|
|
425
|
+
*/
|
|
426
|
+
beforeSerializeProgram?(event: BeforeSerializeProgramEvent): any;
|
|
427
|
+
/**
|
|
428
|
+
* Emitted right at the start of the program turning all file objects into their final buffers
|
|
429
|
+
*/
|
|
430
|
+
serializeProgram?(event: SerializeProgramEvent): any;
|
|
431
|
+
/**
|
|
432
|
+
* After the program turns all file objects into their final buffers
|
|
433
|
+
*/
|
|
434
|
+
afterSerializeProgram?(event: AfterSerializeProgramEvent): any;
|
|
435
|
+
/**
|
|
436
|
+
* Before turning the file into its final contents
|
|
437
|
+
*/
|
|
438
|
+
beforeSerializeFile?(event: BeforeSerializeFileEvent): any;
|
|
439
|
+
/**
|
|
440
|
+
* Turn the file into its final contents (i.e. transpile a bs file, compress a jpeg, etc)
|
|
441
|
+
*/
|
|
442
|
+
serializeFile?(event: SerializeFileEvent): any;
|
|
443
|
+
/**
|
|
444
|
+
* After turning the file into its final contents
|
|
445
|
+
*/
|
|
446
|
+
afterSerializeFile?(event: AfterSerializeFileEvent): any;
|
|
447
|
+
/**
|
|
448
|
+
* Called before any files are written
|
|
449
|
+
*/
|
|
450
|
+
beforeWriteProgram?(event: BeforeWriteProgramEvent): any;
|
|
451
|
+
/**
|
|
452
|
+
* Called after all files are written
|
|
453
|
+
*/
|
|
454
|
+
afterWriteProgram?(event: AfterWriteProgramEvent): any;
|
|
455
|
+
/**
|
|
456
|
+
* Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
|
|
457
|
+
*/
|
|
458
|
+
beforeWriteFile?(event: BeforeWriteFileEvent): any;
|
|
459
|
+
/**
|
|
460
|
+
* Called when a file should be persisted (usually writing to storage). These are raw files that contain the final output. One `File` may produce several of these.
|
|
461
|
+
* When a plugin has handled a file, it should be pushed to the `handledFiles` set so future plugins don't write the file multiple times
|
|
462
|
+
*/
|
|
463
|
+
writeFile?(event: WriteFileEvent): any;
|
|
464
|
+
/**
|
|
465
|
+
* Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
|
|
466
|
+
*/
|
|
467
|
+
afterWriteFile?(event: AfterWriteFileEvent): any;
|
|
186
468
|
}
|
|
187
|
-
export interface
|
|
188
|
-
builder: ProgramBuilder;
|
|
469
|
+
export interface BeforeProvideCodeActionsEvent<TFile extends BscFile = BscFile> {
|
|
189
470
|
program: Program;
|
|
190
|
-
|
|
471
|
+
file: TFile;
|
|
472
|
+
range: Range;
|
|
473
|
+
scopes: Scope[];
|
|
474
|
+
diagnostics: BsDiagnostic[];
|
|
475
|
+
codeActions: CodeAction[];
|
|
191
476
|
}
|
|
192
|
-
export interface
|
|
193
|
-
builder: ProgramBuilder;
|
|
477
|
+
export interface ProvideCodeActionsEvent<TFile extends BscFile = BscFile> {
|
|
194
478
|
program: Program;
|
|
195
|
-
|
|
479
|
+
file: TFile;
|
|
480
|
+
range: Range;
|
|
481
|
+
scopes: Scope[];
|
|
482
|
+
diagnostics: BsDiagnostic[];
|
|
483
|
+
codeActions: CodeAction[];
|
|
196
484
|
}
|
|
197
|
-
export interface
|
|
198
|
-
builder: ProgramBuilder;
|
|
485
|
+
export interface AfterProvideCodeActionsEvent<TFile extends BscFile = BscFile> {
|
|
199
486
|
program: Program;
|
|
200
|
-
|
|
487
|
+
file: TFile;
|
|
488
|
+
range: Range;
|
|
489
|
+
scopes: Scope[];
|
|
490
|
+
diagnostics: BsDiagnostic[];
|
|
491
|
+
codeActions: CodeAction[];
|
|
201
492
|
}
|
|
202
|
-
export interface
|
|
493
|
+
export interface BeforeProvideProgramEvent {
|
|
203
494
|
builder: ProgramBuilder;
|
|
204
|
-
program
|
|
205
|
-
files: FileObj[];
|
|
495
|
+
program?: Program;
|
|
206
496
|
}
|
|
207
|
-
export interface
|
|
497
|
+
export interface ProvideProgramEvent {
|
|
208
498
|
builder: ProgramBuilder;
|
|
209
|
-
program
|
|
499
|
+
program?: Program;
|
|
210
500
|
}
|
|
211
|
-
export interface
|
|
501
|
+
export interface AfterProvideProgramEvent {
|
|
502
|
+
builder: ProgramBuilder;
|
|
212
503
|
program: Program;
|
|
213
504
|
}
|
|
214
|
-
export interface
|
|
505
|
+
export interface BeforeValidateProgramEvent {
|
|
215
506
|
program: Program;
|
|
216
507
|
}
|
|
217
|
-
export
|
|
508
|
+
export declare type ValidateProgramEvent = BeforeValidateProgramEvent;
|
|
509
|
+
export interface AfterValidateProgramEvent extends BeforeValidateProgramEvent {
|
|
510
|
+
/**
|
|
511
|
+
* Was the validation cancelled? Will be false if the validation was completed
|
|
512
|
+
*/
|
|
513
|
+
wasCancelled: boolean;
|
|
514
|
+
}
|
|
515
|
+
export interface ProvideCompletionsEvent<TFile extends BscFile = BscFile> {
|
|
218
516
|
program: Program;
|
|
219
|
-
|
|
517
|
+
file: TFile;
|
|
518
|
+
/**
|
|
519
|
+
* The scopes this file is a member of. If the file is a member of no scopes, this will be an empty array.
|
|
520
|
+
* Plugins can use `event.program.globalScope` if the file is not a member of any scopes
|
|
521
|
+
*/
|
|
522
|
+
scopes: Scope[];
|
|
523
|
+
position: Position;
|
|
524
|
+
completions: CompletionItem[];
|
|
220
525
|
}
|
|
221
|
-
export
|
|
526
|
+
export declare type BeforeProvideCompletionsEvent<TFile extends BscFile = BscFile> = ProvideCompletionsEvent<TFile>;
|
|
527
|
+
export declare type AfterProvideCompletionsEvent<TFile extends BscFile = BscFile> = ProvideCompletionsEvent<TFile>;
|
|
528
|
+
export interface BeforeBuildProgramEvent {
|
|
222
529
|
program: Program;
|
|
223
|
-
|
|
530
|
+
files: BscFile[];
|
|
531
|
+
editor: Editor;
|
|
224
532
|
}
|
|
225
|
-
export
|
|
533
|
+
export declare type AfterBuildProgramEvent = BeforeBuildProgramEvent;
|
|
534
|
+
export interface ProvideHoverEvent {
|
|
226
535
|
program: Program;
|
|
227
536
|
file: BscFile;
|
|
228
|
-
|
|
537
|
+
position: Position;
|
|
229
538
|
scopes: Scope[];
|
|
230
|
-
|
|
231
|
-
|
|
539
|
+
hovers: Hover[];
|
|
540
|
+
}
|
|
541
|
+
export interface Hover {
|
|
542
|
+
/**
|
|
543
|
+
* The contents of the hover, written in markdown. If you want to display code in the hover, use code blocks, like this:
|
|
544
|
+
* ```text
|
|
545
|
+
* ```brighterscript
|
|
546
|
+
* some = "code" + "here"
|
|
547
|
+
* ```
|
|
548
|
+
* ```
|
|
549
|
+
*/
|
|
550
|
+
contents: string | string[];
|
|
551
|
+
/**
|
|
552
|
+
* An optional range
|
|
553
|
+
*/
|
|
554
|
+
range?: Range;
|
|
232
555
|
}
|
|
233
|
-
export
|
|
556
|
+
export declare type BeforeProvideHoverEvent = ProvideHoverEvent;
|
|
557
|
+
export declare type AfterProvideHoverEvent = ProvideHoverEvent;
|
|
558
|
+
export interface BeforeProvideScopeEvent {
|
|
234
559
|
program: Program;
|
|
235
560
|
scope: Scope;
|
|
236
561
|
}
|
|
237
|
-
export interface
|
|
562
|
+
export interface ProvideScopeEvent {
|
|
238
563
|
program: Program;
|
|
239
564
|
scope: Scope;
|
|
240
565
|
}
|
|
241
|
-
export interface
|
|
566
|
+
export interface AfterProvideScopeEvent {
|
|
242
567
|
program: Program;
|
|
243
568
|
scope: Scope;
|
|
244
569
|
}
|
|
245
|
-
export interface
|
|
570
|
+
export interface BeforeRemoveProgramEvent {
|
|
571
|
+
program: Program;
|
|
572
|
+
}
|
|
573
|
+
export interface RemoveScopeEvent {
|
|
246
574
|
program: Program;
|
|
247
575
|
scope: Scope;
|
|
248
576
|
}
|
|
249
|
-
export interface
|
|
577
|
+
export interface AfterRemoveScopeEvent {
|
|
250
578
|
program: Program;
|
|
251
579
|
scope: Scope;
|
|
252
580
|
}
|
|
253
|
-
export interface
|
|
581
|
+
export interface BeforeValidateScopeEvent {
|
|
254
582
|
program: Program;
|
|
255
583
|
scope: Scope;
|
|
256
|
-
file: BscFile;
|
|
257
|
-
range: Range;
|
|
258
|
-
/**
|
|
259
|
-
* A filtered list of diagnostics whose lines touch the lines of the given range
|
|
260
|
-
*/
|
|
261
|
-
diagnostics: BsDiagnostic[];
|
|
262
|
-
codeActions: CodeAction[];
|
|
263
584
|
}
|
|
585
|
+
export declare type AfterValidateScopeEvent = BeforeValidateScopeEvent;
|
|
264
586
|
export interface BeforeFileParseEvent {
|
|
265
587
|
program: Program;
|
|
266
588
|
srcPath: string;
|
|
267
589
|
source: string;
|
|
268
590
|
}
|
|
591
|
+
export interface OnFileParseEvent {
|
|
592
|
+
program: Program;
|
|
593
|
+
srcPath: string;
|
|
594
|
+
source: string;
|
|
595
|
+
}
|
|
269
596
|
export interface AfterFileParseEvent {
|
|
270
597
|
program: Program;
|
|
271
598
|
file: BscFile;
|
|
272
599
|
}
|
|
273
|
-
export interface
|
|
600
|
+
export interface ProvideDefinitionEvent<TFile = BscFile> {
|
|
274
601
|
program: Program;
|
|
275
|
-
|
|
602
|
+
/**
|
|
603
|
+
* The file that the getDefinition request was invoked in
|
|
604
|
+
*/
|
|
605
|
+
file: TFile;
|
|
606
|
+
/**
|
|
607
|
+
* The position in the text document where the getDefinition request was invoked
|
|
608
|
+
*/
|
|
609
|
+
position: Position;
|
|
610
|
+
/**
|
|
611
|
+
* The list of locations for where the item at the file and position was defined
|
|
612
|
+
*/
|
|
613
|
+
definitions: Location[];
|
|
276
614
|
}
|
|
277
|
-
export
|
|
615
|
+
export declare type BeforeProvideDefinitionEvent<TFile = BscFile> = ProvideDefinitionEvent<TFile>;
|
|
616
|
+
export declare type AfterProvideDefinitionEvent<TFile = BscFile> = ProvideDefinitionEvent<TFile>;
|
|
617
|
+
export interface ProvideReferencesEvent<TFile = BscFile> {
|
|
278
618
|
program: Program;
|
|
279
|
-
|
|
619
|
+
/**
|
|
620
|
+
* The file that the getDefinition request was invoked in
|
|
621
|
+
*/
|
|
622
|
+
file: TFile;
|
|
623
|
+
/**
|
|
624
|
+
* The position in the text document where the getDefinition request was invoked
|
|
625
|
+
*/
|
|
626
|
+
position: Position;
|
|
627
|
+
/**
|
|
628
|
+
* The list of locations for where the item at the file and position was defined
|
|
629
|
+
*/
|
|
630
|
+
references: Location[];
|
|
631
|
+
}
|
|
632
|
+
export declare type BeforeProvideReferencesEvent<TFile = BscFile> = ProvideReferencesEvent<TFile>;
|
|
633
|
+
export declare type AfterProvideReferencesEvent<TFile = BscFile> = ProvideReferencesEvent<TFile>;
|
|
634
|
+
export interface ProvideDocumentSymbolsEvent<TFile = BscFile> {
|
|
635
|
+
program: Program;
|
|
636
|
+
/**
|
|
637
|
+
* The file that the `documentSymbol` request was invoked in
|
|
638
|
+
*/
|
|
639
|
+
file: TFile;
|
|
640
|
+
/**
|
|
641
|
+
* The result list of symbols
|
|
642
|
+
*/
|
|
643
|
+
documentSymbols: DocumentSymbol[];
|
|
280
644
|
}
|
|
281
|
-
export
|
|
645
|
+
export declare type BeforeProvideDocumentSymbolsEvent<TFile = BscFile> = ProvideDocumentSymbolsEvent<TFile>;
|
|
646
|
+
export declare type AfterProvideDocumentSymbolsEvent<TFile = BscFile> = ProvideDocumentSymbolsEvent<TFile>;
|
|
647
|
+
export interface ProvideWorkspaceSymbolsEvent {
|
|
648
|
+
program: Program;
|
|
649
|
+
/**
|
|
650
|
+
* The result list of symbols
|
|
651
|
+
*/
|
|
652
|
+
workspaceSymbols: WorkspaceSymbol[];
|
|
653
|
+
}
|
|
654
|
+
export declare type BeforeProvideWorkspaceSymbolsEvent = ProvideWorkspaceSymbolsEvent;
|
|
655
|
+
export declare type AfterProvideWorkspaceSymbolsEvent = ProvideWorkspaceSymbolsEvent;
|
|
656
|
+
export interface BeforeProvideSemanticTokensEvent<T extends BscFile = BscFile> {
|
|
657
|
+
/**
|
|
658
|
+
* The program this file is from
|
|
659
|
+
*/
|
|
282
660
|
program: Program;
|
|
661
|
+
/**
|
|
662
|
+
* The file to get semantic tokens for
|
|
663
|
+
*/
|
|
664
|
+
file: T;
|
|
665
|
+
/**
|
|
666
|
+
* The list of scopes that this file is a member of
|
|
667
|
+
*/
|
|
668
|
+
scopes: Scope[];
|
|
669
|
+
/**
|
|
670
|
+
* The list of semantic tokens being produced during this event.
|
|
671
|
+
*/
|
|
672
|
+
semanticTokens: SemanticToken[];
|
|
673
|
+
}
|
|
674
|
+
export interface ProvideSemanticTokensEvent<T extends BscFile = BscFile> {
|
|
675
|
+
/**
|
|
676
|
+
* The program this file is from
|
|
677
|
+
*/
|
|
678
|
+
program: Program;
|
|
679
|
+
/**
|
|
680
|
+
* The file to get semantic tokens for
|
|
681
|
+
*/
|
|
682
|
+
file: T;
|
|
683
|
+
/**
|
|
684
|
+
* The list of scopes that this file is a member of
|
|
685
|
+
*/
|
|
686
|
+
scopes: Scope[];
|
|
687
|
+
/**
|
|
688
|
+
* The list of semantic tokens being produced during this event.
|
|
689
|
+
*/
|
|
690
|
+
semanticTokens: SemanticToken[];
|
|
691
|
+
}
|
|
692
|
+
export interface AfterProvideSemanticTokensEvent<T extends BscFile = BscFile> {
|
|
693
|
+
/**
|
|
694
|
+
* The program this file is from
|
|
695
|
+
*/
|
|
696
|
+
program: Program;
|
|
697
|
+
/**
|
|
698
|
+
* The file to get semantic tokens for
|
|
699
|
+
*/
|
|
700
|
+
file: T;
|
|
701
|
+
/**
|
|
702
|
+
* The list of scopes that this file is a member of
|
|
703
|
+
*/
|
|
704
|
+
scopes: Scope[];
|
|
705
|
+
/**
|
|
706
|
+
* The list of semantic tokens being produced during this event.
|
|
707
|
+
*/
|
|
708
|
+
semanticTokens: SemanticToken[];
|
|
709
|
+
}
|
|
710
|
+
export declare type BeforeValidateFileEvent = ValidateFileEvent;
|
|
711
|
+
export interface ValidateFileEvent<T extends BscFile = BscFile> {
|
|
712
|
+
program: Program;
|
|
713
|
+
file: T;
|
|
714
|
+
}
|
|
715
|
+
export declare type AfterValidateFileEvent<T extends BscFile = BscFile> = ValidateFileEvent;
|
|
716
|
+
export interface ValidateFileEvent<T extends BscFile = BscFile> {
|
|
717
|
+
program: Program;
|
|
718
|
+
file: T;
|
|
719
|
+
}
|
|
720
|
+
export interface TranspileEntry {
|
|
283
721
|
file: BscFile;
|
|
284
722
|
outputPath: string;
|
|
285
723
|
}
|
|
286
|
-
export interface
|
|
724
|
+
export interface ScopeValidationOptions {
|
|
725
|
+
filesToBeValidatedInScopeContext?: Set<BscFile>;
|
|
726
|
+
changedSymbols?: Map<SymbolTypeFlag, Set<string>>;
|
|
727
|
+
changedFiles?: BscFile[];
|
|
728
|
+
force?: boolean;
|
|
729
|
+
initialValidation?: boolean;
|
|
730
|
+
}
|
|
731
|
+
export interface ValidateScopeEvent {
|
|
287
732
|
program: Program;
|
|
288
|
-
|
|
733
|
+
scope: Scope;
|
|
734
|
+
changedFiles?: BscFile[];
|
|
735
|
+
changedSymbols?: Map<SymbolTypeFlag, Set<string>>;
|
|
736
|
+
}
|
|
737
|
+
export interface AfterFileTranspileEvent<TFile extends BscFile = BscFile> {
|
|
738
|
+
/**
|
|
739
|
+
* The program this event was triggered for
|
|
740
|
+
*/
|
|
741
|
+
program: Program;
|
|
742
|
+
file: TFile;
|
|
289
743
|
outputPath: string;
|
|
744
|
+
/**
|
|
745
|
+
* The resulting transpiled file contents
|
|
746
|
+
*/
|
|
747
|
+
code: string;
|
|
748
|
+
/**
|
|
749
|
+
* The sourceMaps for the generated code (if emitting source maps is enabled)
|
|
750
|
+
*/
|
|
751
|
+
map?: string;
|
|
752
|
+
/**
|
|
753
|
+
* The generated type definition file contents (if emitting type definitions are enabled)
|
|
754
|
+
*/
|
|
755
|
+
typedef?: string;
|
|
290
756
|
}
|
|
291
|
-
export
|
|
757
|
+
export declare type BeforeProvideFileEvent<TFile extends BscFile = BscFile> = ProvideFileEvent<TFile>;
|
|
758
|
+
export interface ProvideFileEvent<TFile extends BscFile = BscFile> {
|
|
759
|
+
/**
|
|
760
|
+
* The lower-case file extension for the srcPath. (i.e. ".brs", ".xml")
|
|
761
|
+
*/
|
|
762
|
+
srcExtension: string;
|
|
763
|
+
/**
|
|
764
|
+
* The srcPath for the file. (i.e. `/user/bob/projects/VideoApp/source/main.bs`)
|
|
765
|
+
*/
|
|
766
|
+
srcPath: string;
|
|
767
|
+
/**
|
|
768
|
+
* The destPath for the file. (i.e. for `/user/bob/projects/VideoApp/source/main.bs`, destPath would be `source/main.bs`)
|
|
769
|
+
*/
|
|
770
|
+
destPath: string;
|
|
771
|
+
/**
|
|
772
|
+
* A lazy-loading container for this file's data. Call `.get()` to lazy load the data, and `.set()` to override file contents
|
|
773
|
+
*/
|
|
774
|
+
data: LazyFileData;
|
|
775
|
+
/**
|
|
776
|
+
* An array of files that should be added to the program as a result of this event
|
|
777
|
+
*/
|
|
778
|
+
files: TFile[];
|
|
779
|
+
/**
|
|
780
|
+
* The program for this event
|
|
781
|
+
*/
|
|
292
782
|
program: Program;
|
|
293
|
-
|
|
783
|
+
/**
|
|
784
|
+
* A factory used to create new instances of the BrighterScript built-in file types. This mitigates the issue
|
|
785
|
+
* of a plugin's version of a File not being the same as the LanguageServer or CLI version of BrighterScript
|
|
786
|
+
* (due to npm installing multiple versions of brighterscript)
|
|
787
|
+
*/
|
|
788
|
+
fileFactory: FileFactory;
|
|
294
789
|
}
|
|
295
|
-
export
|
|
790
|
+
export declare type AfterProvideFileEvent<TFile extends BscFile = BscFile> = ProvideFileEvent<TFile>;
|
|
791
|
+
export interface BeforeAddFileEvent<TFile extends BscFile = BscFile> {
|
|
792
|
+
file: TFile;
|
|
296
793
|
program: Program;
|
|
297
|
-
file: BscFile;
|
|
298
794
|
}
|
|
299
|
-
export
|
|
795
|
+
export declare type AfterAddFileEvent<TFile extends BscFile = BscFile> = BeforeAddFileEvent<TFile>;
|
|
796
|
+
export interface BeforeRemoveFileEvent<TFile extends BscFile = BscFile> {
|
|
797
|
+
file: TFile;
|
|
300
798
|
program: Program;
|
|
301
|
-
|
|
302
|
-
|
|
799
|
+
}
|
|
800
|
+
export declare type AfterRemoveFileEvent<TFile extends BscFile = BscFile> = BeforeRemoveFileEvent<TFile>;
|
|
801
|
+
export declare type BeforePrepareProgramEvent = PrepareProgramEvent;
|
|
802
|
+
/**
|
|
803
|
+
* Event for when the program prepares itself for building
|
|
804
|
+
*/
|
|
805
|
+
export interface PrepareProgramEvent {
|
|
806
|
+
program: Program;
|
|
807
|
+
editor: Editor;
|
|
808
|
+
files: BscFile[];
|
|
809
|
+
}
|
|
810
|
+
export declare type AfterPrepareProgramEvent = PrepareProgramEvent;
|
|
811
|
+
export declare type BeforePrepareFileEvent<TFile extends BscFile = BscFile> = PrepareFileEvent<TFile>;
|
|
812
|
+
/**
|
|
813
|
+
* Prepare the file for building
|
|
814
|
+
*/
|
|
815
|
+
export interface PrepareFileEvent<TFile extends BscFile = BscFile> {
|
|
816
|
+
program: Program;
|
|
817
|
+
file: TFile;
|
|
818
|
+
editor: Editor;
|
|
303
819
|
/**
|
|
304
|
-
* A
|
|
820
|
+
* The scope that was linked for this event. A file may be included in multiple scopes, but we choose the most relevant scope.
|
|
821
|
+
* Plugins may unlink this scope and link another one, but must then reassign this property to that new scope so that other
|
|
822
|
+
* plugins can reference it.
|
|
305
823
|
*/
|
|
306
|
-
|
|
307
|
-
codeActions: CodeAction[];
|
|
824
|
+
scope: Scope;
|
|
308
825
|
}
|
|
309
|
-
export
|
|
826
|
+
export declare type OnPrepareFileEvent<TFile extends BscFile = BscFile> = PrepareFileEvent<TFile>;
|
|
827
|
+
export declare type AfterPrepareFileEvent<TFile extends BscFile = BscFile> = PrepareFileEvent<TFile>;
|
|
828
|
+
/**
|
|
829
|
+
* A container that holds the code, map, and typedef for serialized code files.
|
|
830
|
+
*/
|
|
831
|
+
export interface SerializedCodeFile {
|
|
832
|
+
code?: string;
|
|
833
|
+
map?: string;
|
|
834
|
+
typedef?: string;
|
|
835
|
+
}
|
|
836
|
+
export interface BeforeSerializeProgramEvent {
|
|
837
|
+
program: Program;
|
|
838
|
+
files: BscFile[];
|
|
839
|
+
result: Map<BscFile, SerializedFile[]>;
|
|
840
|
+
}
|
|
841
|
+
export declare type SerializeProgramEvent = BeforeSerializeProgramEvent;
|
|
842
|
+
export declare type AfterSerializeProgramEvent = BeforeSerializeProgramEvent;
|
|
843
|
+
/**
|
|
844
|
+
* During the `SerializeFile` events, this is how plugins will contribute file data for a specific file
|
|
845
|
+
*/
|
|
846
|
+
export interface SerializedFile {
|
|
847
|
+
/**
|
|
848
|
+
* The raw data for this file (i.e. a binary buffer for a .jpeg file, or the transpiled code for a .bs file)
|
|
849
|
+
*/
|
|
850
|
+
data: Buffer;
|
|
851
|
+
/**
|
|
852
|
+
* The pkgPath for this chunk of data.
|
|
853
|
+
*/
|
|
854
|
+
pkgPath: string;
|
|
855
|
+
}
|
|
856
|
+
export declare type BeforeSerializeFileEvent<TFile extends BscFile = BscFile> = SerializeFileEvent<TFile>;
|
|
857
|
+
export interface SerializeFileEvent<TFile extends BscFile = BscFile> {
|
|
858
|
+
program: Program;
|
|
859
|
+
file: TFile;
|
|
860
|
+
/**
|
|
861
|
+
* The scope that was linked for this event. A file may be included in multiple scopes, but we choose the most relevant scope.
|
|
862
|
+
* Plugins may unlink this scope and link another one, but must then reassign this property to that new scope so that other
|
|
863
|
+
* plugins can reference it.
|
|
864
|
+
*/
|
|
865
|
+
scope: Scope;
|
|
866
|
+
/**
|
|
867
|
+
* The list of all files created across all the `SerializeFile` events.
|
|
868
|
+
* The key is the pkgPath of the file, and the
|
|
869
|
+
*/
|
|
870
|
+
result: Map<TFile, SerializedFile[]>;
|
|
871
|
+
}
|
|
872
|
+
export declare type AfterSerializeFileEvent<TFile extends BscFile = BscFile> = SerializeFileEvent<TFile>;
|
|
873
|
+
export interface BeforeWriteProgramEvent {
|
|
874
|
+
program: Program;
|
|
875
|
+
outDir: string;
|
|
876
|
+
files: Map<BscFile, SerializedFile[]>;
|
|
877
|
+
}
|
|
878
|
+
export declare type AfterWriteProgramEvent = BeforeWriteProgramEvent;
|
|
879
|
+
export declare type BeforeWriteFileEvent = WriteFileEvent;
|
|
880
|
+
export interface WriteFileEvent {
|
|
881
|
+
program: Program;
|
|
882
|
+
file: SerializedFile;
|
|
883
|
+
/**
|
|
884
|
+
* The full path to where the file was (or will be) written to.
|
|
885
|
+
*/
|
|
886
|
+
outputPath: string;
|
|
887
|
+
/**
|
|
888
|
+
* A set of all files that have been properly written. Plugins should add any handled files to this list so future plugins don't write then again
|
|
889
|
+
*/
|
|
890
|
+
processedFiles: Set<SerializedFile>;
|
|
891
|
+
}
|
|
892
|
+
export declare type AfterWriteFileEvent = BeforeWriteFileEvent;
|
|
893
|
+
export interface TranspileObj {
|
|
310
894
|
file: BscFile;
|
|
895
|
+
/**
|
|
896
|
+
* The absolute path to where the file should be written during build. (i.e. somewhere inside the outDir)
|
|
897
|
+
*/
|
|
311
898
|
outputPath: string;
|
|
312
899
|
}
|
|
313
|
-
export interface
|
|
900
|
+
export interface BeforeFileDisposeEvent {
|
|
314
901
|
program: Program;
|
|
315
902
|
file: BscFile;
|
|
316
|
-
|
|
317
|
-
|
|
903
|
+
}
|
|
904
|
+
export declare type AfterFileDisposeEvent = BeforeFileDisposeEvent;
|
|
905
|
+
export interface BeforeRemoveProgramEvent {
|
|
906
|
+
program: Program;
|
|
907
|
+
}
|
|
908
|
+
export interface RemoveProgramEvent {
|
|
909
|
+
program: Program;
|
|
910
|
+
}
|
|
911
|
+
export interface AfterRemoveProgramEvent {
|
|
912
|
+
program: Program;
|
|
318
913
|
}
|
|
319
914
|
export interface SemanticToken {
|
|
320
915
|
range: Range;
|
|
@@ -325,16 +920,238 @@ export interface SemanticToken {
|
|
|
325
920
|
tokenModifiers?: SemanticTokenModifiers[];
|
|
326
921
|
}
|
|
327
922
|
export interface TypedefProvider {
|
|
328
|
-
getTypedef(state: TranspileState):
|
|
923
|
+
getTypedef(state: TranspileState): TranspileResult;
|
|
329
924
|
}
|
|
330
|
-
export declare type TranspileResult = Array<(string | SourceNode)>;
|
|
925
|
+
export declare type TranspileResult = Array<(string | SourceNode | TranspileResult)>;
|
|
331
926
|
/**
|
|
332
|
-
*
|
|
927
|
+
* This is the type that the SourceNode class is declared as taking in its constructor.
|
|
928
|
+
* The actual type that SourceNode accepts is the more permissive TranspileResult, but
|
|
929
|
+
* we need to use this declared type for some type casts.
|
|
333
930
|
*/
|
|
334
|
-
export declare type
|
|
931
|
+
export declare type FlattenedTranspileResult = Array<string | SourceNode>;
|
|
932
|
+
export declare type FileResolver = (srcPath: string) => string | Buffer | undefined | Thenable<string | Buffer | undefined> | void;
|
|
335
933
|
export interface ExpressionInfo {
|
|
336
934
|
expressions: Expression[];
|
|
337
935
|
varExpressions: Expression[];
|
|
338
936
|
uniqueVarNames: string[];
|
|
339
937
|
}
|
|
340
938
|
export declare type DiagnosticCode = number | string;
|
|
939
|
+
export interface FileLink<T> {
|
|
940
|
+
item: T;
|
|
941
|
+
file: BrsFile;
|
|
942
|
+
}
|
|
943
|
+
export interface ExtraSymbolData {
|
|
944
|
+
/**
|
|
945
|
+
* What AST node defined this symbol?
|
|
946
|
+
*/
|
|
947
|
+
definingNode?: AstNode;
|
|
948
|
+
/**
|
|
949
|
+
* Description of this symbol
|
|
950
|
+
*/
|
|
951
|
+
description?: string;
|
|
952
|
+
/**
|
|
953
|
+
* the higher the number, the lower the priority
|
|
954
|
+
*/
|
|
955
|
+
completionPriority?: number;
|
|
956
|
+
/**
|
|
957
|
+
* Flags for this symbol
|
|
958
|
+
*/
|
|
959
|
+
flags?: SymbolTypeFlag;
|
|
960
|
+
/**
|
|
961
|
+
* this symbol comes from an ancestor symbol table
|
|
962
|
+
*/
|
|
963
|
+
memberOfAncestor?: boolean;
|
|
964
|
+
/**
|
|
965
|
+
* Do not merge this symbol when merging symbol tables
|
|
966
|
+
*/
|
|
967
|
+
doNotMerge?: boolean;
|
|
968
|
+
/**
|
|
969
|
+
* is this symbol an alias?
|
|
970
|
+
*/
|
|
971
|
+
isAlias?: boolean;
|
|
972
|
+
/**
|
|
973
|
+
* Is this symbol an instance of the type.
|
|
974
|
+
*
|
|
975
|
+
* `true` means `true`, and `false` or `undefined` means `false`,
|
|
976
|
+
*
|
|
977
|
+
* so check for `=== true` or `!== true`
|
|
978
|
+
*/
|
|
979
|
+
isInstance?: boolean;
|
|
980
|
+
/**
|
|
981
|
+
* Is this type as defined in a doc comment?
|
|
982
|
+
*/
|
|
983
|
+
isFromDocComment?: boolean;
|
|
984
|
+
/**
|
|
985
|
+
* Is this symbol built in to Brightscript?
|
|
986
|
+
*/
|
|
987
|
+
isBuiltIn?: boolean;
|
|
988
|
+
/**
|
|
989
|
+
* Was this a result of a callfunc?
|
|
990
|
+
*/
|
|
991
|
+
isFromCallFunc?: boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Is this type created from a type statement - eg. is it a nickname for another type?
|
|
994
|
+
*/
|
|
995
|
+
isFromTypeStatement?: boolean;
|
|
996
|
+
}
|
|
997
|
+
export interface GetTypeOptions {
|
|
998
|
+
flags: SymbolTypeFlag;
|
|
999
|
+
typeChain?: TypeChainEntry[];
|
|
1000
|
+
data?: ExtraSymbolData;
|
|
1001
|
+
/**
|
|
1002
|
+
* get the type of this expression, NOT its return type
|
|
1003
|
+
*/
|
|
1004
|
+
ignoreCall?: boolean;
|
|
1005
|
+
onlyCacheResolvedTypes?: boolean;
|
|
1006
|
+
ignoreCacheForRetrieval?: boolean;
|
|
1007
|
+
isExistenceTest?: boolean;
|
|
1008
|
+
preferDocType?: boolean;
|
|
1009
|
+
/**
|
|
1010
|
+
* For narrowing the type, which statement are we concerned with in the current block?
|
|
1011
|
+
*/
|
|
1012
|
+
statementIndex?: number | 'end';
|
|
1013
|
+
ignoreParentTables?: boolean;
|
|
1014
|
+
/**
|
|
1015
|
+
* If this is true, AA's, objects, nodes, etc, do not return dynamic if no member is found
|
|
1016
|
+
*/
|
|
1017
|
+
ignoreDefaultDynamicMembers?: boolean;
|
|
1018
|
+
}
|
|
1019
|
+
export declare class TypeChainEntry {
|
|
1020
|
+
constructor(options: {
|
|
1021
|
+
name: string;
|
|
1022
|
+
type: BscType;
|
|
1023
|
+
data: ExtraSymbolData;
|
|
1024
|
+
location?: Location;
|
|
1025
|
+
separatorToken?: Token;
|
|
1026
|
+
astNode: AstNode;
|
|
1027
|
+
});
|
|
1028
|
+
get location(): Location;
|
|
1029
|
+
readonly name: string;
|
|
1030
|
+
readonly type: BscType;
|
|
1031
|
+
readonly data: ExtraSymbolData;
|
|
1032
|
+
private readonly _location;
|
|
1033
|
+
readonly separatorToken: Token;
|
|
1034
|
+
isResolved: boolean;
|
|
1035
|
+
astNode: AstNode;
|
|
1036
|
+
}
|
|
1037
|
+
export interface TypeChainProcessResult {
|
|
1038
|
+
/**
|
|
1039
|
+
* The name of the last item in the chain, OR the first unresolved item in the chain
|
|
1040
|
+
*/
|
|
1041
|
+
itemName: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* The TypeKind of the item of `itemName`
|
|
1044
|
+
*/
|
|
1045
|
+
itemTypeKind: BscTypeKind | string;
|
|
1046
|
+
/**
|
|
1047
|
+
* The name of the parent of the item of `itemName`
|
|
1048
|
+
*/
|
|
1049
|
+
itemParentTypeName: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* The TypeKind of the parent of the item of `itemName`
|
|
1052
|
+
*/
|
|
1053
|
+
itemParentTypeKind: BscTypeKind | string;
|
|
1054
|
+
/**
|
|
1055
|
+
* The complete chain leading up to the item of `itemName`
|
|
1056
|
+
*/
|
|
1057
|
+
fullNameOfItem: string;
|
|
1058
|
+
/**
|
|
1059
|
+
* The complete chain (even including unresolved items)
|
|
1060
|
+
*/
|
|
1061
|
+
fullChainName: string;
|
|
1062
|
+
/**
|
|
1063
|
+
* the range of the first unresolved item
|
|
1064
|
+
*/
|
|
1065
|
+
location: Location;
|
|
1066
|
+
/**
|
|
1067
|
+
* Does the chain contain a dynamic type?
|
|
1068
|
+
*/
|
|
1069
|
+
containsDynamic: boolean;
|
|
1070
|
+
/**
|
|
1071
|
+
* The AstNode of the item
|
|
1072
|
+
*/
|
|
1073
|
+
astNode: AstNode;
|
|
1074
|
+
/**
|
|
1075
|
+
* Does the chain contain a type that crossed a callFunc boundary?
|
|
1076
|
+
*/
|
|
1077
|
+
crossedCallFunc: boolean;
|
|
1078
|
+
}
|
|
1079
|
+
export interface TypeCircularReferenceInfo {
|
|
1080
|
+
isCircularReference: boolean;
|
|
1081
|
+
referenceChainNames?: string[];
|
|
1082
|
+
}
|
|
1083
|
+
export interface TypeCompatibilityData {
|
|
1084
|
+
missingFields?: {
|
|
1085
|
+
name: string;
|
|
1086
|
+
expectedType: BscType;
|
|
1087
|
+
}[];
|
|
1088
|
+
fieldMismatches?: {
|
|
1089
|
+
name: string;
|
|
1090
|
+
expectedType: BscType;
|
|
1091
|
+
actualType: BscType;
|
|
1092
|
+
}[];
|
|
1093
|
+
parameterMismatches?: {
|
|
1094
|
+
index: number;
|
|
1095
|
+
expectedOptional?: boolean;
|
|
1096
|
+
actualOptional?: boolean;
|
|
1097
|
+
data: TypeCompatibilityData;
|
|
1098
|
+
}[];
|
|
1099
|
+
returnTypeMismatch?: TypeCompatibilityData;
|
|
1100
|
+
expectedParamCount?: number;
|
|
1101
|
+
actualParamCount?: number;
|
|
1102
|
+
expectedVariadic?: boolean;
|
|
1103
|
+
actualVariadic?: boolean;
|
|
1104
|
+
depth?: number;
|
|
1105
|
+
actualType?: BscType;
|
|
1106
|
+
expectedType?: BscType;
|
|
1107
|
+
allowNameEquality?: boolean;
|
|
1108
|
+
unresolveableTarget?: string;
|
|
1109
|
+
}
|
|
1110
|
+
export interface NamespaceContainer {
|
|
1111
|
+
file: BscFile;
|
|
1112
|
+
fullName: string;
|
|
1113
|
+
fullNameLower: string;
|
|
1114
|
+
parentNameLower: string;
|
|
1115
|
+
nameParts: Identifier[];
|
|
1116
|
+
nameRange: Range;
|
|
1117
|
+
lastPartName: string;
|
|
1118
|
+
lastPartNameLower: string;
|
|
1119
|
+
isTopLevel: boolean;
|
|
1120
|
+
namespaceStatements?: NamespaceStatement[];
|
|
1121
|
+
symbolTable: SymbolTable;
|
|
1122
|
+
}
|
|
1123
|
+
export interface ScopeNamespaceContainer {
|
|
1124
|
+
namespaceContainers: NamespaceContainer[];
|
|
1125
|
+
symbolTable: SymbolTable;
|
|
1126
|
+
firstInstance: NamespaceContainer;
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Use Writable<T> to remove readonly flag from properties in T
|
|
1130
|
+
* Be careful!
|
|
1131
|
+
*/
|
|
1132
|
+
export declare type Writeable<T> = {
|
|
1133
|
+
-readonly [P in keyof T]: T[P];
|
|
1134
|
+
};
|
|
1135
|
+
export declare type DeepWriteable<T> = {
|
|
1136
|
+
-readonly [P in keyof T]: DeepWriteable<T[P]>;
|
|
1137
|
+
};
|
|
1138
|
+
export declare type DisposableLike = Disposable | (() => any);
|
|
1139
|
+
export declare type MaybePromise<T> = T | Promise<T>;
|
|
1140
|
+
export interface FileChange {
|
|
1141
|
+
/**
|
|
1142
|
+
* Absolute path to the source file
|
|
1143
|
+
*/
|
|
1144
|
+
srcPath: string;
|
|
1145
|
+
/**
|
|
1146
|
+
* What type of change was this.
|
|
1147
|
+
*/
|
|
1148
|
+
type: FileChangeType;
|
|
1149
|
+
/**
|
|
1150
|
+
* If provided, this is the new contents of the file. If not provided, the file will be read from disk
|
|
1151
|
+
*/
|
|
1152
|
+
fileContents?: string;
|
|
1153
|
+
/**
|
|
1154
|
+
* If true, this file change can have a project created exclusively for it, it no other projects handled it
|
|
1155
|
+
*/
|
|
1156
|
+
allowStandaloneProject?: boolean;
|
|
1157
|
+
}
|