brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.51
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 +79 -138
- package/bsconfig.schema.json +196 -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 +161 -43
- 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 +29 -4
- package/dist/CodeActionUtil.js +22 -5
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +20 -15
- package/dist/CommentFlagProcessor.js +143 -58
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +68 -0
- package/dist/CrossScopeValidator.js +650 -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 +83 -0
- package/dist/DiagnosticManager.js +422 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +602 -196
- package/dist/DiagnosticMessages.js +926 -342
- 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 +136 -104
- package/dist/LanguageServer.js +577 -741
- 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 +302 -98
- package/dist/Program.js +1613 -726
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +39 -22
- package/dist/ProgramBuilder.js +245 -179
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +227 -106
- package/dist/Scope.js +609 -557
- package/dist/Scope.js.map +1 -1
- package/dist/ScopeNamespaceLookup.d.ts +73 -0
- package/dist/ScopeNamespaceLookup.js +242 -0
- package/dist/ScopeNamespaceLookup.js.map +1 -0
- 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 +145 -26
- package/dist/SymbolTable.js +575 -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 +337 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/Editor.d.ts +69 -0
- package/dist/astUtils/Editor.js +245 -0
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/creators.d.ts +54 -19
- package/dist/astUtils/creators.js +242 -42
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +199 -85
- package/dist/astUtils/reflection.js +518 -145
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +117 -53
- package/dist/astUtils/visitors.js +95 -15
- package/dist/astUtils/visitors.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 +26 -4
- package/dist/bscPlugin/BscPlugin.js +96 -4
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +142 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +19 -0
- package/dist/bscPlugin/FileWriter.js +79 -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 +109 -7
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +676 -26
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.d.ts +17 -0
- package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.js +66 -0
- package/dist/bscPlugin/codeActions/FixAllCodeActionsProcessor.js.map +1 -0
- package/dist/bscPlugin/codeActions/codeActionHelpers.d.ts +18 -0
- package/dist/bscPlugin/codeActions/codeActionHelpers.js +31 -0
- package/dist/bscPlugin/codeActions/codeActionHelpers.js.map +1 -0
- 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/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +220 -0
- package/dist/bscPlugin/definition/DefinitionProvider.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 +238 -0
- package/dist/bscPlugin/hover/HoverProcessor.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/selectionRanges/SelectionRangesProcessor.d.ts +7 -0
- package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.js +77 -0
- package/dist/bscPlugin/selectionRanges/SelectionRangesProcessor.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/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 +80 -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/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/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 +34 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +504 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.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 +51 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +714 -0
- package/dist/bscPlugin/validation/BrsFileValidator.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 +158 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1481 -0
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +50 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +140 -28
- 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/deferred.d.ts +5 -3
- package/dist/deferred.js +10 -0
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +61 -4
- package/dist/diagnosticUtils.js +285 -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.d.ts +161 -87
- package/dist/files/BrsFile.js +919 -936
- package/dist/files/BrsFile.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/XmlFile.d.ts +80 -41
- package/dist/files/XmlFile.js +162 -137
- package/dist/files/XmlFile.js.map +1 -1
- 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 +987 -125
- package/dist/interfaces.js +21 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +51 -12
- package/dist/lexer/Lexer.js +214 -65
- package/dist/lexer/Lexer.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 +48 -2
- package/dist/lexer/TokenKind.js +167 -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/DocumentManager.d.ts +63 -0
- package/dist/lsp/DocumentManager.js +122 -0
- package/dist/lsp/DocumentManager.js.map +1 -0
- package/dist/lsp/LspProject.d.ts +287 -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/Project.d.ts +200 -0
- package/dist/lsp/Project.js +562 -0
- package/dist/lsp/Project.js.map +1 -0
- package/dist/lsp/ProjectManager.d.ts +288 -0
- package/dist/lsp/ProjectManager.js +967 -0
- package/dist/lsp/ProjectManager.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/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/WorkerThreadProject.d.ts +168 -0
- package/dist/lsp/worker/WorkerThreadProject.js +205 -0
- package/dist/lsp/worker/WorkerThreadProject.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.js +14 -0
- package/dist/lsp/worker/run.js.map +1 -0
- package/dist/parser/AstNode.d.ts +205 -0
- package/dist/parser/AstNode.js +305 -0
- package/dist/parser/AstNode.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/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 +601 -220
- package/dist/parser/Expression.js +1516 -502
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.d.ts +137 -121
- package/dist/parser/Parser.js +1808 -982
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/SGParser.d.ts +30 -13
- package/dist/parser/SGParser.js +94 -56
- package/dist/parser/SGParser.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 +854 -267
- package/dist/parser/Statement.js +2416 -621
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +30 -14
- package/dist/parser/TranspileState.js +124 -27
- package/dist/parser/TranspileState.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/roku-types/data.json +20554 -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 +95 -25
- package/dist/types/ArrayType.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/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/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 +63 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ComponentType.d.ts +22 -0
- package/dist/types/ComponentType.js +110 -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/DynamicType.d.ts +13 -5
- package/dist/types/DynamicType.js +26 -5
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/EnumType.d.ts +42 -0
- package/dist/types/EnumType.js +101 -0
- package/dist/types/EnumType.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/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/InterfaceType.d.ts +14 -6
- package/dist/types/InterfaceType.js +30 -15
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/IntersectionType.d.ts +29 -0
- package/dist/types/IntersectionType.js +256 -0
- package/dist/types/IntersectionType.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/LongIntegerType.d.ts +10 -5
- package/dist/types/LongIntegerType.js +21 -17
- package/dist/types/LongIntegerType.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/ReferenceType.d.ts +123 -0
- package/dist/types/ReferenceType.js +726 -0
- package/dist/types/ReferenceType.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/TypeStatementType.d.ts +19 -0
- package/dist/types/TypeStatementType.js +56 -0
- package/dist/types/TypeStatementType.js.map +1 -0
- package/dist/types/TypedFunctionType.d.ts +34 -0
- package/dist/types/TypedFunctionType.js +157 -0
- package/dist/types/TypedFunctionType.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 +196 -0
- package/dist/types/UnionType.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/helpers.d.ts +51 -0
- package/dist/types/helpers.js +329 -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/util.d.ts +325 -185
- package/dist/util.js +2135 -568
- 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 +183 -138
- package/CHANGELOG.md +0 -1188
- package/dist/astUtils/creators.spec.js +0 -21
- package/dist/astUtils/creators.spec.js.map +0 -1
- 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/astUtils/reflection.spec.d.ts +0 -1
- package/dist/astUtils/reflection.spec.js +0 -292
- package/dist/astUtils/reflection.spec.js.map +0 -1
- package/dist/astUtils/stackedVisitor.spec.d.ts +0 -1
- package/dist/astUtils/stackedVisitor.spec.js +0 -79
- package/dist/astUtils/stackedVisitor.spec.js.map +0 -1
- package/dist/astUtils/visitors.spec.d.ts +0 -1
- package/dist/astUtils/visitors.spec.js +0 -854
- package/dist/astUtils/visitors.spec.js.map +0 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.d.ts +0 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +0 -194
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.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.d.ts +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +0 -1
- package/dist/files/BrsFile.Class.spec.d.ts +0 -1
- package/dist/files/BrsFile.Class.spec.js +0 -1081
- package/dist/files/BrsFile.Class.spec.js.map +0 -1
- package/dist/files/BrsFile.spec.d.ts +0 -1
- package/dist/files/BrsFile.spec.js +0 -2524
- package/dist/files/BrsFile.spec.js.map +0 -1
- package/dist/files/XmlFile.spec.d.ts +0 -1
- package/dist/files/XmlFile.spec.js +0 -1065
- package/dist/files/XmlFile.spec.js.map +0 -1
- package/dist/files/tests/imports.spec.d.ts +0 -1
- package/dist/files/tests/imports.spec.js +0 -241
- package/dist/files/tests/imports.spec.js.map +0 -1
- package/dist/lexer/Character.spec.d.ts +0 -1
- package/dist/lexer/Character.spec.js +0 -27
- package/dist/lexer/Character.spec.js.map +0 -1
- package/dist/lexer/Lexer.spec.d.ts +0 -1
- package/dist/lexer/Lexer.spec.js +0 -1101
- package/dist/lexer/Lexer.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/Parser.Class.spec.d.ts +0 -1
- package/dist/parser/Parser.Class.spec.js +0 -390
- package/dist/parser/Parser.Class.spec.js.map +0 -1
- package/dist/parser/Parser.spec.d.ts +0 -4
- package/dist/parser/Parser.spec.js +0 -1216
- package/dist/parser/Parser.spec.js.map +0 -1
- package/dist/parser/SGParser.spec.d.ts +0 -1
- package/dist/parser/SGParser.spec.js +0 -145
- package/dist/parser/SGParser.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.d.ts +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/parser/Statement.spec.d.ts +0 -1
- package/dist/parser/Statement.spec.js +0 -94
- package/dist/parser/Statement.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/parser/tests/Parser.spec.d.ts +0 -18
- package/dist/parser/tests/Parser.spec.js +0 -35
- package/dist/parser/tests/Parser.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/For.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/For.spec.js +0 -161
- package/dist/parser/tests/controlFlow/For.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +0 -106
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/If.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/If.spec.js +0 -551
- package/dist/parser/tests/controlFlow/If.spec.js.map +0 -1
- package/dist/parser/tests/controlFlow/While.spec.d.ts +0 -1
- package/dist/parser/tests/controlFlow/While.spec.js +0 -107
- package/dist/parser/tests/controlFlow/While.spec.js.map +0 -1
- package/dist/parser/tests/expression/Additive.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Additive.spec.js +0 -99
- package/dist/parser/tests/expression/Additive.spec.js.map +0 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.d.ts +0 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +0 -254
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +0 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.d.ts +0 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +0 -266
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +0 -1
- package/dist/parser/tests/expression/Boolean.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Boolean.spec.js +0 -83
- package/dist/parser/tests/expression/Boolean.spec.js.map +0 -1
- package/dist/parser/tests/expression/Call.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Call.spec.js +0 -134
- package/dist/parser/tests/expression/Call.spec.js.map +0 -1
- package/dist/parser/tests/expression/Exponential.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Exponential.spec.js +0 -37
- package/dist/parser/tests/expression/Exponential.spec.js.map +0 -1
- package/dist/parser/tests/expression/Function.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Function.spec.js +0 -403
- package/dist/parser/tests/expression/Function.spec.js.map +0 -1
- package/dist/parser/tests/expression/Indexing.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Indexing.spec.js +0 -219
- package/dist/parser/tests/expression/Indexing.spec.js.map +0 -1
- package/dist/parser/tests/expression/Multiplicative.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +0 -67
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +0 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +0 -201
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +0 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.d.ts +0 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +0 -105
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +0 -1
- package/dist/parser/tests/expression/Primary.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Primary.spec.js +0 -149
- package/dist/parser/tests/expression/Primary.spec.js.map +0 -1
- package/dist/parser/tests/expression/Relational.spec.d.ts +0 -1
- package/dist/parser/tests/expression/Relational.spec.js +0 -83
- package/dist/parser/tests/expression/Relational.spec.js.map +0 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +0 -201
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +0 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +0 -202
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +0 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.d.ts +0 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +0 -323
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +0 -1
- package/dist/parser/tests/statement/AssignmentOperators.spec.d.ts +0 -1
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +0 -79
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +0 -1
- package/dist/parser/tests/statement/Declaration.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Declaration.spec.js +0 -108
- package/dist/parser/tests/statement/Declaration.spec.js.map +0 -1
- package/dist/parser/tests/statement/Dim.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Dim.spec.js +0 -73
- package/dist/parser/tests/statement/Dim.spec.js.map +0 -1
- package/dist/parser/tests/statement/Function.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Function.spec.js +0 -332
- package/dist/parser/tests/statement/Function.spec.js.map +0 -1
- package/dist/parser/tests/statement/Goto.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Goto.spec.js +0 -50
- package/dist/parser/tests/statement/Goto.spec.js.map +0 -1
- package/dist/parser/tests/statement/Increment.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Increment.spec.js +0 -117
- package/dist/parser/tests/statement/Increment.spec.js.map +0 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.d.ts +0 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +0 -74
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +0 -1
- package/dist/parser/tests/statement/Misc.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Misc.spec.js +0 -333
- package/dist/parser/tests/statement/Misc.spec.js.map +0 -1
- package/dist/parser/tests/statement/PrintStatement.spec.d.ts +0 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +0 -181
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +0 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.d.ts +0 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +0 -94
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +0 -1
- package/dist/parser/tests/statement/Set.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Set.spec.js +0 -218
- package/dist/parser/tests/statement/Set.spec.js.map +0 -1
- package/dist/parser/tests/statement/Stop.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Stop.spec.js +0 -37
- package/dist/parser/tests/statement/Stop.spec.js.map +0 -1
- package/dist/parser/tests/statement/Throw.spec.d.ts +0 -1
- package/dist/parser/tests/statement/Throw.spec.js +0 -35
- package/dist/parser/tests/statement/Throw.spec.js.map +0 -1
- package/dist/parser/tests/statement/TryCatch.spec.d.ts +0 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +0 -140
- package/dist/parser/tests/statement/TryCatch.spec.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/Manifest.spec.d.ts +0 -0
- package/dist/preprocessor/Manifest.spec.js +0 -105
- package/dist/preprocessor/Manifest.spec.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.d.ts +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.d.ts +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/ArrayType.spec.d.ts +0 -1
- package/dist/types/ArrayType.spec.js +0 -30
- package/dist/types/ArrayType.spec.js.map +0 -1
- package/dist/types/BooleanType.spec.d.ts +0 -1
- package/dist/types/BooleanType.spec.js +0 -12
- package/dist/types/BooleanType.spec.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/DoubleType.spec.d.ts +0 -1
- package/dist/types/DoubleType.spec.js +0 -12
- package/dist/types/DoubleType.spec.js.map +0 -1
- package/dist/types/DynamicType.spec.d.ts +0 -1
- package/dist/types/DynamicType.spec.js +0 -12
- package/dist/types/DynamicType.spec.js.map +0 -1
- package/dist/types/FloatType.spec.d.ts +0 -1
- package/dist/types/FloatType.spec.js +0 -12
- package/dist/types/FloatType.spec.js.map +0 -1
- package/dist/types/FunctionType.spec.d.ts +0 -1
- package/dist/types/FunctionType.spec.js +0 -29
- package/dist/types/FunctionType.spec.js.map +0 -1
- package/dist/types/IntegerType.spec.d.ts +0 -1
- package/dist/types/IntegerType.spec.js +0 -12
- package/dist/types/IntegerType.spec.js.map +0 -1
- package/dist/types/InvalidType.spec.d.ts +0 -1
- package/dist/types/InvalidType.spec.js +0 -12
- package/dist/types/InvalidType.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/types/LongIntegerType.spec.d.ts +0 -1
- package/dist/types/LongIntegerType.spec.js +0 -12
- package/dist/types/LongIntegerType.spec.js.map +0 -1
- package/dist/types/ObjectType.spec.d.ts +0 -1
- package/dist/types/ObjectType.spec.js +0 -12
- package/dist/types/ObjectType.spec.js.map +0 -1
- package/dist/types/StringType.spec.d.ts +0 -1
- package/dist/types/StringType.spec.js +0 -12
- package/dist/types/StringType.spec.js.map +0 -1
- package/dist/types/VoidType.spec.d.ts +0 -1
- package/dist/types/VoidType.spec.js +0 -12
- package/dist/types/VoidType.spec.js.map +0 -1
- /package/dist/{astUtils/creators.spec.d.ts → lsp/worker/run.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 { RawSourceMap, SourceMapGenerator } from 'source-map';
|
|
22
|
+
import type { BrsFile } from './files/BrsFile';
|
|
23
|
+
import type { XmlFile } from './files/XmlFile';
|
|
24
|
+
import type { AstNode, Expression, Statement } from './parser/AstNode';
|
|
25
|
+
import type { UnresolvedSymbol } from './AstValidationSegmenter';
|
|
26
|
+
import type { GetSymbolTypeOptions, SymbolTable } from './SymbolTable';
|
|
27
|
+
import { SymbolTypeFlag } from './SymbolTypeFlag';
|
|
28
|
+
import type { BscType } from './types/BscType';
|
|
29
|
+
import { UnionType } from './types/UnionType';
|
|
30
|
+
import { FunctionType } from './types/FunctionType';
|
|
31
|
+
import type { NamespaceStatement } from './parser/Statement';
|
|
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,168 @@ 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
|
-
*
|
|
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
|
|
109
112
|
*/
|
|
110
|
-
|
|
113
|
+
getPkgPathFromTarget(containingFilePathAbsolute: string, targetPath: string): string;
|
|
111
114
|
/**
|
|
112
|
-
* Compute the
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
+
* Compute the replacement text for a file-path string (used in `import` statements and XML `<script uri>` attributes)
|
|
116
|
+
* when the target file is being renamed. Preserves the original path style: `pkg:/...` stays `pkg:/...`,
|
|
117
|
+
* relative paths stay relative (recomputed from the containing file's pkg path).
|
|
118
|
+
*
|
|
119
|
+
* @param originalText the path string as it appears in source (no surrounding quotes)
|
|
120
|
+
* @param containingFilePkgPath pkg path of the file containing the reference
|
|
121
|
+
* @param newTargetPkgPath pkg path of the renamed file (path-separator agnostic)
|
|
122
|
+
* @returns the new path string, or `null` if the original style is unsupported
|
|
115
123
|
*/
|
|
116
|
-
|
|
124
|
+
computeRenamedReferencePath(originalText: string, containingFilePkgPath: string, newTargetPkgPath: string): string | null;
|
|
117
125
|
/**
|
|
118
126
|
* Compute the relative path from the source file to the target file
|
|
119
|
-
* @param
|
|
120
|
-
* @param
|
|
127
|
+
* @param pkgSrcPath - the absolute path to the source, where cwd is the package location
|
|
128
|
+
* @param pkgTargetPath - the absolute path to the target, where cwd is the package location
|
|
121
129
|
*/
|
|
122
|
-
getRelativePath(
|
|
130
|
+
getRelativePath(pkgSrcPath: string, pkgTargetPath: string): string;
|
|
131
|
+
getImportPackagePath(srcPath: string, pkgTargetPath: string): string;
|
|
123
132
|
/**
|
|
124
133
|
* Walks left in a DottedGetExpression and returns a VariableExpression if found, or undefined if not found
|
|
125
134
|
*/
|
|
126
135
|
findBeginningVariableExpression(dottedGet: DottedGetExpression): VariableExpression | undefined;
|
|
127
136
|
/**
|
|
128
|
-
*
|
|
137
|
+
* Do `a` and `b` overlap by at least one character. This returns false if they are at the edges. Here's some examples:
|
|
138
|
+
* ```
|
|
139
|
+
* | true | true | true | true | true | false | false | false | false |
|
|
140
|
+
* |------|------|------|------|------|-------|-------|-------|-------|
|
|
141
|
+
* | aa | aaa | aaa | aaa | a | aa | aa | a | a |
|
|
142
|
+
* | bbb | bb | bbb | b | bbb | bb | bb | b | a |
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
rangesIntersect(a: Range | undefined, b: Range | undefined): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Do `a` and `b` overlap by at least one character or touch at the edges
|
|
148
|
+
* ```
|
|
149
|
+
* | true | true | true | true | true | true | true | false | false |
|
|
150
|
+
* |------|------|------|------|------|-------|-------|-------|-------|
|
|
151
|
+
* | aa | aaa | aaa | aaa | a | aa | aa | a | a |
|
|
152
|
+
* | bbb | bb | bbb | b | bbb | bb | bb | b | a |
|
|
153
|
+
* ```
|
|
129
154
|
*/
|
|
130
|
-
|
|
155
|
+
rangesIntersectOrTouch(a: Range | undefined, b: Range | undefined): boolean;
|
|
131
156
|
/**
|
|
132
157
|
* Test if `position` is in `range`. If the position is at the edges, will return true.
|
|
133
158
|
* Adapted from core vscode
|
|
134
|
-
* @param range
|
|
135
|
-
* @param position
|
|
136
159
|
*/
|
|
137
|
-
rangeContains(range: Range, position: Position): boolean;
|
|
138
|
-
comparePositionToRange(position: Position, range: Range): 1 | -1 | 0;
|
|
160
|
+
rangeContains(range: Range | undefined, position: Position | undefined): boolean;
|
|
161
|
+
comparePositionToRange(position: Position | undefined, range: Range | undefined): 1 | -1 | 0;
|
|
162
|
+
comparePosition(a: Position | undefined, b: Position): 1 | -1 | 0;
|
|
139
163
|
/**
|
|
140
|
-
*
|
|
141
|
-
* @param text
|
|
164
|
+
* Is the inner range completely enclosed in the outer range
|
|
142
165
|
*/
|
|
143
|
-
|
|
144
|
-
propertyCount(object: Record<string, unknown>): number;
|
|
145
|
-
padLeft(subject: string, totalLength: number, char: string): string;
|
|
166
|
+
isRangeInRange(inner: Range, outer: Range): boolean;
|
|
146
167
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @param
|
|
168
|
+
* Combine all the documentation for a node - uses the AstNode's leadingTrivia property
|
|
169
|
+
* @param node the node to get the documentation for
|
|
170
|
+
* @param options extra options
|
|
171
|
+
* @param options.prettyPrint if true, will format the comment text for markdown
|
|
172
|
+
* @param options.commentTokens out Array of tokens that match the comment lines
|
|
149
173
|
*/
|
|
150
|
-
|
|
174
|
+
getNodeDocumentation(node: AstNode, options?: {
|
|
175
|
+
prettyPrint?: boolean;
|
|
176
|
+
commentTokens?: Token[];
|
|
177
|
+
}): string;
|
|
178
|
+
/**
|
|
179
|
+
* Prefixes a component name so it can be used as type in the symbol table, without polluting available symbols
|
|
180
|
+
*
|
|
181
|
+
* @param sgNodeName the Name of the component
|
|
182
|
+
* @returns the node name, prefixed with `roSGNode`
|
|
183
|
+
*/
|
|
184
|
+
getSgNodeTypeName(sgNodeName: string): string;
|
|
151
185
|
/**
|
|
152
186
|
* Force the drive letter to lower case
|
|
153
|
-
* @param fullPath
|
|
154
187
|
*/
|
|
155
188
|
driveLetterToLower(fullPath: string): string;
|
|
156
189
|
/**
|
|
157
|
-
*
|
|
158
|
-
|
|
190
|
+
* Replace the first instance of `search` in `subject` with `replacement`
|
|
191
|
+
*/
|
|
192
|
+
replaceCaseInsensitive(subject: string, search: string, replacement: string): string;
|
|
193
|
+
/**
|
|
194
|
+
* Does the string appear to be a uri (i.e. does it start with `file:`)
|
|
159
195
|
*/
|
|
160
|
-
|
|
196
|
+
isUriLike(filePath: string): boolean;
|
|
161
197
|
/**
|
|
162
198
|
* Given a file path, convert it to a URI string
|
|
163
|
-
* @param srcPath The absolute path to the source file on disk
|
|
164
199
|
*/
|
|
165
|
-
pathToUri(
|
|
200
|
+
pathToUri(filePath: string): string;
|
|
166
201
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @param options
|
|
202
|
+
* Given a URI, convert that to a regular fs path
|
|
169
203
|
*/
|
|
170
|
-
|
|
204
|
+
uriToPath(uri: string): string;
|
|
171
205
|
/**
|
|
172
206
|
* Get paths to all files on disc that match this project's source list
|
|
173
207
|
*/
|
|
174
|
-
getFilePaths(options:
|
|
208
|
+
getFilePaths(options: FinalizedBsConfig): Promise<import("roku-deploy").StandardizedFileEntry[]>;
|
|
175
209
|
/**
|
|
176
210
|
* 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
|
|
211
|
+
* Only `.brs` files can have typedef path, so return undefined for everything else
|
|
179
212
|
*/
|
|
180
213
|
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
214
|
/**
|
|
192
215
|
* Set a timeout for the specified milliseconds, and resolve the promise once the timeout is finished.
|
|
193
|
-
* @param milliseconds
|
|
216
|
+
* @param milliseconds the minimum number of milliseconds to sleep for
|
|
194
217
|
*/
|
|
195
218
|
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
219
|
/**
|
|
203
220
|
* Determines if the position is greater than the range. This means
|
|
204
221
|
* the position does not touch the range, and has a position greater than the end
|
|
@@ -207,40 +224,17 @@ export declare class Util {
|
|
|
207
224
|
*/
|
|
208
225
|
positionIsGreaterThanRange(position: Position, range: Range): boolean;
|
|
209
226
|
/**
|
|
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
|
|
227
|
+
* Get a range back from an object that contains (or is) a range
|
|
219
228
|
*/
|
|
220
|
-
|
|
221
|
-
range: Range;
|
|
222
|
-
}, second: {
|
|
223
|
-
range: Range;
|
|
224
|
-
}): boolean;
|
|
229
|
+
extractRange(rangeIsh: RangeLike): Range | undefined;
|
|
225
230
|
/**
|
|
226
231
|
* If the two items have lines that touch
|
|
227
|
-
* @param first
|
|
228
|
-
* @param second
|
|
229
|
-
*/
|
|
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
232
|
*/
|
|
239
|
-
|
|
233
|
+
linesTouch(first: RangeLike, second: RangeLike): boolean;
|
|
240
234
|
/**
|
|
241
235
|
* Find a script import that the current position touches, or undefined if not found
|
|
242
236
|
*/
|
|
243
|
-
getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference;
|
|
237
|
+
getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference | undefined;
|
|
244
238
|
/**
|
|
245
239
|
* Given the class name text, return a namespace-prefixed name.
|
|
246
240
|
* If the name already has a period in it, or the namespaceName was not provided, return the class name as is.
|
|
@@ -251,117 +245,263 @@ export declare class Util {
|
|
|
251
245
|
splitIntoLines(string: string): string[];
|
|
252
246
|
getTextForRange(string: string | string[], range: Range): string;
|
|
253
247
|
/**
|
|
254
|
-
* Helper for creating `
|
|
248
|
+
* Helper for creating `Location` objects. Prefer using this function because vscode-languageserver's `Location.create()` is significantly slower at scale
|
|
249
|
+
*/
|
|
250
|
+
createLocationFromRange(uri: string, range: Range): Location;
|
|
251
|
+
/**
|
|
252
|
+
* Helper for creating `Location` objects from a file and range
|
|
253
|
+
*/
|
|
254
|
+
createLocationFromFileRange(file: {
|
|
255
|
+
srcPath: string;
|
|
256
|
+
}, range: Range): Location;
|
|
257
|
+
/**
|
|
258
|
+
* 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
|
|
259
|
+
*/
|
|
260
|
+
createLocation(startLine: number, startCharacter: number, endLine: number, endCharacter: number, uri?: string): Location;
|
|
261
|
+
/**
|
|
262
|
+
* Helper for creating `Range` objects. Prefer using this function because vscode-languageserver's `Range.create()` is significantly slower.
|
|
255
263
|
*/
|
|
256
264
|
createRange(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range;
|
|
257
265
|
/**
|
|
258
266
|
* Create a `Range` from two `Position`s
|
|
259
267
|
*/
|
|
260
|
-
createRangeFromPositions(startPosition: Position, endPosition: Position): Range;
|
|
268
|
+
createRangeFromPositions(startPosition: Position, endPosition: Position): Range | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* Clone a range
|
|
271
|
+
*/
|
|
272
|
+
cloneLocation(location: Location): Location;
|
|
261
273
|
/**
|
|
262
|
-
*
|
|
263
|
-
* righthand range. Returns undefined if none of the items have a range.
|
|
274
|
+
* Clone every token
|
|
264
275
|
*/
|
|
265
|
-
|
|
276
|
+
cloneToken<T extends Token>(token: T): T;
|
|
277
|
+
/**
|
|
278
|
+
* Gets the bounding range of a bunch of ranges or objects that have ranges
|
|
279
|
+
* TODO: this does a full iteration of the args. If the args were guaranteed to be in range order, we could optimize this
|
|
280
|
+
*/
|
|
281
|
+
createBoundingLocation(...locatables: Array<{
|
|
282
|
+
location?: Location;
|
|
283
|
+
} | Location | {
|
|
266
284
|
range?: Range;
|
|
267
|
-
}>):
|
|
285
|
+
} | Range | undefined>): Location | undefined;
|
|
268
286
|
/**
|
|
269
|
-
*
|
|
287
|
+
* Gets the bounding range of a bunch of ranges or objects that have ranges
|
|
288
|
+
* TODO: this does a full iteration of the args. If the args were guaranteed to be in range order, we could optimize this
|
|
289
|
+
*/
|
|
290
|
+
createBoundingRange(...locatables: Array<RangeLike>): Range | undefined;
|
|
291
|
+
/**
|
|
292
|
+
* Gets the bounding range of an object that contains a bunch of tokens
|
|
293
|
+
* @param tokens Object with tokens in it
|
|
294
|
+
* @returns Range containing all the tokens
|
|
295
|
+
*/
|
|
296
|
+
createBoundingLocationFromTokens(tokens: Record<string, {
|
|
297
|
+
location?: Location;
|
|
298
|
+
}>): Location | undefined;
|
|
299
|
+
/**
|
|
300
|
+
* Create a `Position` object. Prefer this over `Position.create` for performance reasons.
|
|
270
301
|
*/
|
|
271
302
|
createPosition(line: number, character: number): {
|
|
272
303
|
line: number;
|
|
273
304
|
character: number;
|
|
274
305
|
};
|
|
275
306
|
/**
|
|
276
|
-
* Convert a
|
|
307
|
+
* Convert a token into a BscType
|
|
277
308
|
*/
|
|
278
|
-
|
|
309
|
+
tokenToBscType(token: Token): DynamicType | VoidType | ObjectType | InvalidType | BooleanType | DoubleType | FloatType | FunctionType | IntegerType | LongIntegerType | StringType;
|
|
279
310
|
/**
|
|
280
|
-
*
|
|
311
|
+
* Deciphers the correct types for fields based on docs
|
|
312
|
+
* https://developer.roku.com/en-ca/docs/references/scenegraph/xml-elements/interface.md
|
|
313
|
+
* @param typeDescriptor the type descriptor from the docs
|
|
314
|
+
* @returns {BscType} the known type, or dynamic
|
|
281
315
|
*/
|
|
282
|
-
|
|
316
|
+
getNodeFieldType(typeDescriptor: string, lookupTable?: SymbolTable): BscType;
|
|
317
|
+
/**
|
|
318
|
+
* Return the type of the result of a binary operator
|
|
319
|
+
* Note: compound assignments (eg. +=) internally use a binary expression, so that's why TokenKind.PlusEqual, etc. are here too
|
|
320
|
+
*/
|
|
321
|
+
binaryOperatorResultType(leftType: BscType, operator: Token, rightType: BscType): BscType;
|
|
322
|
+
getHighestPriorityType(types: BscType[], depth?: number): BscType;
|
|
323
|
+
/**
|
|
324
|
+
* Return the type of the result of a unary operator
|
|
325
|
+
*/
|
|
326
|
+
unaryOperatorResultType(operator: Token, exprType: BscType): BscType;
|
|
327
|
+
getUnboxedType(boxedType: BscType): BscType;
|
|
283
328
|
/**
|
|
284
329
|
* Get the extension for the given file path. Basically the part after the final dot, except for
|
|
285
330
|
* `d.bs` which is treated as single extension
|
|
331
|
+
* @returns the file extension (i.e. ".d.bs", ".bs", ".brs", ".xml", ".jpg", etc...)
|
|
286
332
|
*/
|
|
287
333
|
getExtension(filePath: string): string;
|
|
288
334
|
/**
|
|
289
335
|
* Load and return the list of plugins
|
|
290
336
|
*/
|
|
291
|
-
loadPlugins(cwd: string, pathOrModules: string[], onError?: (pathOrModule: string, err: Error) => void):
|
|
292
|
-
resolveRequire(cwd: string, pathOrModule: string): any;
|
|
337
|
+
loadPlugins(cwd: string, pathOrModules: string[], onError?: (pathOrModule: string, err: Error) => void): Plugin[];
|
|
293
338
|
/**
|
|
294
339
|
* Gathers expressions, variables, and unique names from an expression.
|
|
295
340
|
* This is mostly used for the ternary expression
|
|
296
341
|
*/
|
|
297
|
-
getExpressionInfo(expression: Expression): ExpressionInfo;
|
|
342
|
+
getExpressionInfo(expression: Expression, file: BrsFile): ExpressionInfo;
|
|
343
|
+
concatAnnotationLeadingTrivia(stmt: Statement): Token[];
|
|
298
344
|
/**
|
|
299
345
|
* Create a SourceNode that maps every line to itself. Useful for creating maps for files
|
|
300
346
|
* that haven't changed at all, but we still need the map
|
|
301
347
|
*/
|
|
302
348
|
simpleMap(source: string, src: string): SourceNode;
|
|
349
|
+
private isWindows;
|
|
350
|
+
private standardizePathCache;
|
|
351
|
+
private pathToURICache;
|
|
303
352
|
/**
|
|
304
|
-
*
|
|
353
|
+
* Converts a path into a standardized format (drive letter to lower, remove extra slashes, use single slash type, resolve relative parts, etc...)
|
|
305
354
|
*/
|
|
306
|
-
|
|
355
|
+
standardizePath(thePath: string): string;
|
|
307
356
|
/**
|
|
308
|
-
*
|
|
357
|
+
* Given a Diagnostic or BsDiagnostic, return a deep clone of the diagnostic.
|
|
358
|
+
* @param diagnostic the diagnostic to clone
|
|
359
|
+
* @param relatedInformationFallbackLocation a default location to use for all `relatedInformation` entries that are missing a location
|
|
309
360
|
*/
|
|
310
|
-
|
|
311
|
-
range: Range;
|
|
312
|
-
}, code: string | SourceNode | TranspileResult): SourceNode | undefined;
|
|
361
|
+
toDiagnostic(diagnostic: Diagnostic | BsDiagnostic, relatedInformationFallbackLocation: string): Diagnostic;
|
|
313
362
|
/**
|
|
314
|
-
*
|
|
363
|
+
* Sort an array of objects that have a Range
|
|
315
364
|
*/
|
|
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
|
-
};
|
|
365
|
+
sortByRange<T extends {
|
|
366
|
+
range: Range | undefined;
|
|
367
|
+
}>(locatables: T[]): T[];
|
|
333
368
|
/**
|
|
334
|
-
*
|
|
335
|
-
* @param params The list of callable parameters to check
|
|
336
|
-
* @returns the minimum and maximum number of allowed params
|
|
369
|
+
* Wrap the given code in a markdown code fence (with the language)
|
|
337
370
|
*/
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
371
|
+
mdFence(code: string, language?: string): string;
|
|
372
|
+
/**
|
|
373
|
+
* Gets each part of the dotted get.
|
|
374
|
+
* @param node any ast expression
|
|
375
|
+
* @returns an array of the parts of the dotted get. If not fully a dotted get, then returns undefined
|
|
376
|
+
*/
|
|
377
|
+
getAllDottedGetParts(node: AstNode): Identifier[] | undefined;
|
|
342
378
|
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* @return an array with callable containers - could be empty if nothing was found
|
|
379
|
+
* Given an expression, return all the DottedGet name parts as a string.
|
|
380
|
+
* Mostly used to convert namespaced item full names to a strings
|
|
346
381
|
*/
|
|
347
|
-
|
|
382
|
+
getAllDottedGetPartsAsString(node: Expression | Statement, parseMode?: ParseMode, lastSep?: string): string;
|
|
348
383
|
/**
|
|
349
|
-
*
|
|
384
|
+
* Break an expression into each part.
|
|
385
|
+
*/
|
|
386
|
+
splitExpression(expression: Expression): Expression[];
|
|
387
|
+
/**
|
|
388
|
+
* Returns an integer if valid, or undefined. Eliminates checking for NaN
|
|
389
|
+
*/
|
|
390
|
+
parseInt(value: any): number;
|
|
391
|
+
/**
|
|
392
|
+
* Converts a range to a string in the format 1:2-3:4
|
|
393
|
+
*/
|
|
394
|
+
rangeToString(range: Range): string;
|
|
395
|
+
validateTooDeepFile(file: (BrsFile | XmlFile)): void;
|
|
396
|
+
/**
|
|
397
|
+
* Execute dispose for a series of disposable items
|
|
398
|
+
* @param disposables a list of functions or disposables
|
|
399
|
+
*/
|
|
400
|
+
applyDispose(disposables: DisposableLike[]): void;
|
|
401
|
+
/**
|
|
402
|
+
* Race a series of promises, and return the first one that resolves AND matches the matcher function.
|
|
403
|
+
* If all of the promises reject, then this will emit an AggregatreError with all of the errors.
|
|
404
|
+
* If at least one promise resolves, then this will log all of the errors to the console
|
|
405
|
+
* If at least one promise resolves but none of them match the matcher, then this will return undefined.
|
|
406
|
+
* @param promises all of the promises to race
|
|
407
|
+
* @param matcher a function that should return true if this value should be kept. Returning any value other than true means `false`
|
|
408
|
+
* @returns the first resolved value that matches the matcher, or undefined if none of them match
|
|
409
|
+
*/
|
|
410
|
+
promiseRaceMatch<T>(promises: MaybePromise<T>[], matcher: (value: T) => boolean): Promise<T>;
|
|
411
|
+
/**
|
|
412
|
+
* Wraps SourceNode's constructor to be compatible with the TranspileResult type
|
|
350
413
|
*/
|
|
351
|
-
|
|
414
|
+
sourceNodeFromTranspileResult(line: number | null, column: number | null, source: string | null, chunks?: string | SourceNode | TranspileResult, name?: string): SourceNode;
|
|
352
415
|
/**
|
|
353
|
-
*
|
|
354
|
-
* Only works for single-line strings
|
|
416
|
+
* Find the index of the last item in the array that matches.
|
|
355
417
|
*/
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
418
|
+
findLastIndex<T>(array: T[], matcher: (T: any) => boolean): number;
|
|
419
|
+
processTypeChain(typeChain: TypeChainEntry[]): TypeChainProcessResult;
|
|
420
|
+
getCircularReferenceDiagnosticDetail(circularReferenceInfo: TypeCircularReferenceInfo, defaultName?: string): string[];
|
|
421
|
+
isInTypeExpression(expression: AstNode): boolean;
|
|
422
|
+
/**
|
|
423
|
+
* Parse the `sourceMappingURL` comment from file contents and resolve it to a RawSourceMap.
|
|
424
|
+
* Handles inline base64 data URIs, absolute paths, relative paths (resolved against srcPath's
|
|
425
|
+
* directory), and falls back to a co-located `<srcPath>.map` file.
|
|
426
|
+
* Supports both BrightScript-style comments (`'//# sourceMappingURL=...`) and XML-style
|
|
427
|
+
* comments (`<!--//# sourceMappingURL=... -->`).
|
|
428
|
+
* Returns undefined if no map can be found.
|
|
429
|
+
*/
|
|
430
|
+
resolveInputSourceMap(fileContents: string, srcPath: string): Promise<RawSourceMap | undefined>;
|
|
431
|
+
/**
|
|
432
|
+
* Apply an input sourcemap to a generated SourceMapGenerator, chaining mappings so the
|
|
433
|
+
* output traces back through the input map to the original source.
|
|
434
|
+
*/
|
|
435
|
+
applySourceMap(generator: SourceMapGenerator, inputMap: RawSourceMap, sourceFile: string): Promise<void>;
|
|
436
|
+
/**
|
|
437
|
+
* Chain a prebuild input sourcemap (loaded from a co-located `.map` file or a
|
|
438
|
+
* `sourceMappingURL` comment in the file contents) onto an existing serialized output
|
|
439
|
+
* sourcemap. Returns the chained sourcemap as a JSON string. If no input map is found,
|
|
440
|
+
* the original output map JSON is returned unchanged.
|
|
441
|
+
*/
|
|
442
|
+
chainInputSourceMap(outputMapJson: string, file: {
|
|
443
|
+
fileContents?: string;
|
|
444
|
+
srcPath: string;
|
|
445
|
+
}): Promise<string>;
|
|
446
|
+
isBuiltInType(typeName: string): boolean;
|
|
447
|
+
isGenericNodeType(type: BscType): boolean;
|
|
448
|
+
hasAnyRequiredSymbolChanged(requiredSymbols: UnresolvedSymbol[], changedSymbols: Map<SymbolTypeFlag, Set<string>>): boolean;
|
|
449
|
+
setContainsUnresolvedSymbol(symbolLowerNameSet: Set<string>, symbol: UnresolvedSymbol): boolean;
|
|
450
|
+
getCustomTypesInSymbolTree(setToFill: Set<BscType>, type: BscType, filter?: (t: BscType) => boolean): void;
|
|
451
|
+
truncate<T>(options: {
|
|
452
|
+
leadingText: string;
|
|
453
|
+
items: T[];
|
|
454
|
+
trailingText?: string;
|
|
455
|
+
maxLength: number;
|
|
456
|
+
itemSeparator?: string;
|
|
457
|
+
partBuilder?: (item: T) => string;
|
|
458
|
+
}): string;
|
|
459
|
+
getAstNodeFriendlyName(node: AstNode): string;
|
|
460
|
+
hasLeadingComments(input: Token | AstNode): boolean;
|
|
461
|
+
getLeadingComments(input: Token | AstNode): Token[];
|
|
462
|
+
isLeadingCommentOnSameLine(line: RangeLike, input: Token | AstNode): boolean;
|
|
463
|
+
isClassUsedAsFunction(potentialClassType: BscType, expression: Expression, options: GetTypeOptions): boolean;
|
|
464
|
+
getSpecialCaseCallExpressionReturnType(callExpr: CallExpression, options: GetSymbolTypeOptions): BscType;
|
|
465
|
+
getCallFuncType(callExpr: CallExpression | CallfuncExpression, methodNameToken: Token | Identifier, options: GetSymbolTypeOptions): BscType;
|
|
466
|
+
isUnionOfFunctions(type: BscType, allowReferenceTypes?: boolean): type is UnionType;
|
|
467
|
+
isIntersectionOfFunctions(type: BscType, allowReferenceTypes?: boolean): type is IntersectionType;
|
|
468
|
+
getFunctionTypeFromUnion(type: BscType): BscType;
|
|
469
|
+
getFunctionTypeFromIntersection(type: BscType): BscType;
|
|
470
|
+
getReturnTypeOfUnionOfFunctions(type: UnionType): BscType;
|
|
471
|
+
getReturnTypeOfIntersectionOfFunctions(type: IntersectionType): BscType;
|
|
472
|
+
symbolComesFromSameNode(symbolName: string, definingNode: AstNode, symbolTable: SymbolTable): boolean;
|
|
473
|
+
isCalleeMemberOfNamespace(symbolName: string, nodeWhereUsed: AstNode, namespace?: NamespaceStatement): boolean;
|
|
474
|
+
isVariableMemberOfNamespace(symbolName: string, nodeWhereUsed: AstNode, namespace?: NamespaceStatement): boolean;
|
|
475
|
+
isVariableShadowingSomething(symbolName: string, nodeWhereUsed: AstNode): boolean;
|
|
476
|
+
chooseTypeFromCodeOrDocComment(codeType: BscType, docType: BscType, options: GetTypeOptions): BscType;
|
|
477
|
+
/**
|
|
478
|
+
* Gets the type for a default value (eg. as a function param, class member or typed array)
|
|
479
|
+
*/
|
|
480
|
+
getDefaultTypeFromValueType(valueType: (BscType | BscType[])): BscType;
|
|
481
|
+
/**
|
|
482
|
+
* Get the default type for an iterator of the given type
|
|
483
|
+
* Used for `for each` loops
|
|
484
|
+
*/
|
|
485
|
+
getIteratorDefaultType(iteratorType: BscType): BscType;
|
|
486
|
+
/**
|
|
487
|
+
* Get a short name that can be used to reference the project in logs. (typically something like `prj1`, `prj8`, etc...)
|
|
488
|
+
*/
|
|
489
|
+
getProjectLogName(config: {
|
|
490
|
+
projectNumber: number;
|
|
491
|
+
}): string;
|
|
360
492
|
}
|
|
361
493
|
/**
|
|
362
494
|
* 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
495
|
* we can't use `object.tag` syntax.
|
|
364
496
|
*/
|
|
365
497
|
export declare function standardizePath(stringParts: any, ...expressions: any[]): string;
|
|
498
|
+
/**
|
|
499
|
+
* An item that can be coerced into a `Range`
|
|
500
|
+
*/
|
|
501
|
+
export declare type RangeLike = {
|
|
502
|
+
location?: Location;
|
|
503
|
+
} | Location | {
|
|
504
|
+
range?: Range;
|
|
505
|
+
} | Range | undefined;
|
|
366
506
|
export declare let util: Util;
|
|
367
507
|
export default util;
|