brighterscript 1.0.0-alpha.23 → 1.0.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +585 -218
- package/README.md +45 -139
- package/bsconfig.schema.json +41 -0
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +25 -0
- package/dist/AstValidationSegmenter.js +152 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +39 -4
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +7 -0
- package/dist/CacheVerifier.js +20 -0
- package/dist/CacheVerifier.js.map +1 -0
- package/dist/CodeActionUtil.d.ts +3 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +3 -2
- package/dist/CommentFlagProcessor.js +5 -4
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.d.ts +3 -2
- package/dist/DependencyGraph.js +11 -10
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.js +9 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +1 -0
- package/dist/DiagnosticFilterer.js +5 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +79 -15
- package/dist/DiagnosticMessages.js +134 -21
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +41 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -0
- package/dist/FunctionScope.d.ts +28 -0
- package/dist/FunctionScope.js +52 -0
- package/dist/FunctionScope.js.map +1 -0
- package/dist/KeyedThrottler.d.ts +3 -3
- package/dist/KeyedThrottler.js +3 -3
- package/dist/KeyedThrottler.js.map +1 -1
- package/dist/LanguageServer.d.ts +23 -11
- package/dist/LanguageServer.js +222 -87
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +11 -3
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +21 -3
- package/dist/PluginInterface.js +74 -6
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +162 -81
- package/dist/Program.js +903 -732
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +22 -12
- package/dist/ProgramBuilder.js +132 -104
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +95 -134
- package/dist/Scope.js +477 -551
- package/dist/Scope.js.map +1 -1
- package/dist/Stopwatch.js +1 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +95 -29
- package/dist/SymbolTable.js +256 -102
- package/dist/SymbolTable.js.map +1 -1
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +4 -6
- package/dist/XmlScope.js +74 -68
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +48 -0
- package/dist/astUtils/CachedLookups.js +323 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +9 -5
- package/dist/astUtils/{AstEditor.js → Editor.js} +10 -4
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +68 -64
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +10 -10
- package/dist/astUtils/creators.js +26 -16
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +5 -5
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +132 -100
- package/dist/astUtils/reflection.js +225 -166
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +208 -126
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +12 -12
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +54 -35
- package/dist/astUtils/visitors.js +29 -3
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +178 -33
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +9 -9
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +12 -2
- package/dist/bscPlugin/BscPlugin.js +41 -3
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +131 -0
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
- package/dist/bscPlugin/FileWriter.d.ts +6 -0
- package/dist/bscPlugin/FileWriter.js +24 -0
- package/dist/bscPlugin/FileWriter.js.map +1 -0
- package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
- package/dist/bscPlugin/SignatureHelpUtil.js +135 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +21 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +86 -12
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +57 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +544 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1909 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +17 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +188 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +513 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +3 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +102 -29
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +167 -6
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.d.ts +1 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
- package/dist/bscPlugin/serialize/BslibManager.js +40 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +16 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +123 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +12 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +99 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +22 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +316 -29
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +264 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +10 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +32 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +56 -8
- package/dist/bscPlugin/validation/ScopeValidator.js +514 -116
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2454 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.d.ts +8 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +44 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +107 -8
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +3 -3
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +8 -2
- package/dist/diagnosticUtils.js +47 -17
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -10
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +26 -0
- package/dist/files/AssetFile.js +26 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +529 -486
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +124 -112
- package/dist/files/BrsFile.js +819 -1131
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1869 -1277
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +104 -0
- package/dist/files/BscFile.js +16 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +20 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/LazyFileData.spec.d.ts +1 -0
- package/dist/files/LazyFileData.spec.js +27 -0
- package/dist/files/LazyFileData.spec.js.map +1 -0
- package/dist/files/XmlFile.d.ts +70 -32
- package/dist/files/XmlFile.js +106 -117
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +325 -262
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +49 -41
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +104 -40
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +16 -18
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +440 -150
- package/dist/interfaces.js +27 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Character.spec.js +5 -5
- package/dist/lexer/Character.spec.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +12 -5
- package/dist/lexer/Lexer.js +28 -13
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +187 -134
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +9 -1
- package/dist/lexer/Token.js +9 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +9 -0
- package/dist/lexer/TokenKind.js +30 -5
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +162 -0
- package/dist/parser/AstNode.js +225 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +165 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +4 -7
- package/dist/parser/BrsTranspileState.js +4 -12
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +126 -167
- package/dist/parser/Expression.js +524 -394
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +152 -146
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +45 -196
- package/dist/parser/Parser.js +470 -926
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1034 -805
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +9 -8
- package/dist/parser/SGParser.js +10 -8
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +27 -38
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +98 -35
- package/dist/parser/SGTypes.js +169 -99
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +208 -122
- package/dist/parser/Statement.js +599 -364
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +45 -21
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +7 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +3 -2
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +33 -23
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +25 -20
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +96 -94
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +22 -16
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +8 -8
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +58 -21
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +61 -20
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +8 -8
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +129 -21
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +5 -5
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +36 -36
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +67 -22
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +123 -81
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +12 -12
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/Relational.spec.js +13 -13
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +221 -81
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +287 -105
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TypeExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js +127 -0
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +262 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/Continue.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Continue.spec.js +119 -0
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -0
- package/dist/parser/tests/statement/Declaration.spec.js +19 -19
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +22 -22
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +111 -300
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +9 -10
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +8 -9
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/Function.spec.js +44 -35
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +5 -5
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +20 -20
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +30 -196
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +16 -78
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +107 -90
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +14 -12
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +48 -35
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +6 -6
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +6 -6
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +18 -16
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +3 -3
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.js +8 -8
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +5 -6
- package/dist/preprocessor/Preprocessor.js +15 -11
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +25 -25
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
- package/dist/preprocessor/PreprocessorParser.js +7 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/roku-types/data.json +6544 -10519
- package/dist/roku-types/index.d.ts +662 -1934
- package/dist/types/ArrayType.d.ts +10 -9
- package/dist/types/ArrayType.js +65 -60
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +36 -68
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +11 -0
- package/dist/types/AssociativeArrayType.js +52 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +9 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +8 -5
- package/dist/types/BooleanType.js +14 -7
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -6
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +32 -21
- package/dist/types/BscType.js +118 -21
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +25 -0
- package/dist/types/BscTypeKind.js +30 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
- package/dist/types/BuiltInInterfaceAdder.js +164 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +58 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +77 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +26 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +8 -5
- package/dist/types/DoubleType.js +18 -16
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -6
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +10 -5
- package/dist/types/DynamicType.js +16 -4
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +16 -5
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +30 -12
- package/dist/types/EnumType.js +43 -17
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/EnumType.spec.d.ts +1 -0
- package/dist/types/EnumType.spec.js +33 -0
- package/dist/types/EnumType.spec.js.map +1 -0
- package/dist/types/FloatType.d.ts +8 -5
- package/dist/types/FloatType.js +18 -16
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -6
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +13 -8
- package/dist/types/FunctionType.js +30 -14
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +152 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +8 -5
- package/dist/types/IntegerType.js +18 -16
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -6
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +12 -13
- package/dist/types/InterfaceType.js +20 -48
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +90 -56
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +7 -5
- package/dist/types/InvalidType.js +13 -7
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -6
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +8 -5
- package/dist/types/LongIntegerType.js +17 -15
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -6
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +12 -0
- package/dist/types/NamespaceType.js +28 -0
- package/dist/types/NamespaceType.js.map +1 -0
- package/dist/types/ObjectType.d.ts +9 -8
- package/dist/types/ObjectType.js +21 -11
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +3 -3
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +63 -0
- package/dist/types/ReferenceType.js +423 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +137 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +11 -5
- package/dist/types/StringType.js +18 -7
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -5
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +22 -17
- package/dist/types/TypedFunctionType.js +78 -60
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/TypedFunctionType.spec.js +105 -20
- package/dist/types/TypedFunctionType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +8 -6
- package/dist/types/UninitializedType.js +13 -7
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +123 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +130 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +8 -5
- package/dist/types/VoidType.js +14 -7
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +3 -3
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helper.spec.d.ts +1 -0
- package/dist/types/helper.spec.js +145 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +19 -37
- package/dist/types/helpers.js +159 -99
- package/dist/types/helpers.js.map +1 -1
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util.d.ts +167 -131
- package/dist/util.js +890 -350
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +7 -25
- package/dist/validators/ClassValidator.js +103 -194
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +165 -149
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.d.ts +0 -8
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +0 -40
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -32
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/parser/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -12
- package/dist/types/CustomType.js +0 -44
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -16
- package/dist/types/LazyType.js +0 -44
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
package/dist/util.d.ts
CHANGED
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { BsConfig } from './BsConfig';
|
|
3
|
-
import type { CallableContainer, BsDiagnostic, FileReference, CallableContainerMap, CompilerPlugin, ExpressionInfo,
|
|
1
|
+
import { type Diagnostic, type Position, type Range, type Location } from 'vscode-languageserver';
|
|
2
|
+
import type { BsConfig, FinalizedBsConfig } from './BsConfig';
|
|
3
|
+
import type { CallableContainer, BsDiagnostic, FileReference, CallableContainerMap, CompilerPlugin, ExpressionInfo, TypeChainEntry, TypeChainProcessResult } from './interfaces';
|
|
4
4
|
import { BooleanType } from './types/BooleanType';
|
|
5
5
|
import { DoubleType } from './types/DoubleType';
|
|
6
6
|
import { DynamicType } from './types/DynamicType';
|
|
7
7
|
import { FloatType } from './types/FloatType';
|
|
8
8
|
import { IntegerType } from './types/IntegerType';
|
|
9
|
-
import { InvalidType } from './types/InvalidType';
|
|
10
9
|
import { LongIntegerType } from './types/LongIntegerType';
|
|
10
|
+
import { ObjectType } from './types/ObjectType';
|
|
11
11
|
import { StringType } from './types/StringType';
|
|
12
12
|
import { VoidType } from './types/VoidType';
|
|
13
|
-
import
|
|
13
|
+
import { ParseMode } from './parser/Parser';
|
|
14
|
+
import type { DottedGetExpression, VariableExpression } from './parser/Expression';
|
|
14
15
|
import type { Identifier, Locatable, Token } from './lexer/Token';
|
|
15
16
|
import { SourceNode } from 'source-map';
|
|
16
|
-
import {
|
|
17
|
+
import type { BrsFile } from './files/BrsFile';
|
|
18
|
+
import type { XmlFile } from './files/XmlFile';
|
|
19
|
+
import type { AstNode } from './parser/AstNode';
|
|
20
|
+
import { type Expression, type Statement } from './parser/AstNode';
|
|
17
21
|
import type { BscType } from './types/BscType';
|
|
18
22
|
import { FunctionType } from './types/FunctionType';
|
|
23
|
+
import type { SymbolTable } from './SymbolTable';
|
|
24
|
+
import type { UnresolvedSymbol } from './AstValidationSegmenter';
|
|
19
25
|
export declare class Util {
|
|
20
26
|
clearConsole(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the number of parent directories in the filPath
|
|
29
|
+
*/
|
|
30
|
+
getParentDirectoryCount(filePath: string | undefined): number;
|
|
21
31
|
/**
|
|
22
32
|
* Determine if the file exists
|
|
23
|
-
* @param filePath
|
|
24
33
|
*/
|
|
25
34
|
pathExists(filePath: string | undefined): Promise<boolean>;
|
|
26
35
|
/**
|
|
27
36
|
* Determine if the file exists
|
|
28
|
-
* @param filePath
|
|
29
37
|
*/
|
|
30
38
|
pathExistsSync(filePath: string | undefined): boolean;
|
|
31
39
|
/**
|
|
@@ -40,77 +48,73 @@ export declare class Util {
|
|
|
40
48
|
* Determine if the given path starts with a protocol
|
|
41
49
|
*/
|
|
42
50
|
startsWithProtocol(path: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Given a pkg path of any kind, transform it to a roku-specific pkg path (i.e. "pkg:/some/path.brs")
|
|
53
|
+
* @deprecated use `sanitizePkgPath instead. Will be removed in v1
|
|
54
|
+
*/
|
|
55
|
+
getRokuPkgPath(pkgPath: string): string;
|
|
43
56
|
/**
|
|
44
57
|
* Given a path to a file/directory, replace all path separators with the current system's version.
|
|
45
|
-
* @param filePath
|
|
46
58
|
*/
|
|
47
59
|
pathSepNormalize(filePath: string, separator?: string): string;
|
|
48
60
|
/**
|
|
49
61
|
* Find the path to the config file.
|
|
50
62
|
* If the config file path doesn't exist
|
|
51
|
-
* @param
|
|
63
|
+
* @param cwd the current working directory where the search for configs should begin
|
|
52
64
|
*/
|
|
53
65
|
getConfigFilePath(cwd?: string): string;
|
|
54
66
|
getRangeFromOffsetLength(text: string, offset: number, length: number): Range;
|
|
55
67
|
/**
|
|
56
68
|
* Load the contents of a config file.
|
|
57
69
|
* If the file extends another config, this will load the base config as well.
|
|
58
|
-
* @param configFilePath
|
|
59
|
-
* @param parentProjectPaths
|
|
70
|
+
* @param configFilePath the relative or absolute path to a brighterscript config json file
|
|
71
|
+
* @param parentProjectPaths a list of parent config files. This is used by this method to recursively build the config list
|
|
60
72
|
*/
|
|
61
|
-
loadConfigFile(configFilePath: string, parentProjectPaths?: string[], cwd?: string): BsConfig;
|
|
73
|
+
loadConfigFile(configFilePath: string | undefined, parentProjectPaths?: string[], cwd?: string): BsConfig | undefined;
|
|
62
74
|
/**
|
|
63
75
|
* Convert relative paths to absolute paths, relative to the given directory. Also de-dupes the paths. Modifies the array in-place
|
|
64
|
-
* @param
|
|
76
|
+
* @param collection usually a bsconfig.
|
|
77
|
+
* @param key a key of the config to read paths from (usually this is `'plugins'` or `'require'`)
|
|
65
78
|
* @param relativeDir the path to the folder where the paths should be resolved relative to. This should be an absolute path
|
|
66
79
|
*/
|
|
67
80
|
resolvePathsRelativeTo(collection: any, key: string, relativeDir: string): void;
|
|
68
81
|
/**
|
|
69
82
|
* Do work within the scope of a changed current working directory
|
|
70
|
-
* @param targetCwd
|
|
71
|
-
* @param callback
|
|
83
|
+
* @param targetCwd the cwd where the work should be performed
|
|
84
|
+
* @param callback a function to call when the cwd has been changed to `targetCwd`
|
|
72
85
|
*/
|
|
73
86
|
cwdWork<T>(targetCwd: string | null | undefined, callback: () => T): T;
|
|
74
87
|
/**
|
|
75
88
|
* Given a BsConfig object, start with defaults,
|
|
76
89
|
* merge with bsconfig.json and the provided options.
|
|
77
|
-
* @param config
|
|
90
|
+
* @param config a bsconfig object to use as the baseline for the resulting config
|
|
78
91
|
*/
|
|
79
|
-
normalizeAndResolveConfig(config: BsConfig):
|
|
92
|
+
normalizeAndResolveConfig(config: BsConfig | undefined): FinalizedBsConfig;
|
|
80
93
|
/**
|
|
81
94
|
* Set defaults for any missing items
|
|
82
|
-
* @param config
|
|
95
|
+
* @param config a bsconfig object to use as the baseline for the resulting config
|
|
83
96
|
*/
|
|
84
|
-
normalizeConfig(config: BsConfig):
|
|
97
|
+
normalizeConfig(config: BsConfig | undefined): FinalizedBsConfig;
|
|
85
98
|
/**
|
|
86
99
|
* Get the root directory from options.
|
|
87
100
|
* Falls back to options.cwd.
|
|
88
101
|
* Falls back to process.cwd
|
|
89
|
-
* @param options
|
|
102
|
+
* @param options a bsconfig object
|
|
90
103
|
*/
|
|
91
104
|
getRootDir(options: BsConfig): string;
|
|
92
|
-
/**
|
|
93
|
-
* Format a string with placeholders replaced by argument indexes
|
|
94
|
-
* @param subject
|
|
95
|
-
* @param params
|
|
96
|
-
*/
|
|
97
|
-
stringFormat(subject: string, ...args: any[]): string;
|
|
98
105
|
/**
|
|
99
106
|
* Given a list of callables as a dictionary indexed by their full name (namespace included, transpiled to underscore-separated.
|
|
100
|
-
* @param callables
|
|
101
107
|
*/
|
|
102
108
|
getCallableContainersByLowerName(callables: CallableContainer[]): CallableContainerMap;
|
|
103
109
|
/**
|
|
104
110
|
* Split a file by newline characters (LF or CRLF)
|
|
105
|
-
* @param text
|
|
106
111
|
*/
|
|
107
112
|
getLines(text: string): string[];
|
|
108
113
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* @param targetPath a full pkgPath, or a path relative to the containing file
|
|
114
|
+
* Given an absolute path to a source file, and a target path,
|
|
115
|
+
* compute the pkg path for the target relative to the source file's location
|
|
112
116
|
*/
|
|
113
|
-
getPkgPathFromTarget(
|
|
117
|
+
getPkgPathFromTarget(containingFilePathAbsolute: string, targetPath: string): string;
|
|
114
118
|
/**
|
|
115
119
|
* Compute the relative path from the source file to the target file
|
|
116
120
|
* @param pkgSrcPath - the absolute path to the source, where cwd is the package location
|
|
@@ -122,34 +126,64 @@ export declare class Util {
|
|
|
122
126
|
*/
|
|
123
127
|
findBeginningVariableExpression(dottedGet: DottedGetExpression): VariableExpression | undefined;
|
|
124
128
|
/**
|
|
125
|
-
*
|
|
129
|
+
* Do `a` and `b` overlap by at least one character. This returns false if they are at the edges. Here's some examples:
|
|
130
|
+
* ```
|
|
131
|
+
* | true | true | true | true | true | false | false | false | false |
|
|
132
|
+
* |------|------|------|------|------|-------|-------|-------|-------|
|
|
133
|
+
* | aa | aaa | aaa | aaa | a | aa | aa | a | a |
|
|
134
|
+
* | bbb | bb | bbb | b | bbb | bb | bb | b | a |
|
|
135
|
+
* ```
|
|
126
136
|
*/
|
|
127
|
-
rangesIntersect(a: Range, b: Range): boolean;
|
|
137
|
+
rangesIntersect(a: Range | undefined, b: Range | undefined): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Do `a` and `b` overlap by at least one character or touch at the edges
|
|
140
|
+
* ```
|
|
141
|
+
* | true | true | true | true | true | true | true | false | false |
|
|
142
|
+
* |------|------|------|------|------|-------|-------|-------|-------|
|
|
143
|
+
* | aa | aaa | aaa | aaa | a | aa | aa | a | a |
|
|
144
|
+
* | bbb | bb | bbb | b | bbb | bb | bb | b | a |
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
rangesIntersectOrTouch(a: Range | undefined, b: Range | undefined): boolean;
|
|
128
148
|
/**
|
|
129
149
|
* Test if `position` is in `range`. If the position is at the edges, will return true.
|
|
130
150
|
* Adapted from core vscode
|
|
131
|
-
* @param range
|
|
132
|
-
* @param position
|
|
133
151
|
*/
|
|
134
|
-
rangeContains(range: Range, position: Position): boolean;
|
|
135
|
-
comparePositionToRange(position: Position, range: Range): 1 | -1 | 0;
|
|
152
|
+
rangeContains(range: Range | undefined, position: Position | undefined): boolean;
|
|
153
|
+
comparePositionToRange(position: Position | undefined, range: Range | undefined): 1 | -1 | 0;
|
|
154
|
+
/**
|
|
155
|
+
* Combine all the documentation found before a token (i.e. comment tokens)
|
|
156
|
+
*/
|
|
157
|
+
getTokenDocumentation(tokens: Token[], token?: Token): string;
|
|
158
|
+
/**
|
|
159
|
+
* Combine all the documentation for a node - uses the AstNode's leadingTrivia property
|
|
160
|
+
*/
|
|
161
|
+
getNodeDocumentation(node: AstNode): string;
|
|
162
|
+
/**
|
|
163
|
+
* Prefixes a component name so it can be used as type in the symbol table, without polluting available symbols
|
|
164
|
+
*
|
|
165
|
+
* @param sgNodeName the Name of the component
|
|
166
|
+
* @returns the node name, prefixed with `roSGNode`
|
|
167
|
+
*/
|
|
168
|
+
getSgNodeTypeName(sgNodeName: string): string;
|
|
136
169
|
/**
|
|
137
170
|
* Parse an xml file and get back a javascript object containing its results
|
|
138
|
-
* @param text
|
|
139
171
|
*/
|
|
140
172
|
parseXml(text: string): Promise<any>;
|
|
141
173
|
propertyCount(object: Record<string, unknown>): number;
|
|
142
174
|
padLeft(subject: string, totalLength: number, char: string): string;
|
|
143
175
|
/**
|
|
144
176
|
* Given a URI, convert that to a regular fs path
|
|
145
|
-
* @param uri
|
|
146
177
|
*/
|
|
147
178
|
uriToPath(uri: string): string;
|
|
148
179
|
/**
|
|
149
180
|
* Force the drive letter to lower case
|
|
150
|
-
* @param fullPath
|
|
151
181
|
*/
|
|
152
182
|
driveLetterToLower(fullPath: string): string;
|
|
183
|
+
/**
|
|
184
|
+
* Replace the first instance of `search` in `subject` with `replacement`
|
|
185
|
+
*/
|
|
186
|
+
replaceCaseInsensitive(subject: string, search: string, replacement: string): string;
|
|
153
187
|
/**
|
|
154
188
|
* Determine if two arrays containing primitive values are equal.
|
|
155
189
|
* This considers order and compares by equality.
|
|
@@ -157,45 +191,40 @@ export declare class Util {
|
|
|
157
191
|
areArraysEqual(arr1: any[], arr2: any[]): boolean;
|
|
158
192
|
/**
|
|
159
193
|
* Given a file path, convert it to a URI string
|
|
160
|
-
* @param srcPath The absolute path to the source file on disk
|
|
161
194
|
*/
|
|
162
|
-
pathToUri(
|
|
195
|
+
pathToUri(filePath: string): string;
|
|
163
196
|
/**
|
|
164
197
|
* Get the outDir from options, taking into account cwd and absolute outFile paths
|
|
165
|
-
* @param options
|
|
166
198
|
*/
|
|
167
|
-
getOutDir(options:
|
|
199
|
+
getOutDir(options: FinalizedBsConfig): string;
|
|
168
200
|
/**
|
|
169
201
|
* Get paths to all files on disc that match this project's source list
|
|
170
202
|
*/
|
|
171
|
-
getFilePaths(options:
|
|
203
|
+
getFilePaths(options: FinalizedBsConfig): Promise<import("roku-deploy").StandardizedFileEntry[]>;
|
|
172
204
|
/**
|
|
173
205
|
* Given a path to a brs file, compute the path to a theoretical d.bs file.
|
|
174
|
-
* Only `.brs` files can have
|
|
175
|
-
* @param brsSrcPath The absolute path to the .brs source file on disk
|
|
206
|
+
* Only `.brs` files can have typedef path, so return undefined for everything else
|
|
176
207
|
*/
|
|
177
208
|
getTypedefPath(brsSrcPath: string): string;
|
|
178
209
|
/**
|
|
179
210
|
* Determine whether this diagnostic should be supressed or not, based on brs comment-flags
|
|
180
|
-
* @param diagnostic
|
|
181
211
|
*/
|
|
182
212
|
diagnosticIsSuppressed(diagnostic: BsDiagnostic): boolean;
|
|
183
213
|
/**
|
|
184
|
-
* Walks up the chain
|
|
185
|
-
* @param currentPath
|
|
214
|
+
* Walks up the chain to find the closest bsconfig.json file
|
|
186
215
|
*/
|
|
187
|
-
findClosestConfigFile(currentPath: string): Promise<string>;
|
|
216
|
+
findClosestConfigFile(currentPath: string): Promise<string | undefined>;
|
|
188
217
|
/**
|
|
189
218
|
* Set a timeout for the specified milliseconds, and resolve the promise once the timeout is finished.
|
|
190
|
-
* @param milliseconds
|
|
219
|
+
* @param milliseconds the minimum number of milliseconds to sleep for
|
|
191
220
|
*/
|
|
192
221
|
sleep(milliseconds: number): Promise<unknown>;
|
|
193
222
|
/**
|
|
194
223
|
* Given an array, map and then flatten
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
224
|
+
* @param array the array to flatMap over
|
|
225
|
+
* @param callback a function that is called for every array item
|
|
197
226
|
*/
|
|
198
|
-
flatMap<T, R>(array: T[],
|
|
227
|
+
flatMap<T, R>(array: T[], callback: (arg: T) => R[]): R[];
|
|
199
228
|
/**
|
|
200
229
|
* Determines if the position is greater than the range. This means
|
|
201
230
|
* the position does not touch the range, and has a position greater than the end
|
|
@@ -221,8 +250,6 @@ export declare class Util {
|
|
|
221
250
|
}): boolean;
|
|
222
251
|
/**
|
|
223
252
|
* If the two items have lines that touch
|
|
224
|
-
* @param first
|
|
225
|
-
* @param second
|
|
226
253
|
*/
|
|
227
254
|
linesTouch(first: {
|
|
228
255
|
range: Range;
|
|
@@ -237,7 +264,7 @@ export declare class Util {
|
|
|
237
264
|
/**
|
|
238
265
|
* Find a script import that the current position touches, or undefined if not found
|
|
239
266
|
*/
|
|
240
|
-
getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference;
|
|
267
|
+
getScriptImportAtPosition(scriptImports: FileReference[], position: Position): FileReference | undefined;
|
|
241
268
|
/**
|
|
242
269
|
* Given the class name text, return a namespace-prefixed name.
|
|
243
270
|
* If the name already has a period in it, or the namespaceName was not provided, return the class name as is.
|
|
@@ -248,7 +275,16 @@ export declare class Util {
|
|
|
248
275
|
splitIntoLines(string: string): string[];
|
|
249
276
|
getTextForRange(string: string | string[], range: Range): string;
|
|
250
277
|
/**
|
|
251
|
-
* Helper for creating `
|
|
278
|
+
* Helper for creating `Location` objects. Prefer using this function because vscode-languageserver's `Location.create()` is significantly slower at scale
|
|
279
|
+
*/
|
|
280
|
+
createLocation(uri: string, range: Range): Location;
|
|
281
|
+
/**
|
|
282
|
+
* A cache of `Range` objects. The key is a 52bit integer created from the 4 range integers and leveraging bitshifting.
|
|
283
|
+
* The whole point of this cache is to reduce garbage collection churn, so we didn't want to use string concatenation for the key
|
|
284
|
+
*/
|
|
285
|
+
private rangeCache;
|
|
286
|
+
/**
|
|
287
|
+
* Helper for creating `Range` objects. Prefer using this function because vscode-languageserver's `Range.create()` is significantly slower
|
|
252
288
|
*/
|
|
253
289
|
createRange(startLine: number, startCharacter: number, endLine: number, endCharacter: number): Range;
|
|
254
290
|
/**
|
|
@@ -261,14 +297,16 @@ export declare class Util {
|
|
|
261
297
|
*/
|
|
262
298
|
createBoundingRange(...locatables: Array<{
|
|
263
299
|
range?: Range;
|
|
264
|
-
}>): Range;
|
|
300
|
+
}>): Range | undefined;
|
|
301
|
+
/**
|
|
302
|
+
* A cache of `Position` objects. The key is a 26bit integer created from line and character and leveraging bitshifting
|
|
303
|
+
* The whole point of this cache is to reduce garbage collection churn, so we didn't want to use string concatenation for the key
|
|
304
|
+
*/
|
|
305
|
+
private positionCache;
|
|
265
306
|
/**
|
|
266
307
|
* Create a `Position` object. Prefer this over `Position.create` for performance reasons
|
|
267
308
|
*/
|
|
268
|
-
createPosition(line: number, character: number):
|
|
269
|
-
line: number;
|
|
270
|
-
character: number;
|
|
271
|
-
};
|
|
309
|
+
createPosition(line: number, character: number): Position;
|
|
272
310
|
/**
|
|
273
311
|
* Convert a list of tokens into a string, including their leading whitespace
|
|
274
312
|
*/
|
|
@@ -276,88 +314,64 @@ export declare class Util {
|
|
|
276
314
|
/**
|
|
277
315
|
* Convert a token into a BscType
|
|
278
316
|
*/
|
|
279
|
-
tokenToBscType(token: Token
|
|
317
|
+
tokenToBscType(token: Token): DynamicType | ObjectType | StringType | IntegerType | BooleanType | FloatType | DoubleType | LongIntegerType | VoidType | FunctionType;
|
|
318
|
+
/**
|
|
319
|
+
* Deciphers the correct types for fields based on docs
|
|
320
|
+
* https://developer.roku.com/en-ca/docs/references/scenegraph/xml-elements/interface.md
|
|
321
|
+
* @param typeDescriptor the type descriptor from the docs
|
|
322
|
+
* @returns {BscType} the known type, or dynamic
|
|
323
|
+
*/
|
|
324
|
+
getNodeFieldType(typeDescriptor: string, lookupTable?: SymbolTable): BscType;
|
|
325
|
+
/**
|
|
326
|
+
* Return the type of the result of a binary operator
|
|
327
|
+
* Note: compound assignments (eg. +=) internally use a binary expression, so that's why TokenKind.PlusEqual, etc. are here too
|
|
328
|
+
*/
|
|
329
|
+
binaryOperatorResultType(leftType: BscType, operator: Token, rightType: BscType): BscType;
|
|
330
|
+
/**
|
|
331
|
+
* Return the type of the result of a binary operator
|
|
332
|
+
*/
|
|
333
|
+
unaryOperatorResultType(operator: Token, exprType: BscType): BscType;
|
|
280
334
|
/**
|
|
281
335
|
* Get the extension for the given file path. Basically the part after the final dot, except for
|
|
282
336
|
* `d.bs` which is treated as single extension
|
|
337
|
+
* @returns the file extension (i.e. ".d.bs", ".bs", ".brs", ".xml", ".jpg", etc...)
|
|
283
338
|
*/
|
|
284
339
|
getExtension(filePath: string): string;
|
|
285
340
|
/**
|
|
286
341
|
* Load and return the list of plugins
|
|
287
342
|
*/
|
|
288
343
|
loadPlugins(cwd: string, pathOrModules: string[], onError?: (pathOrModule: string, err: Error) => void): CompilerPlugin[];
|
|
289
|
-
resolveRequire(cwd: string, pathOrModule: string): any;
|
|
290
344
|
/**
|
|
291
345
|
* Gathers expressions, variables, and unique names from an expression.
|
|
292
346
|
* This is mostly used for the ternary expression
|
|
293
347
|
*/
|
|
294
348
|
getExpressionInfo(expression: Expression): ExpressionInfo;
|
|
349
|
+
concatAnnotationLeadingTrivia(stmt: Statement, otherTrivia: Token[]): Token[];
|
|
295
350
|
/**
|
|
296
351
|
* Create a SourceNode that maps every line to itself. Useful for creating maps for files
|
|
297
352
|
* that haven't changed at all, but we still need the map
|
|
298
353
|
*/
|
|
299
354
|
simpleMap(source: string, src: string): SourceNode;
|
|
300
|
-
/**
|
|
301
|
-
* Creates a new SGAttribute object, but keeps the existing Range references (since those should be immutable)
|
|
302
|
-
*/
|
|
303
|
-
cloneSGAttribute(attr: SGAttribute, value: string): SGAttribute;
|
|
304
|
-
/**
|
|
305
|
-
* Shorthand for creating a new source node
|
|
306
|
-
*/
|
|
307
|
-
sourceNode(source: string, locatable: {
|
|
308
|
-
range: Range;
|
|
309
|
-
}, code: string | SourceNode | TranspileResult): SourceNode | undefined;
|
|
310
|
-
/**
|
|
311
|
-
* Remove leading simple protocols from a path (if present)
|
|
312
|
-
*/
|
|
313
|
-
removeProtocol(pkgPath: string): string;
|
|
314
355
|
/**
|
|
315
356
|
* Converts a path into a standardized format (drive letter to lower, remove extra slashes, use single slash type, resolve relative parts, etc...)
|
|
316
357
|
*/
|
|
317
358
|
standardizePath(thePath: string): string;
|
|
318
359
|
/**
|
|
319
|
-
*
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Given a Diagnostic or BsDiagnostic, return a copy of the diagnostic
|
|
324
|
-
*/
|
|
325
|
-
toDiagnostic(diagnostic: Diagnostic | BsDiagnostic): {
|
|
326
|
-
severity: import("vscode-languageserver-types").DiagnosticSeverity;
|
|
327
|
-
range: Range;
|
|
328
|
-
message: string;
|
|
329
|
-
relatedInformation: {
|
|
330
|
-
location: import("vscode-languageserver-types").Location;
|
|
331
|
-
message: string;
|
|
332
|
-
}[];
|
|
333
|
-
code: string | number;
|
|
334
|
-
source: string;
|
|
335
|
-
};
|
|
336
|
-
/**
|
|
337
|
-
* Gets the minimum and maximum number of allowed params
|
|
338
|
-
* @param params The list of callable parameters to check
|
|
339
|
-
* @returns the minimum and maximum number of allowed params
|
|
340
|
-
*/
|
|
341
|
-
getMinMaxParamCount(params: CallableParam[]): MinMax;
|
|
342
|
-
/**
|
|
343
|
-
* Gets the minimum and maximum number of allowed params for ALL functions with the name of the function call
|
|
344
|
-
* @param callablesByLowerName The map of callable containers
|
|
345
|
-
* @param expCall function call expression to use for the name
|
|
346
|
-
* @returns the minimum and maximum number of allowed params
|
|
360
|
+
* Given a Diagnostic or BsDiagnostic, return a deep clone of the diagnostic.
|
|
361
|
+
* @param diagnostic the diagnostic to clone
|
|
362
|
+
* @param relatedInformationFallbackLocation a default location to use for all `relatedInformation` entries that are missing a location
|
|
347
363
|
*/
|
|
348
|
-
|
|
364
|
+
toDiagnostic(diagnostic: Diagnostic | BsDiagnostic, relatedInformationFallbackLocation: string): Diagnostic;
|
|
349
365
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
* @param
|
|
353
|
-
* @param expCall function call expression to use for the name
|
|
354
|
-
* @return an array with callable containers - could be empty if nothing was found
|
|
366
|
+
* Get the first locatable item found at the specified position
|
|
367
|
+
* @param locatables an array of items that have a `range` property
|
|
368
|
+
* @param position the position that the locatable must contain
|
|
355
369
|
*/
|
|
356
|
-
|
|
370
|
+
getFirstLocatableAt(locatables: Locatable[], position: Position): Locatable;
|
|
357
371
|
/**
|
|
358
372
|
* Sort an array of objects that have a Range
|
|
359
373
|
*/
|
|
360
|
-
sortByRange(locatables:
|
|
374
|
+
sortByRange<T extends Locatable>(locatables: T[]): T[];
|
|
361
375
|
/**
|
|
362
376
|
* Split the given text and return ranges for each chunk.
|
|
363
377
|
* Only works for single-line strings
|
|
@@ -366,20 +380,30 @@ export declare class Util {
|
|
|
366
380
|
text: string;
|
|
367
381
|
range: Range;
|
|
368
382
|
}[];
|
|
369
|
-
mdFence(code: string, language?: string): string;
|
|
370
383
|
/**
|
|
371
|
-
*
|
|
372
|
-
* If the callable was called in a function in a namespace, functions in that namespace are preferred
|
|
373
|
-
* The first callable that matches the name AND will accept the number of arguments given is returned
|
|
374
|
-
* @return a callable containers that matches the call
|
|
384
|
+
* Wrap the given code in a markdown code fence (with the language)
|
|
375
385
|
*/
|
|
376
|
-
|
|
386
|
+
mdFence(code: string, language?: string): string;
|
|
377
387
|
/**
|
|
378
388
|
* Gets each part of the dotted get.
|
|
379
|
-
* @param expression
|
|
389
|
+
* @param node any ast expression
|
|
380
390
|
* @returns an array of the parts of the dotted get. If not fully a dotted get, then returns undefined
|
|
381
391
|
*/
|
|
382
|
-
getAllDottedGetParts(
|
|
392
|
+
getAllDottedGetParts(node: AstNode): Identifier[] | undefined;
|
|
393
|
+
/**
|
|
394
|
+
* Given an expression, return all the DottedGet name parts as a string.
|
|
395
|
+
* Mostly used to convert namespaced item full names to a strings
|
|
396
|
+
*/
|
|
397
|
+
getAllDottedGetPartsAsString(node: Expression | Statement, parseMode?: ParseMode): string;
|
|
398
|
+
stringJoin(strings: string[], separator: string): string;
|
|
399
|
+
/**
|
|
400
|
+
* Break an expression into each part.
|
|
401
|
+
*/
|
|
402
|
+
splitExpression(expression: Expression): Expression[];
|
|
403
|
+
/**
|
|
404
|
+
* Break an expression into each part, and return any VariableExpression or DottedGet expresisons from left-to-right.
|
|
405
|
+
*/
|
|
406
|
+
getDottedGetPath(expression: Expression): [VariableExpression, ...DottedGetExpression[]];
|
|
383
407
|
/**
|
|
384
408
|
* Returns an integer if valid, or undefined. Eliminates checking for NaN
|
|
385
409
|
*/
|
|
@@ -388,6 +412,23 @@ export declare class Util {
|
|
|
388
412
|
* Converts a range to a string in the format 1:2-3:4
|
|
389
413
|
*/
|
|
390
414
|
rangeToString(range: Range): string;
|
|
415
|
+
validateTooDeepFile(file: (BrsFile | XmlFile)): void;
|
|
416
|
+
/**
|
|
417
|
+
* Find the index of the last item in the array that matches.
|
|
418
|
+
*/
|
|
419
|
+
findLastIndex<T>(array: T[], matcher: (T: any) => boolean): number;
|
|
420
|
+
processTypeChain(typeChain: TypeChainEntry[]): TypeChainProcessResult;
|
|
421
|
+
isInTypeExpression(expression: AstNode): boolean;
|
|
422
|
+
setContainsUnresolvedSymbol(symbolLowerNameSet: Set<string>, symbol: UnresolvedSymbol): boolean;
|
|
423
|
+
truncate<T>(options: {
|
|
424
|
+
leadingText: string;
|
|
425
|
+
items: T[];
|
|
426
|
+
trailingText?: string;
|
|
427
|
+
maxLength: number;
|
|
428
|
+
itemSeparator?: string;
|
|
429
|
+
partBuilder?: (item: T) => string;
|
|
430
|
+
}): string;
|
|
431
|
+
getAstNodeFriendlyName(node: AstNode): string;
|
|
391
432
|
}
|
|
392
433
|
/**
|
|
393
434
|
* 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,
|
|
@@ -396,8 +437,3 @@ export declare class Util {
|
|
|
396
437
|
export declare function standardizePath(stringParts: any, ...expressions: any[]): string;
|
|
397
438
|
export declare let util: Util;
|
|
398
439
|
export default util;
|
|
399
|
-
export interface MinMax {
|
|
400
|
-
min: number;
|
|
401
|
-
max: number;
|
|
402
|
-
}
|
|
403
|
-
export declare const MAX_PARAM_COUNT = 32;
|