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/util.d.ts
CHANGED
|
@@ -1,33 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { Diagnostic, Position } from 'vscode-languageserver';
|
|
4
|
+
import { Range, Location } from 'vscode-languageserver';
|
|
5
|
+
import type { BsConfig, FinalizedBsConfig } from './BsConfig';
|
|
6
|
+
import type { CallableContainer, BsDiagnostic, FileReference, CallableContainerMap, Plugin, ExpressionInfo, TranspileResult, MaybePromise, DisposableLike, GetTypeOptions, TypeChainProcessResult, TypeCircularReferenceInfo } from './interfaces';
|
|
7
|
+
import { TypeChainEntry } from './interfaces';
|
|
5
8
|
import { BooleanType } from './types/BooleanType';
|
|
6
9
|
import { DoubleType } from './types/DoubleType';
|
|
7
10
|
import { DynamicType } from './types/DynamicType';
|
|
8
11
|
import { FloatType } from './types/FloatType';
|
|
9
|
-
import { FunctionType } from './types/FunctionType';
|
|
10
12
|
import { IntegerType } from './types/IntegerType';
|
|
11
|
-
import { InvalidType } from './types/InvalidType';
|
|
12
13
|
import { LongIntegerType } from './types/LongIntegerType';
|
|
13
14
|
import { ObjectType } from './types/ObjectType';
|
|
14
15
|
import { StringType } from './types/StringType';
|
|
15
16
|
import { VoidType } from './types/VoidType';
|
|
16
|
-
import
|
|
17
|
-
import type {
|
|
18
|
-
import {
|
|
17
|
+
import { ParseMode } from './parser/Parser';
|
|
18
|
+
import type { CallExpression, CallfuncExpression, DottedGetExpression, VariableExpression } from './parser/Expression';
|
|
19
|
+
import { type Identifier, type Token } from './lexer/Token';
|
|
19
20
|
import { SourceNode } from 'source-map';
|
|
20
|
-
import {
|
|
21
|
+
import type { BrsFile } from './files/BrsFile';
|
|
22
|
+
import type { XmlFile } from './files/XmlFile';
|
|
23
|
+
import type { AstNode, Expression, Statement } from './parser/AstNode';
|
|
24
|
+
import type { UnresolvedSymbol } from './AstValidationSegmenter';
|
|
25
|
+
import type { GetSymbolTypeOptions, SymbolTable } from './SymbolTable';
|
|
26
|
+
import { SymbolTypeFlag } from './SymbolTypeFlag';
|
|
27
|
+
import type { BscType } from './types/BscType';
|
|
28
|
+
import { UnionType } from './types/UnionType';
|
|
29
|
+
import { FunctionType } from './types/FunctionType';
|
|
30
|
+
import type { NamespaceStatement } from './parser/Statement';
|
|
31
|
+
import type { BscFile } from './files/BscFile';
|
|
32
|
+
import { InvalidType } from './types/InvalidType';
|
|
33
|
+
import { IntersectionType } from './types/IntersectionType';
|
|
21
34
|
export declare class Util {
|
|
22
35
|
clearConsole(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Get the version of brighterscript
|
|
38
|
+
*/
|
|
39
|
+
getBrighterScriptVersion(): any;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the number of parent directories in the filPath
|
|
42
|
+
*/
|
|
43
|
+
getParentDirectoryCount(filePath: string | undefined): number;
|
|
23
44
|
/**
|
|
24
45
|
* Determine if the file exists
|
|
25
|
-
* @param filePath
|
|
26
46
|
*/
|
|
27
47
|
pathExists(filePath: string | undefined): Promise<boolean>;
|
|
28
48
|
/**
|
|
29
49
|
* Determine if the file exists
|
|
30
|
-
* @param filePath
|
|
31
50
|
*/
|
|
32
51
|
pathExistsSync(filePath: string | undefined): boolean;
|
|
33
52
|
/**
|
|
@@ -35,170 +54,157 @@ export declare class Util {
|
|
|
35
54
|
*/
|
|
36
55
|
isDirectorySync(dirPath: string | undefined): boolean;
|
|
37
56
|
/**
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Determine if the given path starts with a protocol
|
|
57
|
+
* Read a file from disk. If a failure occurrs, simply return undefined
|
|
58
|
+
* @param filePath path to the file
|
|
59
|
+
* @returns the string contents, or undefined if the file doesn't exist
|
|
43
60
|
*/
|
|
44
|
-
|
|
61
|
+
readFileSync(filePath: string): Buffer | undefined;
|
|
45
62
|
/**
|
|
46
|
-
* Given a path
|
|
47
|
-
* @param filePath
|
|
63
|
+
* Given a pkg path of any kind, transform it to a roku-specific pkg path (i.e. "pkg:/some/path.brs")
|
|
48
64
|
*/
|
|
49
|
-
|
|
65
|
+
sanitizePkgPath(pkgPath: string): string;
|
|
50
66
|
/**
|
|
51
67
|
* Find the path to the config file.
|
|
52
68
|
* If the config file path doesn't exist
|
|
53
|
-
* @param
|
|
69
|
+
* @param cwd the current working directory where the search for configs should begin
|
|
54
70
|
*/
|
|
55
71
|
getConfigFilePath(cwd?: string): string;
|
|
56
72
|
getRangeFromOffsetLength(text: string, offset: number, length: number): Range;
|
|
57
73
|
/**
|
|
58
74
|
* Load the contents of a config file.
|
|
59
75
|
* If the file extends another config, this will load the base config as well.
|
|
60
|
-
* @param configFilePath
|
|
61
|
-
* @param parentProjectPaths
|
|
76
|
+
* @param configFilePath the relative or absolute path to a brighterscript config json file
|
|
77
|
+
* @param parentProjectPaths a list of parent config files. This is used by this method to recursively build the config list
|
|
62
78
|
*/
|
|
63
|
-
loadConfigFile(configFilePath: string, parentProjectPaths?: string[], cwd?: string): BsConfig;
|
|
79
|
+
loadConfigFile(configFilePath: string | undefined, parentProjectPaths?: string[], cwd?: string): BsConfig | undefined;
|
|
64
80
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @param config
|
|
68
|
-
* @param
|
|
81
|
+
* Convert relative paths to absolute paths, relative to the given directory. Also de-dupes the paths. Modifies the array in-place
|
|
82
|
+
* @param collection usually a bsconfig.
|
|
83
|
+
* @param key a key of the config to read paths from (usually this is `'plugins'` or `'require'`)
|
|
84
|
+
* @param relativeDir the path to the folder where the paths should be resolved relative to. This should be an absolute path
|
|
69
85
|
*/
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Do work within the scope of a changed current working directory
|
|
73
|
-
* @param targetCwd
|
|
74
|
-
* @param callback
|
|
75
|
-
*/
|
|
76
|
-
cwdWork<T>(targetCwd: string | null | undefined, callback: () => T): T;
|
|
86
|
+
resolvePathsRelativeTo(collection: any, key: string, relativeDir: string): void;
|
|
77
87
|
/**
|
|
78
88
|
* Given a BsConfig object, start with defaults,
|
|
79
89
|
* merge with bsconfig.json and the provided options.
|
|
80
|
-
* @param config
|
|
90
|
+
* @param config a bsconfig object to use as the baseline for the resulting config
|
|
81
91
|
*/
|
|
82
|
-
normalizeAndResolveConfig(config: BsConfig):
|
|
92
|
+
normalizeAndResolveConfig(config: BsConfig | undefined): FinalizedBsConfig;
|
|
83
93
|
/**
|
|
84
94
|
* Set defaults for any missing items
|
|
85
|
-
* @param config
|
|
95
|
+
* @param config a bsconfig object to use as the baseline for the resulting config
|
|
86
96
|
*/
|
|
87
|
-
normalizeConfig(config: BsConfig):
|
|
97
|
+
normalizeConfig(config: BsConfig | undefined): FinalizedBsConfig;
|
|
88
98
|
/**
|
|
89
99
|
* Get the root directory from options.
|
|
90
100
|
* Falls back to options.cwd.
|
|
91
101
|
* Falls back to process.cwd
|
|
92
|
-
* @param options
|
|
102
|
+
* @param options a bsconfig object
|
|
93
103
|
*/
|
|
94
104
|
getRootDir(options: BsConfig): string;
|
|
95
|
-
/**
|
|
96
|
-
* Format a string with placeholders replaced by argument indexes
|
|
97
|
-
* @param subject
|
|
98
|
-
* @param params
|
|
99
|
-
*/
|
|
100
|
-
stringFormat(subject: string, ...args: any[]): string;
|
|
101
105
|
/**
|
|
102
106
|
* Given a list of callables as a dictionary indexed by their full name (namespace included, transpiled to underscore-separated.
|
|
103
|
-
* @param callables
|
|
104
107
|
*/
|
|
105
108
|
getCallableContainersByLowerName(callables: CallableContainer[]): CallableContainerMap;
|
|
106
109
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*/
|
|
110
|
-
getLines(text: string): string[];
|
|
111
|
-
/**
|
|
112
|
-
* Compute the pkg path for the target relative to the source file's location
|
|
113
|
-
* @param sourcePkgPath The pkgPath of the file that contains the target path
|
|
114
|
-
* @param targetPath a full pkgPath, or a path relative to the containing file
|
|
110
|
+
* Given an absolute path to a source file, and a target path,
|
|
111
|
+
* compute the pkg path for the target relative to the source file's location
|
|
115
112
|
*/
|
|
116
|
-
getPkgPathFromTarget(
|
|
113
|
+
getPkgPathFromTarget(containingFilePathAbsolute: string, targetPath: string): string;
|
|
117
114
|
/**
|
|
118
115
|
* Compute the relative path from the source file to the target file
|
|
119
|
-
* @param
|
|
120
|
-
* @param
|
|
116
|
+
* @param pkgSrcPath - the absolute path to the source, where cwd is the package location
|
|
117
|
+
* @param pkgTargetPath - the absolute path to the target, where cwd is the package location
|
|
121
118
|
*/
|
|
122
|
-
getRelativePath(
|
|
119
|
+
getRelativePath(pkgSrcPath: string, pkgTargetPath: string): string;
|
|
120
|
+
getImportPackagePath(srcPath: string, pkgTargetPath: string): string;
|
|
123
121
|
/**
|
|
124
122
|
* Walks left in a DottedGetExpression and returns a VariableExpression if found, or undefined if not found
|
|
125
123
|
*/
|
|
126
124
|
findBeginningVariableExpression(dottedGet: DottedGetExpression): VariableExpression | undefined;
|
|
127
125
|
/**
|
|
128
|
-
*
|
|
126
|
+
* Do `a` and `b` overlap by at least one character. This returns false if they are at the edges. Here's some examples:
|
|
127
|
+
* ```
|
|
128
|
+
* | true | true | true | true | true | false | false | false | false |
|
|
129
|
+
* |------|------|------|------|------|-------|-------|-------|-------|
|
|
130
|
+
* | aa | aaa | aaa | aaa | a | aa | aa | a | a |
|
|
131
|
+
* | bbb | bb | bbb | b | bbb | bb | bb | b | a |
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
rangesIntersect(a: Range | undefined, b: Range | undefined): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Do `a` and `b` overlap by at least one character or touch at the edges
|
|
137
|
+
* ```
|
|
138
|
+
* | true | true | true | true | true | true | true | false | false |
|
|
139
|
+
* |------|------|------|------|------|-------|-------|-------|-------|
|
|
140
|
+
* | aa | aaa | aaa | aaa | a | aa | aa | a | a |
|
|
141
|
+
* | bbb | bb | bbb | b | bbb | bb | bb | b | a |
|
|
142
|
+
* ```
|
|
129
143
|
*/
|
|
130
|
-
|
|
144
|
+
rangesIntersectOrTouch(a: Range | undefined, b: Range | undefined): boolean;
|
|
131
145
|
/**
|
|
132
146
|
* Test if `position` is in `range`. If the position is at the edges, will return true.
|
|
133
147
|
* Adapted from core vscode
|
|
134
|
-
* @param range
|
|
135
|
-
* @param position
|
|
136
148
|
*/
|
|
137
|
-
rangeContains(range: Range, position: Position): boolean;
|
|
138
|
-
comparePositionToRange(position: Position, range: Range): 1 | -1 | 0;
|
|
149
|
+
rangeContains(range: Range | undefined, position: Position | undefined): boolean;
|
|
150
|
+
comparePositionToRange(position: Position | undefined, range: Range | undefined): 1 | -1 | 0;
|
|
151
|
+
comparePosition(a: Position | undefined, b: Position): 1 | -1 | 0;
|
|
139
152
|
/**
|
|
140
|
-
*
|
|
141
|
-
* @param text
|
|
153
|
+
* Is the inner range completely enclosed in the outer range
|
|
142
154
|
*/
|
|
143
|
-
|
|
144
|
-
propertyCount(object: Record<string, unknown>): number;
|
|
145
|
-
padLeft(subject: string, totalLength: number, char: string): string;
|
|
155
|
+
isRangeInRange(inner: Range, outer: Range): boolean;
|
|
146
156
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @param
|
|
157
|
+
* Combine all the documentation for a node - uses the AstNode's leadingTrivia property
|
|
158
|
+
* @param node the node to get the documentation for
|
|
159
|
+
* @param options extra options
|
|
160
|
+
* @param options.prettyPrint if true, will format the comment text for markdown
|
|
161
|
+
* @param options.commentTokens out Array of tokens that match the comment lines
|
|
149
162
|
*/
|
|
150
|
-
|
|
163
|
+
getNodeDocumentation(node: AstNode, options?: {
|
|
164
|
+
prettyPrint?: boolean;
|
|
165
|
+
commentTokens?: Token[];
|
|
166
|
+
}): string;
|
|
167
|
+
/**
|
|
168
|
+
* Prefixes a component name so it can be used as type in the symbol table, without polluting available symbols
|
|
169
|
+
*
|
|
170
|
+
* @param sgNodeName the Name of the component
|
|
171
|
+
* @returns the node name, prefixed with `roSGNode`
|
|
172
|
+
*/
|
|
173
|
+
getSgNodeTypeName(sgNodeName: string): string;
|
|
151
174
|
/**
|
|
152
175
|
* Force the drive letter to lower case
|
|
153
|
-
* @param fullPath
|
|
154
176
|
*/
|
|
155
177
|
driveLetterToLower(fullPath: string): string;
|
|
156
178
|
/**
|
|
157
|
-
*
|
|
158
|
-
|
|
179
|
+
* Replace the first instance of `search` in `subject` with `replacement`
|
|
180
|
+
*/
|
|
181
|
+
replaceCaseInsensitive(subject: string, search: string, replacement: string): string;
|
|
182
|
+
/**
|
|
183
|
+
* Does the string appear to be a uri (i.e. does it start with `file:`)
|
|
159
184
|
*/
|
|
160
|
-
|
|
185
|
+
isUriLike(filePath: string): boolean;
|
|
161
186
|
/**
|
|
162
187
|
* Given a file path, convert it to a URI string
|
|
163
|
-
* @param srcPath The absolute path to the source file on disk
|
|
164
188
|
*/
|
|
165
|
-
pathToUri(
|
|
189
|
+
pathToUri(filePath: string): string;
|
|
166
190
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @param options
|
|
191
|
+
* Given a URI, convert that to a regular fs path
|
|
169
192
|
*/
|
|
170
|
-
|
|
193
|
+
uriToPath(uri: string): string;
|
|
171
194
|
/**
|
|
172
195
|
* Get paths to all files on disc that match this project's source list
|
|
173
196
|
*/
|
|
174
|
-
getFilePaths(options:
|
|
197
|
+
getFilePaths(options: FinalizedBsConfig): Promise<import("roku-deploy").StandardizedFileEntry[]>;
|
|
175
198
|
/**
|
|
176
199
|
* Given a path to a brs file, compute the path to a theoretical d.bs file.
|
|
177
|
-
* Only `.brs` files can have
|
|
178
|
-
* @param brsSrcPath The absolute path to the .brs source file on disk
|
|
200
|
+
* Only `.brs` files can have typedef path, so return undefined for everything else
|
|
179
201
|
*/
|
|
180
202
|
getTypedefPath(brsSrcPath: string): string;
|
|
181
|
-
/**
|
|
182
|
-
* Determine whether this diagnostic should be supressed or not, based on brs comment-flags
|
|
183
|
-
* @param diagnostic
|
|
184
|
-
*/
|
|
185
|
-
diagnosticIsSuppressed(diagnostic: BsDiagnostic): boolean;
|
|
186
|
-
/**
|
|
187
|
-
* Walks up the chain
|
|
188
|
-
* @param currentPath
|
|
189
|
-
*/
|
|
190
|
-
findClosestConfigFile(currentPath: string): Promise<string>;
|
|
191
203
|
/**
|
|
192
204
|
* Set a timeout for the specified milliseconds, and resolve the promise once the timeout is finished.
|
|
193
|
-
* @param milliseconds
|
|
205
|
+
* @param milliseconds the minimum number of milliseconds to sleep for
|
|
194
206
|
*/
|
|
195
207
|
sleep(milliseconds: number): Promise<unknown>;
|
|
196
|
-
/**
|
|
197
|
-
* Given an array, map and then flatten
|
|
198
|
-
* @param arr
|
|
199
|
-
* @param cb
|
|
200
|
-
*/
|
|
201
|
-
flatMap<T, R>(array: T[], cb: (arg: T) => R): R;
|
|
202
208
|
/**
|
|
203
209
|
* Determines if the position is greater than the range. This means
|
|
204
210
|
* the position does not touch the range, and has a position greater than the end
|
|
@@ -207,40 +213,17 @@ export declare class Util {
|
|
|
207
213
|
*/
|
|
208
214
|
positionIsGreaterThanRange(position: Position, range: Range): boolean;
|
|
209
215
|
/**
|
|
210
|
-
* Get a
|
|
211
|
-
*/
|
|
212
|
-
getRange(startObj: {
|
|
213
|
-
range: Range;
|
|
214
|
-
}, endObj: {
|
|
215
|
-
range: Range;
|
|
216
|
-
}): Range;
|
|
217
|
-
/**
|
|
218
|
-
* If the two items both start on the same line
|
|
216
|
+
* Get a range back from an object that contains (or is) a range
|
|
219
217
|
*/
|
|
220
|
-
|
|
221
|
-
range: Range;
|
|
222
|
-
}, second: {
|
|
223
|
-
range: Range;
|
|
224
|
-
}): boolean;
|
|
218
|
+
extractRange(rangeIsh: RangeLike): Range | undefined;
|
|
225
219
|
/**
|
|
226
220
|
* If the two items have lines that touch
|
|
227
|
-
* @param first
|
|
228
|
-
* @param second
|
|
229
221
|
*/
|
|
230
|
-
linesTouch(first:
|
|
231
|
-
range: Range;
|
|
232
|
-
}, second: {
|
|
233
|
-
range: Range;
|
|
234
|
-
}): boolean;
|
|
235
|
-
/**
|
|
236
|
-
* Given text with (or without) dots separating text, get the rightmost word.
|
|
237
|
-
* (i.e. given "A.B.C", returns "C". or "B" returns "B because there's no dot)
|
|
238
|
-
*/
|
|
239
|
-
getTextAfterFinalDot(name: string): string;
|
|
222
|
+
linesTouch(first: RangeLike, second: RangeLike): boolean;
|
|
240
223
|
/**
|
|
241
224
|
* Find a script import that the current position touches, or undefined if not found
|
|
242
225
|
*/
|
|
243
|
-
getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference;
|
|
226
|
+
getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference | undefined;
|
|
244
227
|
/**
|
|
245
228
|
* Given the class name text, return a namespace-prefixed name.
|
|
246
229
|
* If the name already has a period in it, or the namespaceName was not provided, return the class name as is.
|
|
@@ -251,117 +234,235 @@ export declare class Util {
|
|
|
251
234
|
splitIntoLines(string: string): string[];
|
|
252
235
|
getTextForRange(string: string | string[], range: Range): string;
|
|
253
236
|
/**
|
|
254
|
-
* Helper for creating `
|
|
237
|
+
* Helper for creating `Location` objects. Prefer using this function because vscode-languageserver's `Location.create()` is significantly slower at scale
|
|
238
|
+
*/
|
|
239
|
+
createLocationFromRange(uri: string, range: Range): Location;
|
|
240
|
+
/**
|
|
241
|
+
* Helper for creating `Location` objects from a file and range
|
|
242
|
+
*/
|
|
243
|
+
createLocationFromFileRange(file: BscFile, range: Range): Location;
|
|
244
|
+
/**
|
|
245
|
+
* Helper for creating `Location` objects by passing each range value in directly. Prefer using this function because vscode-languageserver's `Location.create()` is significantly slower at scale
|
|
246
|
+
*/
|
|
247
|
+
createLocation(startLine: number, startCharacter: number, endLine: number, endCharacter: number, uri?: string): Location;
|
|
248
|
+
/**
|
|
249
|
+
* Helper for creating `Range` objects. Prefer using this function because vscode-languageserver's `Range.create()` is significantly slower.
|
|
255
250
|
*/
|
|
256
251
|
createRange(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range;
|
|
257
252
|
/**
|
|
258
253
|
* Create a `Range` from two `Position`s
|
|
259
254
|
*/
|
|
260
|
-
createRangeFromPositions(startPosition: Position, endPosition: Position): Range;
|
|
255
|
+
createRangeFromPositions(startPosition: Position, endPosition: Position): Range | undefined;
|
|
261
256
|
/**
|
|
262
|
-
*
|
|
263
|
-
* righthand range. Returns undefined if none of the items have a range.
|
|
257
|
+
* Clone a range
|
|
264
258
|
*/
|
|
265
|
-
|
|
259
|
+
cloneLocation(location: Location): Location;
|
|
260
|
+
/**
|
|
261
|
+
* Clone every token
|
|
262
|
+
*/
|
|
263
|
+
cloneToken<T extends Token>(token: T): T;
|
|
264
|
+
/**
|
|
265
|
+
* Gets the bounding range of a bunch of ranges or objects that have ranges
|
|
266
|
+
* TODO: this does a full iteration of the args. If the args were guaranteed to be in range order, we could optimize this
|
|
267
|
+
*/
|
|
268
|
+
createBoundingLocation(...locatables: Array<{
|
|
269
|
+
location?: Location;
|
|
270
|
+
} | Location | {
|
|
266
271
|
range?: Range;
|
|
267
|
-
}>):
|
|
272
|
+
} | Range | undefined>): Location | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Gets the bounding range of a bunch of ranges or objects that have ranges
|
|
275
|
+
* TODO: this does a full iteration of the args. If the args were guaranteed to be in range order, we could optimize this
|
|
276
|
+
*/
|
|
277
|
+
createBoundingRange(...locatables: Array<RangeLike>): Range | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* Gets the bounding range of an object that contains a bunch of tokens
|
|
280
|
+
* @param tokens Object with tokens in it
|
|
281
|
+
* @returns Range containing all the tokens
|
|
282
|
+
*/
|
|
283
|
+
createBoundingLocationFromTokens(tokens: Record<string, {
|
|
284
|
+
location?: Location;
|
|
285
|
+
}>): Location | undefined;
|
|
268
286
|
/**
|
|
269
|
-
* Create a `Position` object. Prefer this over `Position.create` for performance reasons
|
|
287
|
+
* Create a `Position` object. Prefer this over `Position.create` for performance reasons.
|
|
270
288
|
*/
|
|
271
289
|
createPosition(line: number, character: number): {
|
|
272
290
|
line: number;
|
|
273
291
|
character: number;
|
|
274
292
|
};
|
|
275
293
|
/**
|
|
276
|
-
* Convert a
|
|
294
|
+
* Convert a token into a BscType
|
|
277
295
|
*/
|
|
278
|
-
|
|
296
|
+
tokenToBscType(token: Token): DynamicType | ObjectType | VoidType | InvalidType | BooleanType | DoubleType | FloatType | FunctionType | IntegerType | LongIntegerType | StringType;
|
|
279
297
|
/**
|
|
280
|
-
*
|
|
298
|
+
* Deciphers the correct types for fields based on docs
|
|
299
|
+
* https://developer.roku.com/en-ca/docs/references/scenegraph/xml-elements/interface.md
|
|
300
|
+
* @param typeDescriptor the type descriptor from the docs
|
|
301
|
+
* @returns {BscType} the known type, or dynamic
|
|
302
|
+
*/
|
|
303
|
+
getNodeFieldType(typeDescriptor: string, lookupTable?: SymbolTable): BscType;
|
|
304
|
+
/**
|
|
305
|
+
* Return the type of the result of a binary operator
|
|
306
|
+
* Note: compound assignments (eg. +=) internally use a binary expression, so that's why TokenKind.PlusEqual, etc. are here too
|
|
307
|
+
*/
|
|
308
|
+
binaryOperatorResultType(leftType: BscType, operator: Token, rightType: BscType): BscType;
|
|
309
|
+
getHighestPriorityType(types: BscType[], depth?: number): BscType;
|
|
310
|
+
/**
|
|
311
|
+
* Return the type of the result of a unary operator
|
|
281
312
|
*/
|
|
282
|
-
|
|
313
|
+
unaryOperatorResultType(operator: Token, exprType: BscType): BscType;
|
|
314
|
+
getUnboxedType(boxedType: BscType): BscType;
|
|
283
315
|
/**
|
|
284
316
|
* Get the extension for the given file path. Basically the part after the final dot, except for
|
|
285
317
|
* `d.bs` which is treated as single extension
|
|
318
|
+
* @returns the file extension (i.e. ".d.bs", ".bs", ".brs", ".xml", ".jpg", etc...)
|
|
286
319
|
*/
|
|
287
320
|
getExtension(filePath: string): string;
|
|
288
321
|
/**
|
|
289
322
|
* Load and return the list of plugins
|
|
290
323
|
*/
|
|
291
|
-
loadPlugins(cwd: string, pathOrModules: string[], onError?: (pathOrModule: string, err: Error) => void):
|
|
292
|
-
resolveRequire(cwd: string, pathOrModule: string): any;
|
|
324
|
+
loadPlugins(cwd: string, pathOrModules: string[], onError?: (pathOrModule: string, err: Error) => void): Plugin[];
|
|
293
325
|
/**
|
|
294
326
|
* Gathers expressions, variables, and unique names from an expression.
|
|
295
327
|
* This is mostly used for the ternary expression
|
|
296
328
|
*/
|
|
297
|
-
getExpressionInfo(expression: Expression): ExpressionInfo;
|
|
329
|
+
getExpressionInfo(expression: Expression, file: BrsFile): ExpressionInfo;
|
|
330
|
+
concatAnnotationLeadingTrivia(stmt: Statement): Token[];
|
|
298
331
|
/**
|
|
299
332
|
* Create a SourceNode that maps every line to itself. Useful for creating maps for files
|
|
300
333
|
* that haven't changed at all, but we still need the map
|
|
301
334
|
*/
|
|
302
335
|
simpleMap(source: string, src: string): SourceNode;
|
|
336
|
+
private isWindows;
|
|
337
|
+
private standardizePathCache;
|
|
303
338
|
/**
|
|
304
|
-
*
|
|
339
|
+
* Converts a path into a standardized format (drive letter to lower, remove extra slashes, use single slash type, resolve relative parts, etc...)
|
|
305
340
|
*/
|
|
306
|
-
|
|
341
|
+
standardizePath(thePath: string): string;
|
|
307
342
|
/**
|
|
308
|
-
*
|
|
343
|
+
* Given a Diagnostic or BsDiagnostic, return a deep clone of the diagnostic.
|
|
344
|
+
* @param diagnostic the diagnostic to clone
|
|
345
|
+
* @param relatedInformationFallbackLocation a default location to use for all `relatedInformation` entries that are missing a location
|
|
309
346
|
*/
|
|
310
|
-
|
|
311
|
-
range: Range;
|
|
312
|
-
}, code: string | SourceNode | TranspileResult): SourceNode | undefined;
|
|
347
|
+
toDiagnostic(diagnostic: Diagnostic | BsDiagnostic, relatedInformationFallbackLocation: string): Diagnostic;
|
|
313
348
|
/**
|
|
314
|
-
*
|
|
349
|
+
* Sort an array of objects that have a Range
|
|
315
350
|
*/
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Given a Diagnostic or BsDiagnostic, return a copy of the diagnostic
|
|
321
|
-
*/
|
|
322
|
-
toDiagnostic(diagnostic: Diagnostic | BsDiagnostic): {
|
|
323
|
-
severity: import("vscode-languageserver-types").DiagnosticSeverity;
|
|
324
|
-
range: Range;
|
|
325
|
-
message: string;
|
|
326
|
-
relatedInformation: {
|
|
327
|
-
location: import("vscode-languageserver-types").Location;
|
|
328
|
-
message: string;
|
|
329
|
-
}[];
|
|
330
|
-
code: string | number;
|
|
331
|
-
source: string;
|
|
332
|
-
};
|
|
351
|
+
sortByRange<T extends {
|
|
352
|
+
range: Range | undefined;
|
|
353
|
+
}>(locatables: T[]): T[];
|
|
333
354
|
/**
|
|
334
|
-
*
|
|
335
|
-
* @param params The list of callable parameters to check
|
|
336
|
-
* @returns the minimum and maximum number of allowed params
|
|
355
|
+
* Wrap the given code in a markdown code fence (with the language)
|
|
337
356
|
*/
|
|
338
|
-
|
|
339
|
-
min: number;
|
|
340
|
-
max: number;
|
|
341
|
-
};
|
|
357
|
+
mdFence(code: string, language?: string): string;
|
|
342
358
|
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* @
|
|
359
|
+
* Gets each part of the dotted get.
|
|
360
|
+
* @param node any ast expression
|
|
361
|
+
* @returns an array of the parts of the dotted get. If not fully a dotted get, then returns undefined
|
|
346
362
|
*/
|
|
347
|
-
|
|
363
|
+
getAllDottedGetParts(node: AstNode): Identifier[] | undefined;
|
|
348
364
|
/**
|
|
349
|
-
*
|
|
365
|
+
* Given an expression, return all the DottedGet name parts as a string.
|
|
366
|
+
* Mostly used to convert namespaced item full names to a strings
|
|
367
|
+
*/
|
|
368
|
+
getAllDottedGetPartsAsString(node: Expression | Statement, parseMode?: ParseMode, lastSep?: string): string;
|
|
369
|
+
/**
|
|
370
|
+
* Break an expression into each part.
|
|
371
|
+
*/
|
|
372
|
+
splitExpression(expression: Expression): Expression[];
|
|
373
|
+
/**
|
|
374
|
+
* Returns an integer if valid, or undefined. Eliminates checking for NaN
|
|
375
|
+
*/
|
|
376
|
+
parseInt(value: any): number;
|
|
377
|
+
/**
|
|
378
|
+
* Converts a range to a string in the format 1:2-3:4
|
|
379
|
+
*/
|
|
380
|
+
rangeToString(range: Range): string;
|
|
381
|
+
validateTooDeepFile(file: (BrsFile | XmlFile)): void;
|
|
382
|
+
/**
|
|
383
|
+
* Execute dispose for a series of disposable items
|
|
384
|
+
* @param disposables a list of functions or disposables
|
|
385
|
+
*/
|
|
386
|
+
applyDispose(disposables: DisposableLike[]): void;
|
|
387
|
+
/**
|
|
388
|
+
* Race a series of promises, and return the first one that resolves AND matches the matcher function.
|
|
389
|
+
* If all of the promises reject, then this will emit an AggregatreError with all of the errors.
|
|
390
|
+
* If at least one promise resolves, then this will log all of the errors to the console
|
|
391
|
+
* If at least one promise resolves but none of them match the matcher, then this will return undefined.
|
|
392
|
+
* @param promises all of the promises to race
|
|
393
|
+
* @param matcher a function that should return true if this value should be kept. Returning any value other than true means `false`
|
|
394
|
+
* @returns the first resolved value that matches the matcher, or undefined if none of them match
|
|
350
395
|
*/
|
|
351
|
-
|
|
396
|
+
promiseRaceMatch<T>(promises: MaybePromise<T>[], matcher: (value: T) => boolean): Promise<T>;
|
|
352
397
|
/**
|
|
353
|
-
*
|
|
354
|
-
* Only works for single-line strings
|
|
398
|
+
* Wraps SourceNode's constructor to be compatible with the TranspileResult type
|
|
355
399
|
*/
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
400
|
+
sourceNodeFromTranspileResult(line: number | null, column: number | null, source: string | null, chunks?: string | SourceNode | TranspileResult, name?: string): SourceNode;
|
|
401
|
+
/**
|
|
402
|
+
* Find the index of the last item in the array that matches.
|
|
403
|
+
*/
|
|
404
|
+
findLastIndex<T>(array: T[], matcher: (T: any) => boolean): number;
|
|
405
|
+
processTypeChain(typeChain: TypeChainEntry[]): TypeChainProcessResult;
|
|
406
|
+
getCircularReferenceDiagnosticDetail(circularReferenceInfo: TypeCircularReferenceInfo, defaultName?: string): string[];
|
|
407
|
+
isInTypeExpression(expression: AstNode): boolean;
|
|
408
|
+
isGenericNodeType(type: BscType): boolean;
|
|
409
|
+
hasAnyRequiredSymbolChanged(requiredSymbols: UnresolvedSymbol[], changedSymbols: Map<SymbolTypeFlag, Set<string>>): boolean;
|
|
410
|
+
setContainsUnresolvedSymbol(symbolLowerNameSet: Set<string>, symbol: UnresolvedSymbol): boolean;
|
|
411
|
+
getCustomTypesInSymbolTree(setToFill: Set<BscType>, type: BscType, filter?: (t: BscType) => boolean): void;
|
|
412
|
+
truncate<T>(options: {
|
|
413
|
+
leadingText: string;
|
|
414
|
+
items: T[];
|
|
415
|
+
trailingText?: string;
|
|
416
|
+
maxLength: number;
|
|
417
|
+
itemSeparator?: string;
|
|
418
|
+
partBuilder?: (item: T) => string;
|
|
419
|
+
}): string;
|
|
420
|
+
getAstNodeFriendlyName(node: AstNode): string;
|
|
421
|
+
hasLeadingComments(input: Token | AstNode): boolean;
|
|
422
|
+
getLeadingComments(input: Token | AstNode): Token[];
|
|
423
|
+
isLeadingCommentOnSameLine(line: RangeLike, input: Token | AstNode): boolean;
|
|
424
|
+
isClassUsedAsFunction(potentialClassType: BscType, expression: Expression, options: GetTypeOptions): boolean;
|
|
425
|
+
getSpecialCaseCallExpressionReturnType(callExpr: CallExpression, options: GetSymbolTypeOptions): BscType;
|
|
426
|
+
getCallFuncType(callExpr: CallExpression | CallfuncExpression, methodNameToken: Token | Identifier, options: GetSymbolTypeOptions): BscType;
|
|
427
|
+
isUnionOfFunctions(type: BscType, allowReferenceTypes?: boolean): type is UnionType;
|
|
428
|
+
isIntersectionOfFunctions(type: BscType, allowReferenceTypes?: boolean): type is IntersectionType;
|
|
429
|
+
getFunctionTypeFromUnion(type: BscType): BscType;
|
|
430
|
+
getFunctionTypeFromIntersection(type: BscType): BscType;
|
|
431
|
+
getReturnTypeOfUnionOfFunctions(type: UnionType): BscType;
|
|
432
|
+
getReturnTypeOfIntersectionOfFunctions(type: IntersectionType): BscType;
|
|
433
|
+
symbolComesFromSameNode(symbolName: string, definingNode: AstNode, symbolTable: SymbolTable): boolean;
|
|
434
|
+
isCalleeMemberOfNamespace(symbolName: string, nodeWhereUsed: AstNode, namespace?: NamespaceStatement): boolean;
|
|
435
|
+
isVariableMemberOfNamespace(symbolName: string, nodeWhereUsed: AstNode, namespace?: NamespaceStatement): boolean;
|
|
436
|
+
isVariableShadowingSomething(symbolName: string, nodeWhereUsed: AstNode): boolean;
|
|
437
|
+
chooseTypeFromCodeOrDocComment(codeType: BscType, docType: BscType, options: GetTypeOptions): BscType;
|
|
438
|
+
/**
|
|
439
|
+
* Gets the type for a default value (eg. as a function param, class member or typed array)
|
|
440
|
+
*/
|
|
441
|
+
getDefaultTypeFromValueType(valueType: (BscType | BscType[])): BscType;
|
|
442
|
+
/**
|
|
443
|
+
* Get the default type for an iterator of the given type
|
|
444
|
+
* Used for `for each` loops
|
|
445
|
+
*/
|
|
446
|
+
getIteratorDefaultType(iteratorType: BscType): BscType;
|
|
447
|
+
/**
|
|
448
|
+
* Get a short name that can be used to reference the project in logs. (typically something like `prj1`, `prj8`, etc...)
|
|
449
|
+
*/
|
|
450
|
+
getProjectLogName(config: {
|
|
451
|
+
projectNumber: number;
|
|
452
|
+
}): string;
|
|
360
453
|
}
|
|
361
454
|
/**
|
|
362
455
|
* A tagged template literal function for standardizing the path. This has to be defined as standalone function since it's a tagged template literal function,
|
|
363
456
|
* we can't use `object.tag` syntax.
|
|
364
457
|
*/
|
|
365
458
|
export declare function standardizePath(stringParts: any, ...expressions: any[]): string;
|
|
459
|
+
/**
|
|
460
|
+
* An item that can be coerced into a `Range`
|
|
461
|
+
*/
|
|
462
|
+
export declare type RangeLike = {
|
|
463
|
+
location?: Location;
|
|
464
|
+
} | Location | {
|
|
465
|
+
range?: Range;
|
|
466
|
+
} | Range | undefined;
|
|
366
467
|
export declare let util: Util;
|
|
367
468
|
export default util;
|