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/Scope.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type { CallableContainer, BsDiagnostic, BscFile, CallableContainerMap, FileLink, InheritableStatement, InheritableType, NamedTypeStatement } from './interfaces';
|
|
1
|
+
import type { Position, Location } from 'vscode-languageserver';
|
|
2
|
+
import { type CallableContainer, type BsDiagnosticWithOrigin, type CallableContainerMap, type FileLink, type Callable, type NamespaceContainer, type ScopeValidationOptions, type BsDiagnostic } from './interfaces';
|
|
4
3
|
import type { Program } from './Program';
|
|
5
|
-
import type { NamespaceStatement,
|
|
6
|
-
import
|
|
7
|
-
import { ParseMode } from './parser/Parser';
|
|
4
|
+
import type { NamespaceStatement, ClassStatement, EnumStatement, InterfaceStatement, EnumMemberStatement, ConstStatement } from './parser/Statement';
|
|
5
|
+
import { type NewExpression } from './parser/Expression';
|
|
8
6
|
import { Cache } from './Cache';
|
|
9
|
-
import type { BrsFile
|
|
7
|
+
import type { BrsFile } from './files/BrsFile';
|
|
10
8
|
import type { DependencyGraph, DependencyChangedEvent } from './DependencyGraph';
|
|
11
9
|
import { SymbolTable } from './SymbolTable';
|
|
12
|
-
import type {
|
|
10
|
+
import type { BscFile } from './files/BscFile';
|
|
11
|
+
import { type AstNode, type Statement } from './parser/AstNode';
|
|
13
12
|
import type { Token } from './lexer/Token';
|
|
14
13
|
/**
|
|
15
14
|
* A class to keep track of all declarations within a given scope (like source scope, component scope)
|
|
@@ -23,7 +22,7 @@ export declare class Scope {
|
|
|
23
22
|
* Indicates whether this scope needs to be validated.
|
|
24
23
|
* Will be true when first constructed, or anytime one of its dependencies changes
|
|
25
24
|
*/
|
|
26
|
-
isValidated: boolean;
|
|
25
|
+
readonly isValidated: boolean;
|
|
27
26
|
protected cache: Cache<any, any>;
|
|
28
27
|
get dependencyGraphKey(): string;
|
|
29
28
|
/**
|
|
@@ -32,6 +31,14 @@ export declare class Scope {
|
|
|
32
31
|
* "namea", "namea.nameb", "namea.nameb.namec"
|
|
33
32
|
*/
|
|
34
33
|
get namespaceLookup(): Map<string, NamespaceContainer>;
|
|
34
|
+
/**
|
|
35
|
+
* Get a NamespaceContainer by its name, looking for a fully qualified version first, then global version next if not found
|
|
36
|
+
*/
|
|
37
|
+
getNamespace(name: string, containingNamespace?: string): NamespaceContainer;
|
|
38
|
+
/**
|
|
39
|
+
* Get a NamespaceContainer by its name, looking for a fully qualified version first, then global version next if not found
|
|
40
|
+
*/
|
|
41
|
+
getNamespacesWithRoot(rootName: string, containingNamespace?: string): NamespaceContainer[];
|
|
35
42
|
/**
|
|
36
43
|
* Get the class with the specified name.
|
|
37
44
|
* @param className - The class name, including the namespace of the class if possible
|
|
@@ -44,18 +51,6 @@ export declare class Scope {
|
|
|
44
51
|
* @param containingNamespace - The namespace used to resolve relative interface names. (i.e. the namespace around the current statement trying to find a interface)
|
|
45
52
|
*/
|
|
46
53
|
getInterface(ifaceName: string, containingNamespace?: string): InterfaceStatement;
|
|
47
|
-
/**
|
|
48
|
-
* Get either the class or interface, etc. with a given name
|
|
49
|
-
* @param name - The name, including the namespace of the interface if possible
|
|
50
|
-
* @param containingNamespace - The namespace used to resolve relative names. (i.e. the namespace around the current statement trying to find the interface or class)
|
|
51
|
-
*/
|
|
52
|
-
getNamedTypeStatement(name: string, containingNamespace?: string): NamedTypeStatement;
|
|
53
|
-
/**
|
|
54
|
-
* A cache of a map of tokens -> TokenSymbolLookups, which are the result of getSymbolTypeFromToken()
|
|
55
|
-
* Sometimes the lookup of symbols may take a while if there are lazyTypes or multiple tokens in a chain
|
|
56
|
-
* By caching the result of this lookup, subsequent lookups of the same tokens are quicker
|
|
57
|
-
*/
|
|
58
|
-
get symbolCache(): Map<Token, TokenSymbolLookup>;
|
|
59
54
|
/**
|
|
60
55
|
* Get the enum with the specified name.
|
|
61
56
|
* @param enumName - The enum name, including the namespace if possible
|
|
@@ -69,10 +64,10 @@ export declare class Scope {
|
|
|
69
64
|
*/
|
|
70
65
|
getClassFileLink(className: string, containingNamespace?: string): FileLink<ClassStatement>;
|
|
71
66
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
* Get an interface and its containing file by the interface name
|
|
68
|
+
* @param ifaceName - The interface name, including the namespace of the interface if possible
|
|
69
|
+
* @param containingNamespace - The namespace used to resolve relative interface names. (i.e. the namespace around the current statement trying to find a interface)
|
|
70
|
+
*/
|
|
76
71
|
getInterfaceFileLink(ifaceName: string, containingNamespace?: string): FileLink<InterfaceStatement>;
|
|
77
72
|
/**
|
|
78
73
|
* Get an Enum and its containing file by the Enum name
|
|
@@ -81,78 +76,66 @@ export declare class Scope {
|
|
|
81
76
|
*/
|
|
82
77
|
getEnumFileLink(enumName: string, containingNamespace?: string): FileLink<EnumStatement>;
|
|
83
78
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*/
|
|
88
|
-
getNamedTypeFileLink(name: string, containingNamespace?: string): FileLink<NamedTypeStatement>;
|
|
89
|
-
/**
|
|
90
|
-
* Get a InheritableStatement and its containing file by the name of the interface or class
|
|
91
|
-
* @param name - The name of the interface or class, including the namespace of the class if possible
|
|
92
|
-
* @param containingNamespace - The namespace used to resolve relative names. (i.e. the namespace around the current statement trying to find a class)
|
|
79
|
+
* Get an Enum and its containing file by the Enum name
|
|
80
|
+
* @param enumMemberName - The Enum name, including the namespace of the enum if possible
|
|
81
|
+
* @param containingNamespace - The namespace used to resolve relative enum names. (i.e. the namespace around the current statement trying to find a enum)
|
|
93
82
|
*/
|
|
94
|
-
|
|
83
|
+
getEnumMemberFileLink(enumMemberName: string, containingNamespace?: string): FileLink<EnumMemberStatement>;
|
|
95
84
|
/**
|
|
96
|
-
*
|
|
97
|
-
* @param
|
|
85
|
+
* Get a constant and its containing file by the constant name
|
|
86
|
+
* @param constName - The constant name, including the namespace of the constant if possible
|
|
87
|
+
* @param containingNamespace - The namespace used to resolve relative constant names. (i.e. the namespace around the current statement trying to find a constant)
|
|
98
88
|
*/
|
|
99
|
-
|
|
89
|
+
getConstFileLink(constName: string, containingNamespace?: string): FileLink<ConstStatement>;
|
|
90
|
+
getAllFileLinks(name: string, containingNamespace?: string): FileLink<Statement>[];
|
|
100
91
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
92
|
+
* Get a map of all enums by their member name.
|
|
93
|
+
* The keys are lower-case fully-qualified paths to the enum and its member. For example:
|
|
94
|
+
* namespace.enum.value
|
|
103
95
|
*/
|
|
104
|
-
getParentInterface(iface: InterfaceStatement): InterfaceStatement;
|
|
105
|
-
/**
|
|
106
|
-
* Gets the parent of an Interface or Class
|
|
107
|
-
* @param stmt - The class or interface to get the parent of, if possible
|
|
108
|
-
*/
|
|
109
|
-
getParentStatement(stmt: InheritableStatement): InheritableStatement;
|
|
110
96
|
getEnumMemberMap(): Map<string, EnumMemberStatement>;
|
|
111
97
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
* Tests if a class exists with the specified name
|
|
99
|
+
* @param className - the all-lower-case namespace-included class name
|
|
100
|
+
* @param namespaceName - The namespace used to resolve relative class names. (i.e. the namespace around the current statement trying to find a class)
|
|
101
|
+
*/
|
|
116
102
|
hasClass(className: string, namespaceName?: string): boolean;
|
|
117
103
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
* Tests if an interface exists with the specified name
|
|
105
|
+
* @param ifaceName - the all-lower-case namespace-included interface name
|
|
106
|
+
* @param namespaceName - the current namespace name
|
|
107
|
+
*/
|
|
122
108
|
hasInterface(ifaceName: string, namespaceName?: string): boolean;
|
|
123
109
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* @param namespaceName - the current namespace name
|
|
127
|
-
*/
|
|
128
|
-
hasEnum(enumName: string, namespaceName?: string): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Tests if a class OR an interface, etc. exists with the specified name
|
|
131
|
-
* @param name - the all-lower-case namespace-included class or interface name
|
|
110
|
+
* Tests if an enum exists with the specified name
|
|
111
|
+
* @param enumName - the all-lower-case namespace-included enum name
|
|
132
112
|
* @param namespaceName - the current namespace name
|
|
133
113
|
*/
|
|
134
|
-
|
|
114
|
+
hasEnum(enumName: string, namespaceName?: string): boolean;
|
|
135
115
|
/**
|
|
136
116
|
* A dictionary of all classes in this scope. This includes namespaced classes always with their full name.
|
|
137
117
|
* The key is stored in lower case
|
|
138
118
|
*/
|
|
139
119
|
getClassMap(): Map<string, FileLink<ClassStatement>>;
|
|
140
|
-
getAncestorTypeListByContext(thisType: BscType, context?: TypeContext): InheritableType[];
|
|
141
120
|
/**
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
121
|
+
* A dictionary of all Interfaces in this scope. This includes namespaced Interfaces always with their full name.
|
|
122
|
+
* The key is stored in lower case
|
|
123
|
+
*/
|
|
145
124
|
getInterfaceMap(): Map<string, FileLink<InterfaceStatement>>;
|
|
146
|
-
getAncestorTypeList(className: string, functionExpression?: FunctionExpression): InheritableType[];
|
|
147
125
|
/**
|
|
148
126
|
* A dictionary of all enums in this scope. This includes namespaced enums always with their full name.
|
|
149
127
|
* The key is stored in lower case
|
|
150
128
|
*/
|
|
151
129
|
getEnumMap(): Map<string, FileLink<EnumStatement>>;
|
|
130
|
+
/**
|
|
131
|
+
* A dictionary of all constants in this scope. This includes namespaced constants always with their full name.
|
|
132
|
+
* The key is stored in lower case
|
|
133
|
+
*/
|
|
134
|
+
getConstMap(): Map<string, FileLink<ConstStatement>>;
|
|
152
135
|
/**
|
|
153
136
|
* The list of diagnostics found specifically for this scope. Individual file diagnostics are stored on the files themselves.
|
|
154
137
|
*/
|
|
155
|
-
protected diagnostics:
|
|
138
|
+
protected diagnostics: BsDiagnosticWithOrigin[];
|
|
156
139
|
protected onDependenciesChanged(event: DependencyChangedEvent): void;
|
|
157
140
|
/**
|
|
158
141
|
* Clean up all event handles
|
|
@@ -168,7 +151,7 @@ export declare class Scope {
|
|
|
168
151
|
* XmlScope overrides this to return the parent xml scope if available.
|
|
169
152
|
* For globalScope this will return null.
|
|
170
153
|
*/
|
|
171
|
-
getParentScope(): Scope;
|
|
154
|
+
getParentScope(): Scope | null;
|
|
172
155
|
private dependencyGraph;
|
|
173
156
|
/**
|
|
174
157
|
* An unsubscribe function for the dependencyGraph subscription
|
|
@@ -176,11 +159,11 @@ export declare class Scope {
|
|
|
176
159
|
private unsubscribeFromDependencyGraph;
|
|
177
160
|
attachDependencyGraph(dependencyGraph: DependencyGraph): void;
|
|
178
161
|
/**
|
|
179
|
-
* Get the file with the
|
|
180
|
-
* @param filePath can be a srcPath
|
|
162
|
+
* Get the file from this scope with the given path.
|
|
163
|
+
* @param filePath can be a srcPath or destPath
|
|
181
164
|
* @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
|
|
182
165
|
*/
|
|
183
|
-
getFile(
|
|
166
|
+
getFile<TFile extends BscFile>(filePath: string, normalizePath?: boolean): TFile;
|
|
184
167
|
/**
|
|
185
168
|
* Get the list of files referenced by this scope that are actually loaded in the program.
|
|
186
169
|
* Excludes files from ancestor scopes
|
|
@@ -192,11 +175,10 @@ export declare class Scope {
|
|
|
192
175
|
*/
|
|
193
176
|
getAllFiles(): BscFile[];
|
|
194
177
|
/**
|
|
195
|
-
* Get the list of errors for this scope. It's calculated on the fly, so
|
|
196
|
-
* call this sparingly.
|
|
178
|
+
* Get the list of errors for this scope. It's calculated on the fly, so call this sparingly.
|
|
197
179
|
*/
|
|
198
180
|
getDiagnostics(): BsDiagnostic[];
|
|
199
|
-
addDiagnostics(diagnostics:
|
|
181
|
+
addDiagnostics(diagnostics: BsDiagnosticWithOrigin[]): void;
|
|
200
182
|
/**
|
|
201
183
|
* Get the list of callables available in this scope (either declared in this scope or in a parent scope)
|
|
202
184
|
*/
|
|
@@ -204,15 +186,9 @@ export declare class Scope {
|
|
|
204
186
|
/**
|
|
205
187
|
* Get the callable with the specified name.
|
|
206
188
|
* If there are overridden callables with the same name, the closest callable to this scope is returned
|
|
207
|
-
* @param name
|
|
208
189
|
*/
|
|
209
|
-
getCallableByName(name: string):
|
|
210
|
-
|
|
211
|
-
* Get the global callable with the specified name.
|
|
212
|
-
* If there are overridden callables with the same name, the closest callable to this scope is returned
|
|
213
|
-
* @param name
|
|
214
|
-
*/
|
|
215
|
-
getGlobalCallableByName(name: string): import("./interfaces").Callable;
|
|
190
|
+
getCallableByName(name: string): Callable;
|
|
191
|
+
getCallableMap(): Map<string, Callable>;
|
|
216
192
|
/**
|
|
217
193
|
* Iterate over Brs files not shadowed by typedefs
|
|
218
194
|
*/
|
|
@@ -229,26 +205,46 @@ export declare class Scope {
|
|
|
229
205
|
/**
|
|
230
206
|
* Builds a tree of namespace objects
|
|
231
207
|
*/
|
|
232
|
-
buildNamespaceLookup(
|
|
208
|
+
buildNamespaceLookup(options?: {
|
|
209
|
+
okToCache?: boolean;
|
|
210
|
+
}): Map<string, NamespaceContainer>;
|
|
233
211
|
getAllNamespaceStatements(): NamespaceStatement[];
|
|
234
212
|
protected logDebug(...args: any[]): void;
|
|
235
213
|
private _debugLogComponentName;
|
|
236
|
-
validate(): void;
|
|
214
|
+
validate(validationOptions?: ScopeValidationOptions): void;
|
|
237
215
|
protected _validate(callableContainerMap: CallableContainerMap): void;
|
|
216
|
+
clearAstSegmentDiagnostics(astSegment: AstNode): void;
|
|
217
|
+
clearAstSegmentDiagnosticsByFile(file: BscFile): void;
|
|
218
|
+
clearScopeLevelDiagnostics(): void;
|
|
238
219
|
/**
|
|
239
220
|
* Mark this scope as invalid, which means its `validate()` function needs to be called again before use.
|
|
240
221
|
*/
|
|
241
222
|
invalidate(): void;
|
|
242
223
|
get symbolTable(): SymbolTable;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
224
|
+
/**
|
|
225
|
+
* A list of functions that will be called whenever `unlinkSymbolTable` is called
|
|
226
|
+
*/
|
|
227
|
+
private linkSymbolTableDisposables;
|
|
228
|
+
private symbolsAddedDuringLinking;
|
|
229
|
+
/**
|
|
230
|
+
* Builds the current symbol table for the scope, by merging the tables for all the files in this scope.
|
|
231
|
+
* Also links all file symbols tables to this new table
|
|
232
|
+
* This will only rebuilt if the symbol table has not been built before
|
|
233
|
+
*
|
|
234
|
+
* Tree of symbol tables:
|
|
235
|
+
* ```
|
|
236
|
+
* Global Scope Symbol Table
|
|
237
|
+
* - Source Scope Symbol Table :: Aggregate Namespaces Symbol Table (Siblings)
|
|
238
|
+
* - File 1 Symbol Table
|
|
239
|
+
* - File 2 Symbol Table
|
|
240
|
+
* - Component A Scope Symbol Table :: Aggregate Namespaces Symbol Table (Siblings)
|
|
241
|
+
* - File 1 Symbol Table
|
|
242
|
+
* - File 2 Symbol Table
|
|
243
|
+
* - Component B Scope Symbol Table :: Aggregate Namespaces Symbol Table (Siblings)
|
|
244
|
+
* - File 1 Symbol Table
|
|
245
|
+
* - File 2 Symbol Table
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
252
248
|
linkSymbolTable(): void;
|
|
253
249
|
unlinkSymbolTable(): void;
|
|
254
250
|
private detectVariableNamespaceCollisions;
|
|
@@ -256,26 +252,16 @@ export declare class Scope {
|
|
|
256
252
|
* Find various function collisions
|
|
257
253
|
*/
|
|
258
254
|
private diagnosticDetectFunctionCollisions;
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
*/
|
|
262
|
-
private diagnosticDetectInvalidFunctionExpressionTypes;
|
|
263
|
-
/**
|
|
264
|
-
* Find functions with either the wrong type of parameters, or the wrong number of parameters
|
|
265
|
-
*/
|
|
266
|
-
private diagnosticDetectInvalidFunctionCalls;
|
|
267
|
-
private addMismatchParamCountDiagnostic;
|
|
255
|
+
private detectNameCollisions;
|
|
256
|
+
validateNameCollision(file: BrsFile, node: AstNode, nameIdentifier: Token): void;
|
|
268
257
|
getNewExpressions(): AugmentedNewExpression[];
|
|
269
258
|
private validateClasses;
|
|
270
259
|
/**
|
|
271
|
-
* Detect local variables (
|
|
272
|
-
* @param file
|
|
273
|
-
* @param callableContainerMap
|
|
260
|
+
* Detect local variables (function scope) that have the same name as scope calls
|
|
274
261
|
*/
|
|
275
262
|
private diagnosticDetectShadowedLocalVars;
|
|
276
263
|
/**
|
|
277
264
|
* Create diagnostics for any duplicate function declarations
|
|
278
|
-
* @param callablesByLowerName
|
|
279
265
|
*/
|
|
280
266
|
private diagnosticFindDuplicateFunctionDeclarations;
|
|
281
267
|
/**
|
|
@@ -288,48 +274,23 @@ export declare class Scope {
|
|
|
288
274
|
private diagnosticValidateScriptImportPaths;
|
|
289
275
|
/**
|
|
290
276
|
* Find the file with the specified relative path
|
|
291
|
-
* @param relativePath
|
|
292
277
|
*/
|
|
293
278
|
protected getFileByRelativePath(relativePath: string): BscFile;
|
|
294
279
|
/**
|
|
295
280
|
* Determine if this file is included in this scope (excluding parent scopes)
|
|
296
|
-
* @param file
|
|
297
281
|
*/
|
|
298
282
|
hasFile(file: BscFile): boolean;
|
|
299
|
-
/**
|
|
300
|
-
* Get all callables as completionItems
|
|
301
|
-
*/
|
|
302
|
-
getCallablesAsCompletions(parseMode: ParseMode): CompletionItem[];
|
|
303
|
-
createCompletionFromCallable(callableContainer: CallableContainer): CompletionItem;
|
|
304
|
-
createCompletionFromFunctionStatement(statement: FunctionStatement): CompletionItem;
|
|
305
283
|
/**
|
|
306
284
|
* Get the definition (where was this thing first defined) of the symbol under the position
|
|
307
285
|
*/
|
|
308
286
|
getDefinition(file: BscFile, position: Position): Location[];
|
|
309
|
-
/**
|
|
310
|
-
* Scan all files for property names, and return them as completions
|
|
311
|
-
*/
|
|
312
|
-
getPropertyNameCompletions(): CompletionItem[];
|
|
313
|
-
getAllClassMemberCompletions(): Map<string, CompletionItem>;
|
|
314
287
|
/**
|
|
315
288
|
* @param className - The name of the class (including namespace if possible)
|
|
316
289
|
* @param callsiteNamespace - the name of the namespace where the call site resides (this is NOT the known namespace of the class).
|
|
317
|
-
* This is used to help resolve non-namespaced class names that reside in the same
|
|
290
|
+
* This is used to help resolve non-namespaced class names that reside in the same namespac as the call site.
|
|
318
291
|
*/
|
|
319
292
|
getClassHierarchy(className: string, callsiteNamespace?: string): FileLink<ClassStatement>[];
|
|
320
293
|
}
|
|
321
|
-
export interface NamespaceContainer {
|
|
322
|
-
file: BscFile;
|
|
323
|
-
fullName: string;
|
|
324
|
-
nameRange: Range;
|
|
325
|
-
lastPartName: string;
|
|
326
|
-
statements: Statement[];
|
|
327
|
-
classStatements: Record<string, ClassStatement>;
|
|
328
|
-
functionStatements: Record<string, FunctionStatement>;
|
|
329
|
-
enumStatements: Map<string, EnumStatement>;
|
|
330
|
-
namespaces: Map<string, NamespaceContainer>;
|
|
331
|
-
symbolTable: SymbolTable;
|
|
332
|
-
}
|
|
333
294
|
interface AugmentedNewExpression extends NewExpression {
|
|
334
295
|
file: BscFile;
|
|
335
296
|
}
|