brighterscript 0.66.0-alpha.1 → 0.66.0-alpha.11
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 +224 -10
- package/README.md +13 -3
- package/bsconfig.schema.json +15 -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 +150 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +13 -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 +0 -1
- package/dist/CodeActionUtil.d.ts +2 -2
- package/dist/CommentFlagProcessor.d.ts +4 -3
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DiagnosticCollection.js +8 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +34 -4
- package/dist/DiagnosticMessages.js +59 -4
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/FunctionScope.d.ts +1 -1
- package/dist/LanguageServer.d.ts +23 -1
- package/dist/LanguageServer.js +139 -57
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +10 -2
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +11 -2
- package/dist/PluginInterface.js +69 -10
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +138 -49
- package/dist/Program.js +644 -349
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +10 -4
- package/dist/ProgramBuilder.js +76 -74
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +52 -49
- package/dist/Scope.js +298 -274
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +35 -14
- package/dist/SymbolTable.js +90 -29
- 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/XmlScope.d.ts +7 -4
- package/dist/XmlScope.js +52 -12
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +6 -1
- package/dist/astUtils/{AstEditor.js → Editor.js} +9 -3
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +10 -6
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +3 -1
- package/dist/astUtils/creators.js +14 -4
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +37 -9
- package/dist/astUtils/reflection.js +83 -14
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +87 -5
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +14 -3
- package/dist/astUtils/visitors.js +22 -2
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +58 -7
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +10 -2
- package/dist/bscPlugin/BscPlugin.js +24 -4
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +3 -3
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -1
- 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/codeActions/CodeActionsProcessor.js +8 -8
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +4 -4
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +50 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +445 -23
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1737 -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 +7 -3
- package/dist/bscPlugin/hover/HoverProcessor.js +133 -103
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +241 -29
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +43 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +22 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- 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/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +29 -5
- 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 +2 -2
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +0 -4
- package/dist/bscPlugin/validation/BrsFileValidator.js +34 -29
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +28 -7
- package/dist/bscPlugin/validation/ScopeValidator.js +393 -205
- 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 +2038 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +2 -2
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -1
- package/dist/cli.js +104 -13
- 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 +45 -16
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +1 -1
- 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 +383 -56
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +73 -46
- package/dist/files/BrsFile.js +370 -534
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1139 -682
- package/dist/files/BrsFile.spec.js.map +1 -1
- 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/File.d.ts +106 -0
- package/dist/files/File.js +16 -0
- package/dist/files/File.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 +56 -23
- package/dist/files/XmlFile.js +88 -60
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +64 -93
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +21 -8
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +14 -14
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +88 -84
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +389 -94
- package/dist/interfaces.js +13 -2
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +12 -0
- package/dist/lexer/Lexer.js +28 -8
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +40 -0
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +4 -0
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +5 -0
- package/dist/lexer/TokenKind.js +14 -2
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +9 -2
- package/dist/parser/AstNode.js +16 -0
- package/dist/parser/AstNode.js.map +1 -1
- package/dist/parser/BrsTranspileState.d.ts +3 -2
- package/dist/parser/BrsTranspileState.js +3 -2
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +21 -5
- package/dist/parser/Expression.js +130 -35
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +103 -1
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +7 -0
- package/dist/parser/Parser.js +117 -21
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +557 -5
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +4 -4
- package/dist/parser/SGParser.js +3 -3
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +2 -2
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +2 -2
- package/dist/parser/Statement.d.ts +37 -12
- package/dist/parser/Statement.js +153 -46
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +2 -1
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +16 -8
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +12 -6
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +8 -4
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +4 -4
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +29 -29
- package/dist/parser/tests/expression/NullCoalescenceExpression.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/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +75 -36
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +36 -36
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- 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/ConstStatement.spec.js +71 -22
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Continue.spec.js +2 -2
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +38 -285
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +6 -6
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +4 -4
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +26 -10
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +16 -13
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +5 -3
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +26 -13
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +2 -2
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/roku-types/data.json +244 -294
- package/dist/roku-types/index.d.ts +17 -38
- package/dist/types/ArrayType.d.ts +4 -1
- package/dist/types/ArrayType.js +46 -6
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +32 -3
- 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 +2 -1
- package/dist/types/BooleanType.js +8 -2
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BscType.d.ts +10 -6
- package/dist/types/BscType.js +69 -16
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +3 -0
- package/dist/types/BscTypeKind.js +3 -0
- package/dist/types/BscTypeKind.js.map +1 -1
- 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 +10 -4
- package/dist/types/ClassType.js +32 -5
- package/dist/types/ClassType.js.map +1 -1
- package/dist/types/ClassType.spec.js +5 -3
- package/dist/types/ClassType.spec.js.map +1 -1
- 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 +2 -1
- package/dist/types/DoubleType.js +9 -2
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DynamicType.d.ts +2 -2
- package/dist/types/DynamicType.js +3 -1
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/EnumType.d.ts +24 -6
- package/dist/types/EnumType.js +29 -7
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/FloatType.d.ts +2 -1
- package/dist/types/FloatType.js +9 -2
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FunctionType.d.ts +8 -20
- package/dist/types/FunctionType.js +17 -45
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +7 -4
- package/dist/types/InheritableType.js +67 -3
- package/dist/types/InheritableType.js.map +1 -1
- package/dist/types/IntegerType.d.ts +2 -1
- package/dist/types/IntegerType.js +9 -2
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +6 -4
- package/dist/types/InterfaceType.js +8 -11
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +30 -2
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +2 -1
- package/dist/types/InvalidType.js +7 -1
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +2 -1
- package/dist/types/LongIntegerType.js +9 -2
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +2 -1
- package/dist/types/NamespaceType.js +3 -0
- package/dist/types/NamespaceType.js.map +1 -1
- package/dist/types/ObjectType.d.ts +2 -2
- package/dist/types/ObjectType.js +5 -10
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +15 -3
- package/dist/types/ReferenceType.js +173 -24
- package/dist/types/ReferenceType.js.map +1 -1
- package/dist/types/ReferenceType.spec.js +21 -6
- package/dist/types/ReferenceType.spec.js.map +1 -1
- package/dist/types/StringType.d.ts +2 -1
- package/dist/types/StringType.js +9 -2
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +33 -0
- package/dist/types/TypedFunctionType.js +106 -0
- package/dist/types/TypedFunctionType.js.map +1 -0
- package/dist/types/TypedFunctionType.spec.d.ts +1 -0
- package/dist/types/TypedFunctionType.spec.js +122 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -0
- package/dist/types/UninitializedType.d.ts +2 -1
- package/dist/types/UninitializedType.js +1 -1
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +4 -2
- package/dist/types/UnionType.js +36 -4
- package/dist/types/UnionType.js.map +1 -1
- package/dist/types/UnionType.spec.js +46 -19
- package/dist/types/UnionType.spec.js.map +1 -1
- package/dist/types/VoidType.d.ts +2 -1
- package/dist/types/VoidType.js +7 -2
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/helper.spec.js +15 -0
- package/dist/types/helper.spec.js.map +1 -1
- package/dist/types/helpers.d.ts +5 -0
- package/dist/types/helpers.js +50 -3
- package/dist/types/helpers.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/util.d.ts +71 -15
- package/dist/util.js +578 -150
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +0 -1
- package/dist/validators/ClassValidator.js +0 -22
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +3 -2
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -31
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/types/FunctionType.spec.js +0 -23
- package/dist/types/FunctionType.spec.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/{types/FunctionType.spec.d.ts → bscPlugin/serialize/BslibInjector.spec.d.ts} +0 -0
package/dist/Scope.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
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';
|
|
3
3
|
import type { Program } from './Program';
|
|
4
|
-
import type { NamespaceStatement,
|
|
5
|
-
import type
|
|
6
|
-
import { ParseMode } from './parser/Parser';
|
|
4
|
+
import type { NamespaceStatement, ClassStatement, EnumStatement, InterfaceStatement, EnumMemberStatement, ConstStatement } from './parser/Statement';
|
|
5
|
+
import { type NewExpression } from './parser/Expression';
|
|
7
6
|
import { Cache } from './Cache';
|
|
8
7
|
import type { BrsFile } from './files/BrsFile';
|
|
9
8
|
import type { DependencyGraph, DependencyChangedEvent } from './DependencyGraph';
|
|
10
9
|
import { SymbolTable } from './SymbolTable';
|
|
11
|
-
import type {
|
|
10
|
+
import type { File } from './files/File';
|
|
11
|
+
import { type AstNode, type Statement } from './parser/AstNode';
|
|
12
|
+
import type { Token } from './lexer/Token';
|
|
12
13
|
/**
|
|
13
14
|
* A class to keep track of all declarations within a given scope (like source scope, component scope)
|
|
14
15
|
*/
|
|
@@ -34,6 +35,10 @@ export declare class Scope {
|
|
|
34
35
|
* Get a NamespaceContainer by its name, looking for a fully qualified version first, then global version next if not found
|
|
35
36
|
*/
|
|
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[];
|
|
37
42
|
/**
|
|
38
43
|
* Get the class with the specified name.
|
|
39
44
|
* @param className - The class name, including the namespace of the class if possible
|
|
@@ -82,6 +87,7 @@ export declare class Scope {
|
|
|
82
87
|
* @param containingNamespace - The namespace used to resolve relative constant names. (i.e. the namespace around the current statement trying to find a constant)
|
|
83
88
|
*/
|
|
84
89
|
getConstFileLink(constName: string, containingNamespace?: string): FileLink<ConstStatement>;
|
|
90
|
+
getAllFileLinks(name: string, containingNamespace?: string): FileLink<Statement>[];
|
|
85
91
|
/**
|
|
86
92
|
* Get a map of all enums by their member name.
|
|
87
93
|
* The keys are lower-case fully-qualified paths to the enum and its member. For example:
|
|
@@ -129,7 +135,7 @@ export declare class Scope {
|
|
|
129
135
|
/**
|
|
130
136
|
* The list of diagnostics found specifically for this scope. Individual file diagnostics are stored on the files themselves.
|
|
131
137
|
*/
|
|
132
|
-
protected diagnostics:
|
|
138
|
+
protected diagnostics: BsDiagnosticWithOrigin[];
|
|
133
139
|
protected onDependenciesChanged(event: DependencyChangedEvent): void;
|
|
134
140
|
/**
|
|
135
141
|
* Clean up all event handles
|
|
@@ -154,26 +160,25 @@ export declare class Scope {
|
|
|
154
160
|
attachDependencyGraph(dependencyGraph: DependencyGraph): void;
|
|
155
161
|
/**
|
|
156
162
|
* Get the file from this scope with the given path.
|
|
157
|
-
* @param filePath can be a srcPath or
|
|
163
|
+
* @param filePath can be a srcPath or destPath
|
|
158
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
|
|
159
165
|
*/
|
|
160
|
-
getFile<TFile extends
|
|
166
|
+
getFile<TFile extends File>(filePath: string, normalizePath?: boolean): TFile;
|
|
161
167
|
/**
|
|
162
168
|
* Get the list of files referenced by this scope that are actually loaded in the program.
|
|
163
169
|
* Excludes files from ancestor scopes
|
|
164
170
|
*/
|
|
165
|
-
getOwnFiles():
|
|
171
|
+
getOwnFiles(): File[];
|
|
166
172
|
/**
|
|
167
173
|
* Get the list of files referenced by this scope that are actually loaded in the program.
|
|
168
174
|
* Includes files from this scope and all ancestor scopes
|
|
169
175
|
*/
|
|
170
|
-
getAllFiles():
|
|
176
|
+
getAllFiles(): File[];
|
|
171
177
|
/**
|
|
172
|
-
* Get the list of errors for this scope. It's calculated on the fly, so
|
|
173
|
-
* call this sparingly.
|
|
178
|
+
* Get the list of errors for this scope. It's calculated on the fly, so call this sparingly.
|
|
174
179
|
*/
|
|
175
180
|
getDiagnostics(): BsDiagnostic[];
|
|
176
|
-
addDiagnostics(diagnostics:
|
|
181
|
+
addDiagnostics(diagnostics: BsDiagnosticWithOrigin[]): void;
|
|
177
182
|
/**
|
|
178
183
|
* Get the list of callables available in this scope (either declared in this scope or in a parent scope)
|
|
179
184
|
*/
|
|
@@ -191,7 +196,7 @@ export declare class Scope {
|
|
|
191
196
|
/**
|
|
192
197
|
* Call a function for each file directly included in this scope (excluding files found only in parent scopes).
|
|
193
198
|
*/
|
|
194
|
-
enumerateOwnFiles(callback: (file:
|
|
199
|
+
enumerateOwnFiles(callback: (file: File) => void): void;
|
|
195
200
|
/**
|
|
196
201
|
* Get the list of callables explicitly defined in files in this scope.
|
|
197
202
|
* This excludes ancestor callables
|
|
@@ -200,21 +205,45 @@ export declare class Scope {
|
|
|
200
205
|
/**
|
|
201
206
|
* Builds a tree of namespace objects
|
|
202
207
|
*/
|
|
203
|
-
buildNamespaceLookup(
|
|
208
|
+
buildNamespaceLookup(options?: {
|
|
209
|
+
okToCache?: boolean;
|
|
210
|
+
}): Map<string, NamespaceContainer>;
|
|
204
211
|
getAllNamespaceStatements(): NamespaceStatement[];
|
|
205
212
|
protected logDebug(...args: any[]): void;
|
|
206
213
|
private _debugLogComponentName;
|
|
207
|
-
validate(
|
|
214
|
+
validate(validationOptions?: ScopeValidationOptions): void;
|
|
208
215
|
protected _validate(callableContainerMap: CallableContainerMap): void;
|
|
216
|
+
clearAstSegmentDiagnostics(astSegment: AstNode): void;
|
|
217
|
+
clearAstSegmentDiagnosticsByFile(file: File): void;
|
|
218
|
+
clearScopeLevelDiagnostics(): void;
|
|
209
219
|
/**
|
|
210
220
|
* Mark this scope as invalid, which means its `validate()` function needs to be called again before use.
|
|
211
221
|
*/
|
|
212
222
|
invalidate(): void;
|
|
213
223
|
get symbolTable(): SymbolTable;
|
|
224
|
+
/**
|
|
225
|
+
* A list of functions that will be called whenever `unlinkSymbolTable` is called
|
|
226
|
+
*/
|
|
227
|
+
private linkSymbolTableDisposables;
|
|
228
|
+
private symbolsAddedDuringLinking;
|
|
214
229
|
/**
|
|
215
230
|
* Builds the current symbol table for the scope, by merging the tables for all the files in this scope.
|
|
216
231
|
* Also links all file symbols tables to this new table
|
|
217
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
|
+
* ```
|
|
218
247
|
*/
|
|
219
248
|
linkSymbolTable(): void;
|
|
220
249
|
unlinkSymbolTable(): void;
|
|
@@ -223,12 +252,10 @@ export declare class Scope {
|
|
|
223
252
|
* Find various function collisions
|
|
224
253
|
*/
|
|
225
254
|
private diagnosticDetectFunctionCollisions;
|
|
255
|
+
private detectNameCollisions;
|
|
256
|
+
validateNameCollision(file: BrsFile, node: AstNode, nameIdentifier: Token): void;
|
|
226
257
|
getNewExpressions(): AugmentedNewExpression[];
|
|
227
258
|
private validateClasses;
|
|
228
|
-
/**
|
|
229
|
-
* Detect calls to functions with the incorrect number of parameters
|
|
230
|
-
*/
|
|
231
|
-
private diagnosticDetectFunctionCallsWithWrongParamCount;
|
|
232
259
|
/**
|
|
233
260
|
* Detect local variables (function scope) that have the same name as scope calls
|
|
234
261
|
*/
|
|
@@ -248,26 +275,15 @@ export declare class Scope {
|
|
|
248
275
|
/**
|
|
249
276
|
* Find the file with the specified relative path
|
|
250
277
|
*/
|
|
251
|
-
protected getFileByRelativePath(relativePath: string):
|
|
278
|
+
protected getFileByRelativePath(relativePath: string): File;
|
|
252
279
|
/**
|
|
253
280
|
* Determine if this file is included in this scope (excluding parent scopes)
|
|
254
281
|
*/
|
|
255
|
-
hasFile(file:
|
|
256
|
-
/**
|
|
257
|
-
* Get all callables as completionItems
|
|
258
|
-
*/
|
|
259
|
-
getCallablesAsCompletions(parseMode: ParseMode): CompletionItem[];
|
|
260
|
-
createCompletionFromCallable(callableContainer: CallableContainer): CompletionItem;
|
|
261
|
-
createCompletionFromFunctionStatement(statement: FunctionStatement): CompletionItem;
|
|
282
|
+
hasFile(file: File): boolean;
|
|
262
283
|
/**
|
|
263
284
|
* Get the definition (where was this thing first defined) of the symbol under the position
|
|
264
285
|
*/
|
|
265
|
-
getDefinition(file:
|
|
266
|
-
/**
|
|
267
|
-
* Scan all files for property names, and return them as completions
|
|
268
|
-
*/
|
|
269
|
-
getPropertyNameCompletions(): CompletionItem[];
|
|
270
|
-
getAllClassMemberCompletions(): Map<string, CompletionItem>;
|
|
286
|
+
getDefinition(file: File, position: Position): Location[];
|
|
271
287
|
/**
|
|
272
288
|
* @param className - The name of the class (including namespace if possible)
|
|
273
289
|
* @param callsiteNamespace - the name of the namespace where the call site resides (this is NOT the known namespace of the class).
|
|
@@ -275,20 +291,7 @@ export declare class Scope {
|
|
|
275
291
|
*/
|
|
276
292
|
getClassHierarchy(className: string, callsiteNamespace?: string): FileLink<ClassStatement>[];
|
|
277
293
|
}
|
|
278
|
-
interface NamespaceContainer {
|
|
279
|
-
file: BscFile;
|
|
280
|
-
fullName: string;
|
|
281
|
-
nameRange: Range;
|
|
282
|
-
lastPartName: string;
|
|
283
|
-
statements: Statement[];
|
|
284
|
-
classStatements: Record<string, ClassStatement>;
|
|
285
|
-
functionStatements: Record<string, FunctionStatement>;
|
|
286
|
-
enumStatements: Map<string, EnumStatement>;
|
|
287
|
-
constStatements: Map<string, ConstStatement>;
|
|
288
|
-
namespaces: Map<string, NamespaceContainer>;
|
|
289
|
-
symbolTable: SymbolTable;
|
|
290
|
-
}
|
|
291
294
|
interface AugmentedNewExpression extends NewExpression {
|
|
292
|
-
file:
|
|
295
|
+
file: File;
|
|
293
296
|
}
|
|
294
297
|
export {};
|