brighterscript 0.66.0-alpha.9 → 0.67.1
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 +123 -73
- package/README.md +14 -418
- package/dist/BsConfig.d.ts +25 -2
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CodeActionUtil.d.ts +3 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +3 -4
- package/dist/CommentFlagProcessor.js +4 -3
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.js +8 -8
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +8 -4
- package/dist/DiagnosticFilterer.js +71 -38
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +15 -36
- package/dist/DiagnosticMessages.js +15 -61
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.js +3 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -1
- package/dist/FunctionScope.d.ts +2 -3
- package/dist/FunctionScope.js +0 -3
- package/dist/FunctionScope.js.map +1 -1
- package/dist/LanguageServer.d.ts +1 -2
- package/dist/LanguageServer.js +31 -35
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +5 -9
- package/dist/Logger.js +18 -22
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +13 -15
- package/dist/PluginInterface.js +16 -70
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +105 -138
- package/dist/Program.js +479 -702
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +8 -19
- package/dist/ProgramBuilder.js +85 -89
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +56 -46
- package/dist/Scope.js +281 -217
- 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 +12 -68
- package/dist/SymbolTable.js +28 -213
- package/dist/SymbolTable.js.map +1 -1
- package/dist/XmlScope.d.ts +5 -7
- package/dist/XmlScope.js +36 -76
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/{Editor.d.ts → AstEditor.d.ts} +1 -6
- package/dist/astUtils/{Editor.js → AstEditor.js} +3 -9
- package/dist/astUtils/AstEditor.js.map +1 -0
- package/dist/astUtils/{Editor.spec.js → AstEditor.spec.js} +6 -10
- package/dist/astUtils/AstEditor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +8 -19
- package/dist/astUtils/creators.js +22 -54
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +0 -10
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +45 -81
- package/dist/astUtils/reflection.js +157 -220
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +19 -96
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +14 -18
- package/dist/astUtils/visitors.js +9 -22
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +9 -62
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -9
- package/dist/astUtils/xml.js +6 -6
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +8 -11
- package/dist/bscPlugin/BscPlugin.js +21 -29
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +6 -5
- package/dist/bscPlugin/CallExpressionInfo.js +2 -2
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +11 -11
- 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 +1 -49
- package/dist/bscPlugin/completions/CompletionsProcessor.js +23 -424
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +200 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +87 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +3 -7
- package/dist/bscPlugin/hover/HoverProcessor.js +88 -128
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +24 -336
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/references/ReferencesProvider.d.ts +12 -0
- package/dist/bscPlugin/references/ReferencesProvider.js +56 -0
- package/dist/bscPlugin/references/ReferencesProvider.js.map +1 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js +51 -0
- package/dist/bscPlugin/references/ReferencesProvider.spec.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +0 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +5 -49
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +0 -22
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js +22 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +290 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.d.ts +7 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js +26 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.js.map +1 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js +245 -0
- package/dist/bscPlugin/symbols/WorkspaceSymbolProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/symbols/symbolUtils.d.ts +5 -0
- package/dist/bscPlugin/symbols/symbolUtils.js +140 -0
- package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
- package/dist/bscPlugin/transpile/{BrsFileTranspileProcessor.d.ts → BrsFilePreTranspileProcessor.d.ts} +2 -4
- package/dist/bscPlugin/transpile/{BrsFileTranspileProcessor.js → BrsFilePreTranspileProcessor.js} +15 -36
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +46 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +30 -41
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +2 -2
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +3 -3
- package/dist/bscPlugin/validation/ProgramValidator.js +6 -6
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +6 -28
- package/dist/bscPlugin/validation/ScopeValidator.js +166 -387
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/XmlFileValidator.js +9 -9
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +2 -3
- package/dist/diagnosticUtils.js +5 -5
- 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/BrsFile.Class.spec.js +143 -114
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +61 -83
- package/dist/files/BrsFile.js +559 -612
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1365 -1201
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +28 -56
- package/dist/files/XmlFile.js +103 -89
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +179 -122
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +19 -29
- 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 +83 -88
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +1 -9
- package/dist/index.js +1 -9
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +173 -423
- package/dist/interfaces.js +0 -24
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +9 -15
- package/dist/lexer/Lexer.js +35 -46
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +48 -40
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +1 -5
- package/dist/lexer/Token.js +1 -1
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +0 -6
- package/dist/lexer/TokenKind.js +2 -14
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/logging.d.ts +9 -0
- package/dist/logging.js +16 -0
- package/dist/logging.js.map +1 -0
- package/dist/parser/AstNode.d.ts +6 -90
- package/dist/parser/AstNode.js +5 -96
- package/dist/parser/AstNode.js.map +1 -1
- package/dist/parser/AstNode.spec.js.map +1 -1
- package/dist/parser/BrsTranspileState.d.ts +3 -4
- package/dist/parser/BrsTranspileState.js +2 -3
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +114 -137
- package/dist/parser/Expression.js +244 -373
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +19 -46
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +18 -14
- package/dist/parser/Parser.js +196 -175
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +0 -2
- package/dist/parser/Parser.spec.js +10 -674
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +6 -44
- package/dist/parser/SGParser.js +198 -194
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +11 -14
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +52 -280
- package/dist/parser/SGTypes.js +185 -562
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +140 -172
- package/dist/parser/Statement.js +201 -337
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +3 -2
- package/dist/parser/TranspileState.js +8 -10
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +3 -5
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +8 -16
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +6 -12
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +4 -8
- 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/Indexing.spec.js +25 -0
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +73 -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 +47 -35
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +83 -36
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/UnaryExpression.spec.js +2 -2
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js +26 -27
- 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/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +393 -90
- 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/Function.spec.js +1 -1
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +18 -18
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +13 -16
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +3 -5
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +13 -26
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Chunk.js +1 -2
- package/dist/preprocessor/Chunk.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +3 -4
- package/dist/preprocessor/Preprocessor.js +3 -3
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.js +8 -1
- package/dist/preprocessor/PreprocessorParser.js.map +1 -1
- package/dist/roku-types/data.json +293 -243
- package/dist/roku-types/index.d.ts +38 -17
- package/dist/types/ArrayType.d.ts +4 -9
- package/dist/types/ArrayType.js +24 -72
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +10 -39
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/BooleanType.d.ts +4 -8
- package/dist/types/BooleanType.js +8 -19
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +3 -9
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +2 -29
- package/dist/types/BscType.js +0 -113
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/CustomType.d.ts +9 -0
- package/dist/types/CustomType.js +32 -0
- package/dist/types/CustomType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +4 -8
- package/dist/types/DoubleType.js +20 -23
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +3 -11
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +3 -9
- package/dist/types/DynamicType.js +2 -18
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +4 -15
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/FloatType.d.ts +4 -8
- package/dist/types/FloatType.js +20 -23
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +3 -3
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +20 -10
- package/dist/types/FunctionType.js +52 -27
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/FunctionType.spec.js +23 -0
- package/dist/types/FunctionType.spec.js.map +1 -0
- package/dist/types/IntegerType.d.ts +4 -8
- package/dist/types/IntegerType.js +20 -23
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +3 -7
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +10 -12
- package/dist/types/InterfaceType.js +48 -23
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +45 -82
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +4 -7
- package/dist/types/InvalidType.js +8 -18
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +3 -7
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +4 -8
- package/dist/types/LongIntegerType.js +20 -23
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +3 -9
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/ObjectType.d.ts +4 -8
- package/dist/types/ObjectType.js +7 -21
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +2 -2
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/StringType.d.ts +4 -11
- package/dist/types/StringType.js +8 -23
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +2 -2
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +3 -7
- package/dist/types/UninitializedType.js +3 -14
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/VoidType.d.ts +4 -8
- package/dist/types/VoidType.js +8 -18
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +2 -2
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/util.d.ts +43 -104
- package/dist/util.js +243 -640
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +6 -1
- package/dist/validators/ClassValidator.js +61 -20
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +13 -11
- package/dist/ActionPipeline.d.ts +0 -10
- package/dist/ActionPipeline.js +0 -40
- package/dist/ActionPipeline.js.map +0 -1
- package/dist/AstValidationSegmenter.d.ts +0 -25
- package/dist/AstValidationSegmenter.js +0 -150
- package/dist/AstValidationSegmenter.js.map +0 -1
- package/dist/CacheVerifier.d.ts +0 -7
- package/dist/CacheVerifier.js +0 -20
- package/dist/CacheVerifier.js.map +0 -1
- package/dist/astUtils/Editor.js.map +0 -1
- package/dist/astUtils/Editor.spec.js.map +0 -1
- package/dist/bscPlugin/FileWriter.d.ts +0 -6
- package/dist/bscPlugin/FileWriter.js +0 -24
- package/dist/bscPlugin/FileWriter.js.map +0 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +0 -1658
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +0 -1
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +0 -9
- package/dist/bscPlugin/fileProviders/FileProvider.js +0 -51
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +0 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +0 -19
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +0 -1
- package/dist/bscPlugin/serialize/BslibManager.d.ts +0 -9
- package/dist/bscPlugin/serialize/BslibManager.js +0 -40
- package/dist/bscPlugin/serialize/BslibManager.js.map +0 -1
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +0 -9
- package/dist/bscPlugin/serialize/FileSerializer.js +0 -72
- package/dist/bscPlugin/serialize/FileSerializer.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +0 -41
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +0 -11
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js +0 -53
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +0 -2004
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +0 -1
- package/dist/files/AssetFile.d.ts +0 -26
- package/dist/files/AssetFile.js +0 -26
- package/dist/files/AssetFile.js.map +0 -1
- package/dist/files/Factory.d.ts +0 -25
- package/dist/files/Factory.js +0 -22
- package/dist/files/Factory.js.map +0 -1
- package/dist/files/File.d.ts +0 -106
- package/dist/files/File.js +0 -16
- package/dist/files/File.js.map +0 -1
- package/dist/files/LazyFileData.d.ts +0 -20
- package/dist/files/LazyFileData.js +0 -54
- package/dist/files/LazyFileData.js.map +0 -1
- package/dist/files/LazyFileData.spec.js +0 -27
- package/dist/files/LazyFileData.spec.js.map +0 -1
- package/dist/parser/tests/expression/TypeExpression.spec.js +0 -127
- package/dist/parser/tests/expression/TypeExpression.spec.js.map +0 -1
- package/dist/types/AssociativeArrayType.d.ts +0 -11
- package/dist/types/AssociativeArrayType.js +0 -52
- package/dist/types/AssociativeArrayType.js.map +0 -1
- package/dist/types/BaseFunctionType.d.ts +0 -9
- package/dist/types/BaseFunctionType.js +0 -25
- package/dist/types/BaseFunctionType.js.map +0 -1
- package/dist/types/BscTypeKind.d.ts +0 -25
- package/dist/types/BscTypeKind.js +0 -30
- package/dist/types/BscTypeKind.js.map +0 -1
- package/dist/types/BuiltInInterfaceAdder.d.ts +0 -23
- package/dist/types/BuiltInInterfaceAdder.js +0 -160
- package/dist/types/BuiltInInterfaceAdder.js.map +0 -1
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +0 -1
- package/dist/types/BuiltInInterfaceAdder.spec.js +0 -116
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +0 -1
- package/dist/types/ClassType.d.ts +0 -17
- package/dist/types/ClassType.js +0 -58
- package/dist/types/ClassType.js.map +0 -1
- package/dist/types/ClassType.spec.d.ts +0 -1
- package/dist/types/ClassType.spec.js +0 -77
- package/dist/types/ClassType.spec.js.map +0 -1
- package/dist/types/ComponentType.d.ts +0 -26
- package/dist/types/ComponentType.js +0 -83
- package/dist/types/ComponentType.js.map +0 -1
- package/dist/types/EnumType.d.ts +0 -40
- package/dist/types/EnumType.js +0 -81
- package/dist/types/EnumType.js.map +0 -1
- package/dist/types/EnumType.spec.d.ts +0 -1
- package/dist/types/EnumType.spec.js +0 -33
- package/dist/types/EnumType.spec.js.map +0 -1
- package/dist/types/InheritableType.d.ts +0 -28
- package/dist/types/InheritableType.js +0 -152
- package/dist/types/InheritableType.js.map +0 -1
- package/dist/types/NamespaceType.d.ts +0 -12
- package/dist/types/NamespaceType.js +0 -28
- package/dist/types/NamespaceType.js.map +0 -1
- package/dist/types/ReferenceType.d.ts +0 -63
- package/dist/types/ReferenceType.js +0 -423
- package/dist/types/ReferenceType.js.map +0 -1
- package/dist/types/ReferenceType.spec.d.ts +0 -1
- package/dist/types/ReferenceType.spec.js +0 -137
- package/dist/types/ReferenceType.spec.js.map +0 -1
- package/dist/types/TypedFunctionType.d.ts +0 -33
- package/dist/types/TypedFunctionType.js +0 -106
- package/dist/types/TypedFunctionType.js.map +0 -1
- package/dist/types/TypedFunctionType.spec.d.ts +0 -1
- package/dist/types/TypedFunctionType.spec.js +0 -122
- package/dist/types/TypedFunctionType.spec.js.map +0 -1
- package/dist/types/UnionType.d.ts +0 -20
- package/dist/types/UnionType.js +0 -123
- package/dist/types/UnionType.js.map +0 -1
- package/dist/types/UnionType.spec.d.ts +0 -1
- package/dist/types/UnionType.spec.js +0 -130
- package/dist/types/UnionType.spec.js.map +0 -1
- package/dist/types/helper.spec.d.ts +0 -1
- package/dist/types/helper.spec.js +0 -145
- package/dist/types/helper.spec.js.map +0 -1
- package/dist/types/helpers.d.ts +0 -24
- package/dist/types/helpers.js +0 -178
- package/dist/types/helpers.js.map +0 -1
- package/dist/types/index.d.ts +0 -22
- package/dist/types/index.js +0 -39
- package/dist/types/index.js.map +0 -1
- /package/dist/astUtils/{Editor.spec.d.ts → AstEditor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{completions/CompletionsProcessor.spec.d.ts → definition/DefinitionProvider.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{serialize/BslibInjector.spec.d.ts → references/ReferencesProvider.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFileTranspileProcessor.spec.d.ts → symbols/DocumentSymbolProcessor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{validation/ScopeValidator.spec.d.ts → symbols/WorkspaceSymbolProcessor.spec.d.ts} +0 -0
- /package/dist/{files/LazyFileData.spec.d.ts → bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.d.ts} +0 -0
- /package/dist/{parser/tests/expression/TypeExpression.spec.d.ts → types/FunctionType.spec.d.ts} +0 -0
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { CompilerPlugin } from './interfaces';
|
|
2
|
-
import type
|
|
3
|
-
export declare type
|
|
2
|
+
import { type Logger } from './logging';
|
|
3
|
+
export declare type PluginEventArgs<T> = {
|
|
4
|
+
[K in keyof Required<T> as Required<T>[K] extends (...args: any[]) => any ? K : never]: Required<T>[K] extends (...args: any[]) => any ? Parameters<Required<T>[K]> : never;
|
|
5
|
+
};
|
|
4
6
|
export default class PluginInterface<T extends CompilerPlugin = CompilerPlugin> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
private plugins?;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use the `options` parameter pattern instead
|
|
11
|
+
*/
|
|
12
|
+
constructor(plugins?: CompilerPlugin[], logger?: Logger);
|
|
13
|
+
constructor(plugins?: CompilerPlugin[], options?: {
|
|
14
|
+
logger?: Logger;
|
|
7
15
|
suppressErrors?: boolean;
|
|
8
16
|
});
|
|
9
|
-
private plugins;
|
|
10
17
|
private logger;
|
|
11
18
|
/**
|
|
12
19
|
* Should plugin errors cause the program to fail, or should they be caught and simply logged
|
|
@@ -15,11 +22,7 @@ export default class PluginInterface<T extends CompilerPlugin = CompilerPlugin>
|
|
|
15
22
|
/**
|
|
16
23
|
* Call `event` on plugins
|
|
17
24
|
*/
|
|
18
|
-
emit<K extends keyof T & string>(event: K, ...args:
|
|
19
|
-
/**
|
|
20
|
-
* Call `event` on plugins, but allow the plugins to return promises that will be awaited before the next plugin is notified
|
|
21
|
-
*/
|
|
22
|
-
emitAsync<K extends keyof T & string>(event: K, ...args: Arguments<T[K]>): Promise<Arguments<T[K]>[0]>;
|
|
25
|
+
emit<K extends keyof PluginEventArgs<T> & string>(event: K, ...args: PluginEventArgs<T>[K]): void;
|
|
23
26
|
/**
|
|
24
27
|
* Add a plugin to the beginning of the list of plugins
|
|
25
28
|
*/
|
|
@@ -28,11 +31,6 @@ export default class PluginInterface<T extends CompilerPlugin = CompilerPlugin>
|
|
|
28
31
|
* Add a plugin to the end of the list of plugins
|
|
29
32
|
*/
|
|
30
33
|
add<T extends CompilerPlugin = CompilerPlugin>(plugin: T): T;
|
|
31
|
-
/**
|
|
32
|
-
* Find deprecated or removed historic plugin hooks, and warn about them.
|
|
33
|
-
* Some events can be forwards-converted
|
|
34
|
-
*/
|
|
35
|
-
private sanitizePlugin;
|
|
36
34
|
has(plugin: CompilerPlugin): boolean;
|
|
37
35
|
remove<T extends CompilerPlugin = CompilerPlugin>(plugin: T): T;
|
|
38
36
|
/**
|
package/dist/PluginInterface.js
CHANGED
|
@@ -1,55 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const logging_1 = require("./logging");
|
|
4
4
|
class PluginInterface {
|
|
5
5
|
constructor(plugins, options) {
|
|
6
|
-
|
|
7
|
-
this.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.
|
|
6
|
+
var _a;
|
|
7
|
+
this.plugins = plugins;
|
|
8
|
+
(_a = this.plugins) !== null && _a !== void 0 ? _a : (this.plugins = []);
|
|
9
|
+
if ((options === null || options === void 0 ? void 0 : options.constructor.name) === 'Logger') {
|
|
10
|
+
this.logger = options;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.logger = options === null || options === void 0 ? void 0 : options.logger;
|
|
14
|
+
this.suppressErrors = (options === null || options === void 0 ? void 0 : options.suppressErrors) === false ? false : true;
|
|
15
|
+
}
|
|
16
|
+
if (!this.logger) {
|
|
17
|
+
this.logger = (0, logging_1.createLogger)();
|
|
11
18
|
}
|
|
12
19
|
}
|
|
13
20
|
/**
|
|
14
21
|
* Call `event` on plugins
|
|
15
22
|
*/
|
|
16
23
|
emit(event, ...args) {
|
|
17
|
-
var _a, _b;
|
|
18
24
|
for (let plugin of this.plugins) {
|
|
19
25
|
if (plugin[event]) {
|
|
20
26
|
try {
|
|
21
|
-
|
|
27
|
+
this.logger.time(logging_1.LogLevel.debug, [plugin.name, event], () => {
|
|
22
28
|
plugin[event](...args);
|
|
23
29
|
});
|
|
24
30
|
}
|
|
25
31
|
catch (err) {
|
|
26
|
-
|
|
32
|
+
this.logger.error(`Error when calling plugin ${plugin.name}.${event}:`, err);
|
|
27
33
|
if (!this.suppressErrors) {
|
|
28
34
|
throw err;
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
|
-
return args[0];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Call `event` on plugins, but allow the plugins to return promises that will be awaited before the next plugin is notified
|
|
37
|
-
*/
|
|
38
|
-
async emitAsync(event, ...args) {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
for (let plugin of this.plugins) {
|
|
41
|
-
if (plugin[event]) {
|
|
42
|
-
try {
|
|
43
|
-
await ((_a = this.logger) === null || _a === void 0 ? void 0 : _a.time(Logger_1.LogLevel.debug, [plugin.name, event], async () => {
|
|
44
|
-
await Promise.resolve(plugin[event](...args));
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.error(`Error when calling plugin ${plugin.name}.${event}:`, err);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return args[0];
|
|
53
39
|
}
|
|
54
40
|
/**
|
|
55
41
|
* Add a plugin to the beginning of the list of plugins
|
|
@@ -65,56 +51,16 @@ class PluginInterface {
|
|
|
65
51
|
*/
|
|
66
52
|
add(plugin) {
|
|
67
53
|
if (!this.has(plugin)) {
|
|
68
|
-
this.sanitizePlugin(plugin);
|
|
69
54
|
this.plugins.push(plugin);
|
|
70
55
|
}
|
|
71
56
|
return plugin;
|
|
72
57
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Find deprecated or removed historic plugin hooks, and warn about them.
|
|
75
|
-
* Some events can be forwards-converted
|
|
76
|
-
*/
|
|
77
|
-
sanitizePlugin(plugin) {
|
|
78
|
-
var _a, _b, _c;
|
|
79
|
-
const removedHooks = [
|
|
80
|
-
'beforePrepublish',
|
|
81
|
-
'afterPrepublish'
|
|
82
|
-
];
|
|
83
|
-
for (const removedHook of removedHooks) {
|
|
84
|
-
if (plugin[removedHook]) {
|
|
85
|
-
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.error(`Plugin "${plugin.name}": event ${removedHook} is no longer supported and will never be called`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const upgradeWithWarn = {
|
|
89
|
-
beforePublish: 'beforeSerializeProgram',
|
|
90
|
-
afterPublish: 'afterSerializeProgram',
|
|
91
|
-
beforeProgramTranspile: 'beforeBuildProgram',
|
|
92
|
-
afterProgramTranspile: 'afterBuildProgram',
|
|
93
|
-
beforeFileParse: 'beforeProvideFile',
|
|
94
|
-
afterFileParse: 'afterProvideFile',
|
|
95
|
-
beforeFileTranspile: 'beforePrepareFile',
|
|
96
|
-
afterFileTranspile: 'afterPrepareFile',
|
|
97
|
-
beforeFileDispose: 'beforeFileRemove',
|
|
98
|
-
afterFileDispose: 'afterFileRemove'
|
|
99
|
-
};
|
|
100
|
-
for (const [oldEvent, newEvent] of Object.entries(upgradeWithWarn)) {
|
|
101
|
-
if (plugin[oldEvent]) {
|
|
102
|
-
if (!plugin[newEvent]) {
|
|
103
|
-
plugin[newEvent] = plugin[oldEvent];
|
|
104
|
-
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.warn(`Plugin '${plugin.name}': event '${oldEvent}' is no longer supported. It has been converted to '${newEvent}' but you may encounter issues as their signatures do not match.`);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
(_c = this.logger) === null || _c === void 0 ? void 0 : _c.warn(`Plugin "${plugin.name}": event '${oldEvent}' is no longer supported and will never be called`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
58
|
has(plugin) {
|
|
113
59
|
return this.plugins.includes(plugin);
|
|
114
60
|
}
|
|
115
61
|
remove(plugin) {
|
|
116
62
|
if (this.has(plugin)) {
|
|
117
|
-
this.plugins.splice(this.plugins.indexOf(plugin)
|
|
63
|
+
this.plugins.splice(this.plugins.indexOf(plugin));
|
|
118
64
|
}
|
|
119
65
|
return plugin;
|
|
120
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginInterface.js","sourceRoot":"","sources":["../src/PluginInterface.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"PluginInterface.js","sourceRoot":"","sources":["../src/PluginInterface.ts"],"names":[],"mappings":";;AACA,uCAAgE;AAsBhE,MAAqB,eAAe;IAiBhC,YACY,OAA0B,EAClC,OAGU;;QAJF,YAAO,GAAP,OAAO,CAAmB;QAMlC,MAAA,IAAI,CAAC,OAAO,oCAAZ,IAAI,CAAC,OAAO,GAAK,EAAE,EAAC;QACpB,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,IAAI,MAAK,QAAQ,EAAE;YACxC,IAAI,CAAC,MAAM,GAAG,OAA4B,CAAC;SAC9C;aAAM;YACH,IAAI,CAAC,MAAM,GAAI,OAAe,aAAf,OAAO,uBAAP,OAAO,CAAU,MAAM,CAAC;YACvC,IAAI,CAAC,cAAc,GAAG,CAAC,OAAe,aAAf,OAAO,uBAAP,OAAO,CAAU,cAAc,MAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;SACnF;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;SAChC;IACL,CAAC;IASD;;OAEG;IACI,IAAI,CAA8C,KAAQ,EAAE,GAAG,IAA2B;QAC7F,KAAK,IAAI,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;YAC7B,IAAK,MAAc,CAAC,KAAK,CAAC,EAAE;gBACxB,IAAI;oBACA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE;wBACvD,MAAc,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;oBACpC,CAAC,CAAC,CAAC;iBACN;gBAAC,OAAO,GAAG,EAAE;oBACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,MAAM,CAAC,IAAI,IAAI,KAAK,GAAG,EAAE,GAAG,CAAC,CAAC;oBAC7E,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;wBACtB,MAAM,GAAG,CAAC;qBACb;iBACJ;aACJ;SACJ;IACL,CAAC;IAED;;OAEG;IACI,QAAQ,CAA4C,MAAS;QAChE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SAChC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,GAAG,CAA4C,MAAS;QAC3D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,GAAG,CAAC,MAAsB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAEM,MAAM,CAA4C,MAAS;QAC9D,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;SACrD;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,KAAK;QACR,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;CACJ;AApGD,kCAoGC"}
|
package/dist/Program.d.ts
CHANGED
|
@@ -1,48 +1,42 @@
|
|
|
1
|
-
import type { CodeAction, Position, Range, SignatureInformation, Location } from 'vscode-languageserver';
|
|
2
|
-
import type { BsConfig } from './BsConfig';
|
|
1
|
+
import type { CodeAction, CompletionItem, Position, Range, SignatureInformation, Location, DocumentSymbol } from 'vscode-languageserver';
|
|
2
|
+
import type { BsConfig, FinalizedBsConfig } from './BsConfig';
|
|
3
3
|
import { Scope } from './Scope';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import type { BsDiagnostic, FileObj, SemanticToken, FileLink, Hover } from './interfaces';
|
|
7
|
-
import type { File } from './files/File';
|
|
4
|
+
import { BrsFile } from './files/BrsFile';
|
|
5
|
+
import { XmlFile } from './files/XmlFile';
|
|
6
|
+
import type { BsDiagnostic, File, FileReference, FileObj, BscFile, SemanticToken, FileLink, Hover } from './interfaces';
|
|
8
7
|
import { XmlScope } from './XmlScope';
|
|
9
|
-
import { Logger } from './
|
|
8
|
+
import type { Logger } from './logging';
|
|
10
9
|
import PluginInterface from './PluginInterface';
|
|
11
10
|
import type { FunctionStatement } from './parser/Statement';
|
|
12
|
-
import {
|
|
11
|
+
import type { SourceMapGenerator } from 'source-map';
|
|
13
12
|
import type { Statement } from './parser/AstNode';
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export interface SourceObj {
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated use `srcPath` instead
|
|
16
|
+
*/
|
|
17
|
+
pathAbsolute: string;
|
|
18
|
+
srcPath: string;
|
|
19
|
+
source: string;
|
|
20
|
+
definitions?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TranspileObj {
|
|
23
|
+
file: BscFile;
|
|
24
|
+
outputPath: string;
|
|
25
|
+
}
|
|
16
26
|
export interface SignatureInfoObj {
|
|
17
27
|
index: number;
|
|
18
28
|
key: string;
|
|
19
29
|
signature: SignatureInformation;
|
|
20
30
|
}
|
|
21
31
|
export declare class Program {
|
|
22
|
-
/**
|
|
23
|
-
* The root directory for this program
|
|
24
|
-
*/
|
|
25
|
-
options: BsConfig;
|
|
26
32
|
constructor(
|
|
27
33
|
/**
|
|
28
34
|
* The root directory for this program
|
|
29
35
|
*/
|
|
30
36
|
options: BsConfig, logger?: Logger, plugins?: PluginInterface);
|
|
37
|
+
options: FinalizedBsConfig;
|
|
31
38
|
logger: Logger;
|
|
32
|
-
/**
|
|
33
|
-
* An editor that plugins can use to modify program-level things during the build flow. Don't use this to edit files (they have their own `.editor`)
|
|
34
|
-
*/
|
|
35
|
-
editor: Editor;
|
|
36
|
-
/**
|
|
37
|
-
* A factory that creates `File` instances
|
|
38
|
-
*/
|
|
39
|
-
private fileFactory;
|
|
40
39
|
private createGlobalScope;
|
|
41
|
-
private recursivelyAddNodeToSymbolTable;
|
|
42
|
-
/**
|
|
43
|
-
* Do all setup required for the global symbol table.
|
|
44
|
-
*/
|
|
45
|
-
private populateGlobalSymbolTable;
|
|
46
40
|
/**
|
|
47
41
|
* A graph of all files and their dependencies.
|
|
48
42
|
* For example:
|
|
@@ -66,12 +60,6 @@ export declare class Program {
|
|
|
66
60
|
* Should only be set from `this.validate()`
|
|
67
61
|
*/
|
|
68
62
|
private diagnostics;
|
|
69
|
-
private fileSymbolInformation;
|
|
70
|
-
addFileSymbolInfo(file: BrsFile): void;
|
|
71
|
-
getFileSymbolInfo(file: BrsFile): {
|
|
72
|
-
provides: ProvidedSymbolInfo;
|
|
73
|
-
requires: UnresolvedSymbol[];
|
|
74
|
-
};
|
|
75
63
|
/**
|
|
76
64
|
* The path to bslib.brs (the BrightScript runtime for certain BrighterScript features)
|
|
77
65
|
*/
|
|
@@ -80,17 +68,8 @@ export declare class Program {
|
|
|
80
68
|
/**
|
|
81
69
|
* A map of every file loaded into this program, indexed by its original file location
|
|
82
70
|
*/
|
|
83
|
-
files: Record<string,
|
|
84
|
-
|
|
85
|
-
* A map of every file loaded into this program, indexed by its destPath
|
|
86
|
-
*/
|
|
87
|
-
private destMap;
|
|
88
|
-
/**
|
|
89
|
-
* Plugins can contribute multiple virtual files for a single physical file.
|
|
90
|
-
* This collection links the virtual files back to the physical file that produced them.
|
|
91
|
-
* The key is the standardized and lower-cased srcPath
|
|
92
|
-
*/
|
|
93
|
-
private fileClusters;
|
|
71
|
+
files: Record<string, BscFile>;
|
|
72
|
+
private pkgMap;
|
|
94
73
|
private scopes;
|
|
95
74
|
protected addScope(scope: Scope): void;
|
|
96
75
|
/**
|
|
@@ -107,10 +86,6 @@ export declare class Program {
|
|
|
107
86
|
file: XmlFile;
|
|
108
87
|
scope: XmlScope;
|
|
109
88
|
};
|
|
110
|
-
/**
|
|
111
|
-
* Keeps a set of all the components that need to have their types updated during the current validation cycle
|
|
112
|
-
*/
|
|
113
|
-
private componentSymbolsToUpdate;
|
|
114
89
|
/**
|
|
115
90
|
* Register (or replace) the reference to a component in the component map
|
|
116
91
|
*/
|
|
@@ -119,18 +94,6 @@ export declare class Program {
|
|
|
119
94
|
* Remove the specified component from the components map
|
|
120
95
|
*/
|
|
121
96
|
private unregisterComponent;
|
|
122
|
-
/**
|
|
123
|
-
* Adds a component described in an XML to the set of components that needs to be updated this validation cycle.
|
|
124
|
-
* @param xmlFile XML file with <component> tag
|
|
125
|
-
*/
|
|
126
|
-
private addDeferredComponentTypeSymbolCreation;
|
|
127
|
-
private getComponentKey;
|
|
128
|
-
/**
|
|
129
|
-
* Updates the global symbol table with the first component in this.components to have the same name as the component in the file
|
|
130
|
-
* @param componentKey key getting a component from `this.components`
|
|
131
|
-
* @param componentName the unprefixed name of the component that will be added (e.g. 'MyLabel' NOT 'roSgNodeMyLabel')
|
|
132
|
-
*/
|
|
133
|
-
private updateComponentSymbolInGlobalScope;
|
|
134
97
|
/**
|
|
135
98
|
* re-attach the dependency graph with a new key for any component who changed
|
|
136
99
|
* their position in their own named array (only matters when there are multiple
|
|
@@ -154,11 +117,11 @@ export declare class Program {
|
|
|
154
117
|
* @param normalizePath should the provided path be normalized before use
|
|
155
118
|
*/
|
|
156
119
|
hasFile(filePath: string, normalizePath?: boolean): boolean;
|
|
120
|
+
getPkgPath(...args: any[]): any;
|
|
157
121
|
/**
|
|
158
122
|
* roku filesystem is case INsensitive, so find the scope by key case insensitive
|
|
159
|
-
* @param scopeName xml scope names are their `destPath`. Source scope is stored with the key `"source"`
|
|
160
123
|
*/
|
|
161
|
-
getScopeByName(scopeName: string): Scope;
|
|
124
|
+
getScopeByName(scopeName: string): Scope | undefined;
|
|
162
125
|
/**
|
|
163
126
|
* Return all scopes
|
|
164
127
|
*/
|
|
@@ -175,21 +138,36 @@ export declare class Program {
|
|
|
175
138
|
* Remove this file from internal maps
|
|
176
139
|
*/
|
|
177
140
|
private unassignFile;
|
|
141
|
+
/**
|
|
142
|
+
* Load a file into the program. If that file already exists, it is replaced.
|
|
143
|
+
* If file contents are provided, those are used, Otherwise, the file is loaded from the file system
|
|
144
|
+
* @param srcPath the file path relative to the root dir
|
|
145
|
+
* @param fileContents the file contents
|
|
146
|
+
* @deprecated use `setFile` instead
|
|
147
|
+
*/
|
|
148
|
+
addOrReplaceFile<T extends BscFile>(srcPath: string, fileContents: string): T;
|
|
149
|
+
/**
|
|
150
|
+
* Load a file into the program. If that file already exists, it is replaced.
|
|
151
|
+
* @param fileEntry an object that specifies src and dest for the file.
|
|
152
|
+
* @param fileContents the file contents. If not provided, the file will be loaded from disk
|
|
153
|
+
* @deprecated use `setFile` instead
|
|
154
|
+
*/
|
|
155
|
+
addOrReplaceFile<T extends BscFile>(fileEntry: FileObj, fileContents: string): T;
|
|
178
156
|
/**
|
|
179
157
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
180
158
|
* If file contents are provided, those are used, Otherwise, the file is loaded from the file system
|
|
181
159
|
* @param srcDestOrPkgPath the absolute path, the pkg path (i.e. `pkg:/path/to/file.brs`), or the destPath (i.e. `path/to/file.brs` relative to `pkg:/`)
|
|
182
|
-
* @param
|
|
160
|
+
* @param fileContents the file contents
|
|
183
161
|
*/
|
|
184
|
-
setFile<T extends
|
|
162
|
+
setFile<T extends BscFile>(srcDestOrPkgPath: string, fileContents: string): T;
|
|
185
163
|
/**
|
|
186
164
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
187
165
|
* @param fileEntry an object that specifies src and dest for the file.
|
|
188
|
-
* @param
|
|
166
|
+
* @param fileContents the file contents. If not provided, the file will be loaded from disk
|
|
189
167
|
*/
|
|
190
|
-
setFile<T extends
|
|
168
|
+
setFile<T extends BscFile>(fileEntry: FileObj, fileContents: string): T;
|
|
191
169
|
/**
|
|
192
|
-
* Given a srcPath, a
|
|
170
|
+
* Given a srcPath, a pkgPath, or both, resolve whichever is missing, relative to rootDir.
|
|
193
171
|
* @param fileParam an object representing file paths
|
|
194
172
|
* @param rootDir must be a pre-normalized path
|
|
195
173
|
*/
|
|
@@ -199,18 +177,30 @@ export declare class Program {
|
|
|
199
177
|
*/
|
|
200
178
|
private removePkgPrefix;
|
|
201
179
|
/**
|
|
202
|
-
*
|
|
180
|
+
* Ensure source scope is created.
|
|
181
|
+
* Note: automatically called internally, and no-op if it exists already.
|
|
203
182
|
*/
|
|
204
|
-
|
|
183
|
+
createSourceScope(): void;
|
|
205
184
|
/**
|
|
206
|
-
*
|
|
185
|
+
* Find the file by its absolute path. This is case INSENSITIVE, since
|
|
186
|
+
* Roku is a case insensitive file system. It is an error to have multiple files
|
|
187
|
+
* with the same path with only case being different.
|
|
188
|
+
* @param srcPath the absolute path to the file
|
|
189
|
+
* @deprecated use `getFile` instead, which auto-detects the path type
|
|
207
190
|
*/
|
|
208
|
-
|
|
191
|
+
getFileByPathAbsolute<T extends BrsFile | XmlFile>(srcPath: string): T;
|
|
209
192
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
193
|
+
* Get a list of files for the given (platform-normalized) pkgPath array.
|
|
194
|
+
* Missing files are just ignored.
|
|
195
|
+
* @deprecated use `getFiles` instead, which auto-detects the path types
|
|
212
196
|
*/
|
|
213
|
-
|
|
197
|
+
getFilesByPkgPaths<T extends BscFile[]>(pkgPaths: string[]): T;
|
|
198
|
+
/**
|
|
199
|
+
* Get a file with the specified (platform-normalized) pkg path.
|
|
200
|
+
* If not found, return undefined
|
|
201
|
+
* @deprecated use `getFile` instead, which auto-detects the path type
|
|
202
|
+
*/
|
|
203
|
+
getFileByPkgPath<T extends BscFile>(pkgPath: string): T;
|
|
214
204
|
/**
|
|
215
205
|
* Remove a set of files from the program
|
|
216
206
|
* @param srcPaths can be an array of srcPath or destPath strings
|
|
@@ -219,29 +209,14 @@ export declare class Program {
|
|
|
219
209
|
removeFiles(srcPaths: string[], normalizePath?: boolean): void;
|
|
220
210
|
/**
|
|
221
211
|
* Remove a file from the program
|
|
222
|
-
* @param filePath can be a srcPath, a
|
|
212
|
+
* @param filePath can be a srcPath, a pkgPath, or a destPath (same as pkgPath but without `pkg:/`)
|
|
223
213
|
* @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
|
|
224
214
|
*/
|
|
225
|
-
removeFile(filePath: string, normalizePath?: boolean
|
|
226
|
-
lastValidationInfo: Map<string, {
|
|
227
|
-
symbolsNotDefinedInEveryScope: {
|
|
228
|
-
symbol: UnresolvedSymbol;
|
|
229
|
-
scope: Scope;
|
|
230
|
-
}[];
|
|
231
|
-
duplicateSymbolsInSameScope: {
|
|
232
|
-
symbol: UnresolvedSymbol;
|
|
233
|
-
scope: Scope;
|
|
234
|
-
}[];
|
|
235
|
-
symbolsNotConsistentAcrossScopes: {
|
|
236
|
-
symbol: UnresolvedSymbol;
|
|
237
|
-
scopes: Scope[];
|
|
238
|
-
}[];
|
|
239
|
-
}>;
|
|
215
|
+
removeFile(filePath: string, normalizePath?: boolean): void;
|
|
240
216
|
/**
|
|
241
217
|
* Traverse the entire project, and validate all scopes
|
|
242
218
|
*/
|
|
243
219
|
validate(): void;
|
|
244
|
-
private detectIncompatibleSymbolsAcrossScopes;
|
|
245
220
|
/**
|
|
246
221
|
* Flag all duplicate component names
|
|
247
222
|
*/
|
|
@@ -251,22 +226,22 @@ export declare class Program {
|
|
|
251
226
|
* @param filePaths can be an array of srcPath or a destPath strings
|
|
252
227
|
* @param normalizePath should this function repair and standardize the paths? Passing false should have a performance boost if you can guarantee your paths are already sanitized
|
|
253
228
|
*/
|
|
254
|
-
getFiles<T extends
|
|
229
|
+
getFiles<T extends BscFile>(filePaths: string[], normalizePath?: boolean): T[];
|
|
255
230
|
/**
|
|
256
231
|
* Get the file at the given path
|
|
257
232
|
* @param filePath can be a srcPath or a destPath
|
|
258
233
|
* @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
|
|
259
234
|
*/
|
|
260
|
-
getFile<T extends
|
|
235
|
+
getFile<T extends BscFile>(filePath: string, normalizePath?: boolean): T;
|
|
261
236
|
/**
|
|
262
237
|
* Get a list of all scopes the file is loaded into
|
|
263
238
|
* @param file the file
|
|
264
239
|
*/
|
|
265
|
-
getScopesForFile(file:
|
|
240
|
+
getScopesForFile(file: XmlFile | BrsFile | string): Scope[];
|
|
266
241
|
/**
|
|
267
242
|
* Get the first found scope for a file.
|
|
268
243
|
*/
|
|
269
|
-
getFirstScopeForFile(file:
|
|
244
|
+
getFirstScopeForFile(file: XmlFile | BrsFile): Scope | undefined;
|
|
270
245
|
getStatementsByName(name: string, originFile: BrsFile, namespaceName?: string): FileLink<Statement>[];
|
|
271
246
|
getStatementsForXmlFile(scope: XmlScope, filterName?: string): FileLink<FunctionStatement>[];
|
|
272
247
|
/**
|
|
@@ -274,11 +249,11 @@ export declare class Program {
|
|
|
274
249
|
* @param filePath can be a srcPath or a destPath
|
|
275
250
|
* @param position the position (line & column) where completions should be found
|
|
276
251
|
*/
|
|
277
|
-
getCompletions(filePath: string, position: Position):
|
|
252
|
+
getCompletions(filePath: string, position: Position): CompletionItem[];
|
|
278
253
|
/**
|
|
279
254
|
* Goes through each file and builds a list of workspace symbols for the program. Used by LanguageServer's onWorkspaceSymbol functionality
|
|
280
255
|
*/
|
|
281
|
-
getWorkspaceSymbols(): import("vscode-languageserver").
|
|
256
|
+
getWorkspaceSymbols(): import("vscode-languageserver-types").WorkspaceSymbol[];
|
|
282
257
|
/**
|
|
283
258
|
* Given a position in a file, if the position is sitting on some type of identifier,
|
|
284
259
|
* go to the definition of that identifier (where this thing was first defined)
|
|
@@ -288,6 +263,11 @@ export declare class Program {
|
|
|
288
263
|
* Get hover information for a file and position
|
|
289
264
|
*/
|
|
290
265
|
getHover(srcPath: string, position: Position): Hover[];
|
|
266
|
+
/**
|
|
267
|
+
* Get full list of document symbols for a file
|
|
268
|
+
* @param srcPath path to the file
|
|
269
|
+
*/
|
|
270
|
+
getDocumentSymbols(srcPath: string): DocumentSymbol[] | undefined;
|
|
291
271
|
/**
|
|
292
272
|
* Compute code actions for the given file and range
|
|
293
273
|
*/
|
|
@@ -295,9 +275,14 @@ export declare class Program {
|
|
|
295
275
|
/**
|
|
296
276
|
* Get semantic tokens for the specified file
|
|
297
277
|
*/
|
|
298
|
-
getSemanticTokens(srcPath: string): SemanticToken[];
|
|
278
|
+
getSemanticTokens(srcPath: string): SemanticToken[] | undefined;
|
|
299
279
|
getSignatureHelp(filepath: string, position: Position): SignatureInfoObj[];
|
|
300
|
-
getReferences(srcPath: string, position: Position): Location[]
|
|
280
|
+
getReferences(srcPath: string, position: Position): Location[];
|
|
281
|
+
/**
|
|
282
|
+
* Get a list of all script imports, relative to the specified pkgPath
|
|
283
|
+
* @param sourcePkgPath - the pkgPath of the source that wants to resolve script imports.
|
|
284
|
+
*/
|
|
285
|
+
getScriptImportCompletions(sourcePkgPath: string, scriptImport: FileReference): CompletionItem[];
|
|
301
286
|
/**
|
|
302
287
|
* Transpile a single file and get the result as a string.
|
|
303
288
|
* This does not write anything to the file system.
|
|
@@ -307,64 +292,46 @@ export declare class Program {
|
|
|
307
292
|
* @param filePath can be a srcPath or a destPath
|
|
308
293
|
*/
|
|
309
294
|
getTranspiledFileContents(filePath: string): Promise<FileTranspileResult>;
|
|
310
|
-
private getTranspiledFileContentsPipeline;
|
|
311
295
|
/**
|
|
312
|
-
*
|
|
296
|
+
* Internal function used to transpile files.
|
|
297
|
+
* This does not write anything to the file system
|
|
313
298
|
*/
|
|
314
|
-
private
|
|
315
|
-
private
|
|
299
|
+
private _getTranspiledFileContents;
|
|
300
|
+
private beforeProgramTranspile;
|
|
301
|
+
transpile(fileEntries: FileObj[], stagingDir: string): Promise<void>;
|
|
302
|
+
private afterProgramTranspile;
|
|
316
303
|
/**
|
|
317
|
-
*
|
|
318
|
-
* @param files the list of files that should be prepared
|
|
319
|
-
*/
|
|
320
|
-
private prepare;
|
|
321
|
-
/**
|
|
322
|
-
* Generate the contents of every file
|
|
304
|
+
* Find a list of files in the program that have a function with the given name (case INsensitive)
|
|
323
305
|
*/
|
|
324
|
-
|
|
306
|
+
findFilesForFunction(functionName: string): BscFile[];
|
|
325
307
|
/**
|
|
326
|
-
*
|
|
308
|
+
* Find a list of files in the program that have a class with the given name (case INsensitive)
|
|
327
309
|
*/
|
|
328
|
-
|
|
329
|
-
|
|
310
|
+
findFilesForClass(className: string): BscFile[];
|
|
311
|
+
findFilesForNamespace(name: string): BscFile[];
|
|
312
|
+
findFilesForEnum(name: string): BscFile[];
|
|
313
|
+
private _manifest;
|
|
330
314
|
/**
|
|
331
|
-
*
|
|
332
|
-
* @param
|
|
315
|
+
* Modify a parsed manifest map by reading `bs_const` and injecting values from `options.manifest.bs_const`
|
|
316
|
+
* @param parsedManifest The manifest map to read from and modify
|
|
333
317
|
*/
|
|
334
|
-
|
|
318
|
+
private buildBsConstsIntoParsedManifest;
|
|
335
319
|
/**
|
|
336
|
-
*
|
|
320
|
+
* Try to find and load the manifest into memory
|
|
321
|
+
* @param manifestFileObj A pointer to a potential manifest file object found during loading
|
|
322
|
+
* @param replaceIfAlreadyLoaded should we overwrite the internal `_manifest` if it already exists
|
|
337
323
|
*/
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Find a list of files in the program that have a class with the given name (case INsensitive)
|
|
341
|
-
*/
|
|
342
|
-
findFilesForClass(className: string): File[];
|
|
343
|
-
findFilesForNamespace(name: string): File[];
|
|
344
|
-
findFilesForEnum(name: string): File[];
|
|
324
|
+
loadManifest(manifestFileObj?: FileObj, replaceIfAlreadyLoaded?: boolean): void;
|
|
345
325
|
/**
|
|
346
326
|
* Get a map of the manifest information
|
|
347
327
|
*/
|
|
348
328
|
getManifest(): Map<string, string>;
|
|
349
|
-
private _manifest;
|
|
350
329
|
dispose(): void;
|
|
351
330
|
}
|
|
352
331
|
export interface FileTranspileResult {
|
|
353
332
|
srcPath: string;
|
|
354
|
-
destPath: string;
|
|
355
333
|
pkgPath: string;
|
|
356
334
|
code: string;
|
|
357
|
-
map:
|
|
335
|
+
map: SourceMapGenerator;
|
|
358
336
|
typedef: string;
|
|
359
337
|
}
|
|
360
|
-
export interface ProgramBuildOptions {
|
|
361
|
-
/**
|
|
362
|
-
* The directory where the final built files should be placed. This directory will be cleared before running
|
|
363
|
-
*/
|
|
364
|
-
stagingDir?: string;
|
|
365
|
-
/**
|
|
366
|
-
* An array of files to build. If omitted, the entire list of files from the program will be used instead.
|
|
367
|
-
* Typically you will want to leave this blank
|
|
368
|
-
*/
|
|
369
|
-
files?: File[];
|
|
370
|
-
}
|