brighterscript 1.0.0-alpha.3 → 1.0.0-alpha.31
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 +1249 -285
- package/README.md +61 -131
- package/bsconfig.schema.json +68 -2
- 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 +42 -0
- package/dist/AstValidationSegmenter.js +232 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +51 -6
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.d.ts +5 -6
- package/dist/Cache.js +12 -11
- 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 +11 -2
- package/dist/CodeActionUtil.js +17 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +7 -6
- package/dist/CommentFlagProcessor.js +10 -7
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +67 -0
- package/dist/CrossScopeValidator.js +625 -0
- package/dist/CrossScopeValidator.js.map +1 -0
- package/dist/DependencyGraph.d.ts +8 -3
- package/dist/DependencyGraph.js +49 -16
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.d.ts +5 -3
- package/dist/DiagnosticCollection.js +18 -16
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +8 -4
- package/dist/DiagnosticFilterer.js +77 -44
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticManager.d.ts +56 -0
- package/dist/DiagnosticManager.js +218 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +187 -20
- package/dist/DiagnosticMessages.js +247 -29
- 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 +72 -47
- package/dist/LanguageServer.js +544 -312
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +9 -10
- package/dist/Logger.js +36 -30
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +29 -7
- package/dist/PluginInterface.js +90 -7
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +199 -100
- package/dist/Program.js +1056 -700
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +29 -18
- package/dist/ProgramBuilder.js +170 -132
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +144 -109
- package/dist/Scope.js +533 -552
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.d.ts +14 -0
- package/dist/SemanticTokenUtils.js +85 -0
- package/dist/SemanticTokenUtils.js.map +1 -0
- package/dist/Stopwatch.d.ts +4 -0
- package/dist/Stopwatch.js +8 -1
- package/dist/Stopwatch.js.map +1 -1
- package/dist/SymbolTable.d.ts +91 -24
- package/dist/SymbolTable.js +290 -64
- package/dist/SymbolTable.js.map +1 -1
- package/dist/SymbolTypeFlag.d.ts +9 -0
- package/dist/SymbolTypeFlag.js +14 -0
- package/dist/SymbolTypeFlag.js.map +1 -0
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/Watcher.d.ts +0 -3
- package/dist/Watcher.js +0 -3
- package/dist/Watcher.js.map +1 -1
- package/dist/XmlScope.d.ts +5 -15
- package/dist/XmlScope.js +35 -87
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +50 -0
- package/dist/astUtils/CachedLookups.js +331 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/Editor.d.ts +69 -0
- package/dist/astUtils/Editor.js +245 -0
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/Editor.spec.js +258 -0
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +33 -10
- package/dist/astUtils/creators.js +224 -30
- 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 +146 -82
- package/dist/astUtils/reflection.js +308 -132
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +267 -162
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +14 -14
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +115 -53
- package/dist/astUtils/visitors.js +70 -13
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +465 -51
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -8
- package/dist/astUtils/xml.js +10 -5
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +22 -1
- package/dist/bscPlugin/BscPlugin.js +88 -0
- 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 +137 -0
- package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +26 -17
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +94 -20
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +60 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +601 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2139 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.d.ts +13 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js +210 -0
- package/dist/bscPlugin/definition/DefinitionProvider.js.map +1 -0
- package/dist/bscPlugin/definition/DefinitionProvider.spec.js +88 -0
- package/dist/bscPlugin/definition/DefinitionProvider.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 +18 -0
- package/dist/bscPlugin/hover/HoverProcessor.js +218 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +737 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -0
- 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.d.ts +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 +14 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +144 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +504 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
- 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/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.d.ts +1 -0
- package/dist/bscPlugin/symbols/DocumentSymbolProcessor.spec.js +291 -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.d.ts +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 +21 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +199 -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/BrsFileAfterValidator.d.ts +7 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js +18 -0
- package/dist/bscPlugin/validation/BrsFileAfterValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +34 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +462 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +758 -0
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +11 -0
- package/dist/bscPlugin/validation/ProgramValidator.js +33 -0
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +123 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1026 -0
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2897 -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 +117 -11
- 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 +10 -3
- package/dist/diagnosticUtils.js +58 -21
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +8 -12
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +24 -0
- package/dist/files/AssetFile.js +25 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +858 -153
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +147 -82
- package/dist/files/BrsFile.js +853 -911
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +3056 -836
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +101 -0
- package/dist/files/BscFile.js +15 -0
- package/dist/files/BscFile.js.map +1 -0
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +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 +73 -41
- package/dist/files/XmlFile.js +126 -138
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +450 -318
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +62 -52
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
- package/dist/files/tests/optionalChaning.spec.js +152 -0
- package/dist/files/tests/optionalChaning.spec.js.map +1 -0
- package/dist/globalCallables.d.ts +3 -1
- package/dist/globalCallables.js +416 -162
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +25 -3
- package/dist/index.js +42 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +717 -119
- package/dist/interfaces.js +21 -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 +40 -9
- package/dist/lexer/Lexer.js +191 -49
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +775 -563
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +11 -3
- package/dist/lexer/Token.js +10 -2
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +27 -1
- package/dist/lexer/TokenKind.js +112 -5
- 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 +181 -0
- package/dist/parser/AstNode.js +246 -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 +12 -2
- package/dist/parser/BrsTranspileState.js +6 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +454 -210
- package/dist/parser/Expression.js +953 -498
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +200 -95
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +106 -120
- package/dist/parser/Parser.js +1432 -931
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +1383 -456
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +44 -6
- package/dist/parser/SGParser.js +212 -185
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +30 -28
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +293 -50
- package/dist/parser/SGTypes.js +540 -187
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +759 -247
- package/dist/parser/Statement.js +1785 -607
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +45 -34
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +18 -8
- package/dist/parser/TranspileState.js +76 -12
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +10 -9
- package/dist/parser/tests/Parser.spec.js +18 -14
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +79 -69
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +53 -47
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +217 -196
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +48 -42
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +31 -31
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +157 -120
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +202 -139
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +25 -25
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +150 -41
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +18 -18
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +257 -257
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +160 -90
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +38 -38
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +196 -98
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +42 -42
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +42 -42
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/Relational.spec.js +44 -44
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +31 -31
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +230 -90
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +377 -148
- 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 +126 -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 +37 -37
- 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 +45 -45
- 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.d.ts +1 -0
- package/dist/parser/tests/statement/Enum.spec.js +745 -0
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
- package/dist/parser/tests/statement/For.spec.d.ts +1 -0
- package/dist/parser/tests/statement/For.spec.js +45 -0
- package/dist/parser/tests/statement/For.spec.js.map +1 -0
- package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ForEach.spec.js +36 -0
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
- package/dist/parser/tests/statement/Function.spec.js +208 -198
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +16 -15
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +51 -51
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +110 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/LibraryStatement.spec.js +18 -18
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +123 -163
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +125 -108
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +51 -49
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +110 -97
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +13 -12
- 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 +26 -15
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +6 -6
- package/dist/preprocessor/Manifest.js +17 -38
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.d.ts +1 -0
- package/dist/preprocessor/Manifest.spec.js +78 -103
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/roku-types/data.json +19369 -0
- package/dist/roku-types/index.d.ts +5497 -0
- package/dist/roku-types/index.js +11 -0
- package/dist/roku-types/index.js.map +1 -0
- package/dist/types/ArrayType.d.ts +9 -5
- package/dist/types/ArrayType.js +68 -24
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +39 -11
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +14 -0
- package/dist/types/AssociativeArrayType.js +60 -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 +10 -5
- package/dist/types/BooleanType.js +21 -9
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +10 -4
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +29 -3
- package/dist/types/BscType.js +121 -0
- 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 +25 -0
- package/dist/types/BuiltInInterfaceAdder.js +201 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +115 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +16 -0
- package/dist/types/ClassType.js +57 -0
- package/dist/types/ClassType.js.map +1 -0
- package/dist/types/ClassType.spec.d.ts +1 -0
- package/dist/types/ClassType.spec.js +76 -0
- package/dist/types/ClassType.spec.js.map +1 -0
- package/dist/types/ComponentType.d.ts +27 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +10 -5
- package/dist/types/DoubleType.js +25 -18
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +12 -4
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +12 -5
- package/dist/types/DynamicType.js +22 -6
- 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 +40 -0
- package/dist/types/EnumType.js +80 -0
- package/dist/types/EnumType.js.map +1 -0
- 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 +10 -5
- package/dist/types/FloatType.js +25 -18
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -4
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +10 -22
- package/dist/types/FunctionType.js +26 -63
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +28 -0
- package/dist/types/InheritableType.js +157 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +10 -5
- package/dist/types/IntegerType.js +25 -18
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +8 -4
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +14 -6
- package/dist/types/InterfaceType.js +26 -15
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.d.ts +1 -0
- package/dist/types/InterfaceType.spec.js +227 -0
- package/dist/types/InterfaceType.spec.js.map +1 -0
- package/dist/types/InvalidType.d.ts +9 -5
- package/dist/types/InvalidType.js +20 -9
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +8 -4
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +10 -5
- package/dist/types/LongIntegerType.js +25 -18
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +10 -4
- 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 +10 -5
- package/dist/types/ObjectType.js +23 -9
- 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 +79 -0
- package/dist/types/ReferenceType.js +522 -0
- package/dist/types/ReferenceType.js.map +1 -0
- package/dist/types/ReferenceType.spec.d.ts +1 -0
- package/dist/types/ReferenceType.spec.js +151 -0
- package/dist/types/ReferenceType.spec.js.map +1 -0
- package/dist/types/StringType.d.ts +13 -5
- package/dist/types/StringType.js +25 -9
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +3 -3
- package/dist/types/StringType.spec.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 +8 -6
- package/dist/types/UninitializedType.js +15 -9
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +20 -0
- package/dist/types/UnionType.js +127 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +129 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +10 -5
- package/dist/types/VoidType.js +20 -9
- 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 +144 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +26 -0
- package/dist/types/helpers.js +191 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util.d.ts +218 -106
- package/dist/util.js +1310 -320
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +9 -15
- package/dist/validators/ClassValidator.js +81 -134
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +169 -138
- package/dist/astUtils/index.d.ts +0 -7
- package/dist/astUtils/index.js +0 -26
- package/dist/astUtils/index.js.map +0 -1
- package/dist/lexer/index.d.ts +0 -3
- package/dist/lexer/index.js +0 -17
- package/dist/lexer/index.js.map +0 -1
- package/dist/parser/index.d.ts +0 -3
- package/dist/parser/index.js +0 -16
- package/dist/parser/index.js.map +0 -1
- package/dist/preprocessor/Chunk.d.ts +0 -82
- package/dist/preprocessor/Chunk.js +0 -77
- package/dist/preprocessor/Chunk.js.map +0 -1
- package/dist/preprocessor/Preprocessor.d.ts +0 -60
- package/dist/preprocessor/Preprocessor.js +0 -156
- package/dist/preprocessor/Preprocessor.js.map +0 -1
- package/dist/preprocessor/Preprocessor.spec.js +0 -152
- package/dist/preprocessor/Preprocessor.spec.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.d.ts +0 -61
- package/dist/preprocessor/PreprocessorParser.js +0 -194
- package/dist/preprocessor/PreprocessorParser.js.map +0 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +0 -116
- package/dist/preprocessor/PreprocessorParser.spec.js.map +0 -1
- package/dist/preprocessor/index.d.ts +0 -3
- package/dist/preprocessor/index.js +0 -16
- package/dist/preprocessor/index.js.map +0 -1
- package/dist/types/CustomType.d.ts +0 -10
- package/dist/types/CustomType.js +0 -35
- package/dist/types/CustomType.js.map +0 -1
- package/dist/types/FunctionType.spec.js +0 -29
- package/dist/types/FunctionType.spec.js.map +0 -1
- package/dist/types/LazyType.d.ts +0 -15
- package/dist/types/LazyType.js +0 -32
- package/dist/types/LazyType.js.map +0 -1
- /package/dist/{preprocessor/Preprocessor.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Range, Diagnostic, CodeAction, Position, CompletionItem, Location, DocumentSymbol, WorkspaceSymbol } from 'vscode-languageserver-protocol';
|
|
2
3
|
import type { Scope } from './Scope';
|
|
3
4
|
import type { BrsFile } from './files/BrsFile';
|
|
4
5
|
import type { XmlFile } from './files/XmlFile';
|
|
5
|
-
import type {
|
|
6
|
+
import type { TypedFunctionType } from './types/TypedFunctionType';
|
|
6
7
|
import type { ParseMode } from './parser/Parser';
|
|
7
8
|
import type { Program } from './Program';
|
|
8
9
|
import type { ProgramBuilder } from './ProgramBuilder';
|
|
9
|
-
import type {
|
|
10
|
+
import type { ClassStatement, ConstStatement, EnumStatement, FunctionStatement, NamespaceStatement } from './parser/Statement';
|
|
11
|
+
import type { AstNode, Expression, Statement } from './parser/AstNode';
|
|
10
12
|
import type { TranspileState } from './parser/TranspileState';
|
|
11
13
|
import type { SourceNode } from 'source-map';
|
|
12
14
|
import type { BscType } from './types/BscType';
|
|
15
|
+
import type { Identifier, Token } from './lexer/Token';
|
|
16
|
+
import type { SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver';
|
|
17
|
+
import type { SymbolTable } from './SymbolTable';
|
|
18
|
+
import type { SymbolTypeFlag } from './SymbolTypeFlag';
|
|
19
|
+
import type { Editor } from './astUtils/Editor';
|
|
20
|
+
import type { BscFile } from './files/BscFile';
|
|
21
|
+
import type { FileFactory } from './files/Factory';
|
|
22
|
+
import type { LazyFileData } from './files/LazyFileData';
|
|
23
|
+
import type { BscTypeKind } from './types/BscTypeKind';
|
|
13
24
|
export interface BsDiagnostic extends Diagnostic {
|
|
14
25
|
file: BscFile;
|
|
15
26
|
/**
|
|
@@ -17,7 +28,16 @@ export interface BsDiagnostic extends Diagnostic {
|
|
|
17
28
|
*/
|
|
18
29
|
data?: any;
|
|
19
30
|
}
|
|
20
|
-
export
|
|
31
|
+
export interface DiagnosticContext {
|
|
32
|
+
scopeSpecific?: boolean;
|
|
33
|
+
scope?: Scope;
|
|
34
|
+
tags?: string[];
|
|
35
|
+
segment?: AstNode;
|
|
36
|
+
}
|
|
37
|
+
export interface DiagnosticContextPair {
|
|
38
|
+
diagnostic: BsDiagnostic;
|
|
39
|
+
context?: DiagnosticContext;
|
|
40
|
+
}
|
|
21
41
|
export interface Callable {
|
|
22
42
|
file: BscFile;
|
|
23
43
|
name: string;
|
|
@@ -25,7 +45,7 @@ export interface Callable {
|
|
|
25
45
|
* Is the callable declared as "sub". If falsey, assumed declared as "function"
|
|
26
46
|
*/
|
|
27
47
|
isSub: boolean;
|
|
28
|
-
type:
|
|
48
|
+
type: TypedFunctionType;
|
|
29
49
|
/**
|
|
30
50
|
* A short description of the callable. Should be a short sentence.
|
|
31
51
|
*/
|
|
@@ -54,29 +74,13 @@ export interface Callable {
|
|
|
54
74
|
*/
|
|
55
75
|
functionStatement: FunctionStatement;
|
|
56
76
|
}
|
|
57
|
-
export interface FunctionCall {
|
|
58
|
-
/**
|
|
59
|
-
* The full range of this function call (from the start of the function name to its closing paren)
|
|
60
|
-
*/
|
|
61
|
-
range: Range;
|
|
62
|
-
functionExpression: FunctionExpression;
|
|
63
|
-
file: BscFile;
|
|
64
|
-
name: string;
|
|
65
|
-
args: CallableArg[];
|
|
66
|
-
nameRange: Range;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* An argument for an expression call.
|
|
70
|
-
*/
|
|
71
|
-
export interface CallableArg {
|
|
72
|
-
text: string;
|
|
73
|
-
type: BscType;
|
|
74
|
-
range: Range;
|
|
75
|
-
}
|
|
76
77
|
export interface CallableParam {
|
|
77
78
|
name: string;
|
|
78
79
|
type: BscType;
|
|
79
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Is this parameter required or optional?
|
|
82
|
+
*/
|
|
83
|
+
isOptional: boolean;
|
|
80
84
|
/**
|
|
81
85
|
* Indicates that an unlimited number of arguments can be passed in
|
|
82
86
|
*/
|
|
@@ -91,12 +95,12 @@ export interface FileObj {
|
|
|
91
95
|
*/
|
|
92
96
|
export interface FileReference {
|
|
93
97
|
/**
|
|
94
|
-
* The
|
|
98
|
+
* The destPath for the referenced file.
|
|
95
99
|
*/
|
|
96
|
-
|
|
100
|
+
destPath: string;
|
|
97
101
|
text: string;
|
|
98
102
|
/**
|
|
99
|
-
* The file that is doing the import. Note this is NOT the file the
|
|
103
|
+
* The file that is doing the import. Note this is NOT the file the destPath points to.
|
|
100
104
|
*/
|
|
101
105
|
sourceFile: XmlFile | BrsFile;
|
|
102
106
|
/**
|
|
@@ -109,7 +113,7 @@ export interface FileReference {
|
|
|
109
113
|
}
|
|
110
114
|
export interface VariableDeclaration {
|
|
111
115
|
name: string;
|
|
112
|
-
|
|
116
|
+
getType: () => BscType;
|
|
113
117
|
/**
|
|
114
118
|
* The range for the variable name
|
|
115
119
|
*/
|
|
@@ -154,54 +158,253 @@ export interface CommentFlag {
|
|
|
154
158
|
export declare type CompilerPluginFactory = () => CompilerPlugin;
|
|
155
159
|
export interface CompilerPlugin {
|
|
156
160
|
name: string;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Called before a new program is created
|
|
163
|
+
*/
|
|
164
|
+
beforeProgramCreate?(event: BeforeProgramCreateEvent): any;
|
|
165
|
+
/**
|
|
166
|
+
* Called after a new program is created
|
|
167
|
+
*/
|
|
168
|
+
afterProgramCreate?(event: AfterProgramCreateEvent): any;
|
|
169
|
+
/**
|
|
170
|
+
* Called before the program gets prepared for building
|
|
171
|
+
*/
|
|
172
|
+
beforePrepareProgram?(event: BeforePrepareProgramEvent): any;
|
|
173
|
+
/**
|
|
174
|
+
* Called when the program gets prepared for building
|
|
175
|
+
*/
|
|
176
|
+
prepareProgram?(event: PrepareProgramEvent): any;
|
|
177
|
+
/**
|
|
178
|
+
* Called after the program gets prepared for building
|
|
179
|
+
*/
|
|
180
|
+
afterPrepareProgram?(event: AfterPrepareProgramEvent): any;
|
|
181
|
+
/**
|
|
182
|
+
* Called before the entire program is validated
|
|
183
|
+
*/
|
|
184
|
+
beforeProgramValidate?(event: BeforeProgramValidateEvent): any;
|
|
185
|
+
/**
|
|
186
|
+
* Called before the entire program is validated
|
|
187
|
+
*/
|
|
188
|
+
onProgramValidate?(event: OnProgramValidateEvent): any;
|
|
189
|
+
/**
|
|
190
|
+
* Called after the program has been validated
|
|
191
|
+
*/
|
|
192
|
+
afterProgramValidate?(event: AfterProgramValidateEvent): any;
|
|
193
|
+
/**
|
|
194
|
+
* Called right before the program is disposed/destroyed
|
|
195
|
+
*/
|
|
196
|
+
beforeProgramDispose?(event: BeforeProgramDisposeEvent): any;
|
|
197
|
+
/**
|
|
198
|
+
* Emitted before the program starts collecting completions
|
|
199
|
+
*/
|
|
200
|
+
beforeProvideCompletions?(event: BeforeProvideCompletionsEvent): any;
|
|
201
|
+
/**
|
|
202
|
+
* Use this event to contribute completions
|
|
203
|
+
*/
|
|
204
|
+
provideCompletions?(event: ProvideCompletionsEvent): any;
|
|
205
|
+
/**
|
|
206
|
+
* Emitted after the program has finished collecting completions, but before they are sent to the client
|
|
207
|
+
*/
|
|
208
|
+
afterProvideCompletions?(event: AfterProvideCompletionsEvent): any;
|
|
209
|
+
/**
|
|
210
|
+
* Called before the `provideHover` hook. Use this if you need to prepare any of the in-memory objects before the `provideHover` gets called
|
|
211
|
+
*/
|
|
212
|
+
beforeProvideHover?(event: BeforeProvideHoverEvent): any;
|
|
213
|
+
/**
|
|
214
|
+
* Called when bsc looks for hover information. Use this if your plugin wants to contribute hover information.
|
|
215
|
+
*/
|
|
216
|
+
provideHover?(event: ProvideHoverEvent): any;
|
|
217
|
+
/**
|
|
218
|
+
* Called after the `provideHover` hook. Use this if you want to intercept or sanitize the hover data (even from other plugins) before it gets sent to the client.
|
|
219
|
+
*/
|
|
220
|
+
afterProvideHover?(event: AfterProvideHoverEvent): any;
|
|
221
|
+
/**
|
|
222
|
+
* Called after a scope was created
|
|
223
|
+
*/
|
|
224
|
+
afterScopeCreate?(event: AfterScopeCreateEvent): any;
|
|
225
|
+
beforeScopeDispose?(event: BeforeScopeDisposeEvent): any;
|
|
226
|
+
onScopeDispose?(event: OnScopeDisposeEvent): any;
|
|
227
|
+
afterScopeDispose?(event: AfterScopeDisposeEvent): any;
|
|
228
|
+
beforeScopeValidate?(event: BeforeScopeValidateEvent): any;
|
|
229
|
+
/**
|
|
230
|
+
* Called before the `provideDefinition` hook
|
|
231
|
+
*/
|
|
232
|
+
beforeProvideDefinition?(event: BeforeProvideDefinitionEvent): any;
|
|
233
|
+
/**
|
|
234
|
+
* Provide one or more `Location`s where the symbol at the given position was originally defined
|
|
235
|
+
* @param event
|
|
236
|
+
*/
|
|
237
|
+
provideDefinition?(event: ProvideDefinitionEvent): any;
|
|
238
|
+
/**
|
|
239
|
+
* Called after `provideDefinition`. Use this if you want to intercept or sanitize the definition data provided by bsc or other plugins
|
|
240
|
+
* @param event
|
|
241
|
+
*/
|
|
242
|
+
afterProvideDefinition?(event: AfterProvideDefinitionEvent): any;
|
|
243
|
+
/**
|
|
244
|
+
* Called before the `provideReferences` hook
|
|
245
|
+
*/
|
|
246
|
+
beforeProvideReferences?(event: BeforeProvideReferencesEvent): any;
|
|
247
|
+
/**
|
|
248
|
+
* Provide all of the `Location`s where the symbol at the given position is located
|
|
249
|
+
* @param event
|
|
250
|
+
*/
|
|
251
|
+
provideReferences?(event: ProvideReferencesEvent): any;
|
|
252
|
+
/**
|
|
253
|
+
* Called after `provideReferences`. Use this if you want to intercept or sanitize the references data provided by bsc or other plugins
|
|
254
|
+
* @param event
|
|
255
|
+
*/
|
|
256
|
+
afterProvideReferences?(event: AfterProvideReferencesEvent): any;
|
|
257
|
+
/**
|
|
258
|
+
* Called before the `provideDocumentSymbols` hook
|
|
259
|
+
*/
|
|
260
|
+
beforeProvideDocumentSymbols?(event: BeforeProvideDocumentSymbolsEvent): any;
|
|
261
|
+
/**
|
|
262
|
+
* Provide all of the `DocumentSymbol`s for the given file
|
|
263
|
+
* @param event
|
|
264
|
+
*/
|
|
265
|
+
provideDocumentSymbols?(event: ProvideDocumentSymbolsEvent): any;
|
|
266
|
+
/**
|
|
267
|
+
* Called after `provideDocumentSymbols`. Use this if you want to intercept or sanitize the document symbols data provided by bsc or other plugins
|
|
268
|
+
* @param event
|
|
269
|
+
*/
|
|
270
|
+
afterProvideDocumentSymbols?(event: AfterProvideDocumentSymbolsEvent): any;
|
|
271
|
+
/**
|
|
272
|
+
* Called before the `provideWorkspaceSymbols` hook
|
|
273
|
+
*/
|
|
274
|
+
beforeProvideWorkspaceSymbols?(event: BeforeProvideWorkspaceSymbolsEvent): any;
|
|
275
|
+
/**
|
|
276
|
+
* Provide all of the workspace symbols for the entire project
|
|
277
|
+
* @param event
|
|
278
|
+
*/
|
|
279
|
+
provideWorkspaceSymbols?(event: ProvideWorkspaceSymbolsEvent): any;
|
|
280
|
+
/**
|
|
281
|
+
* Called after `provideWorkspaceSymbols`. Use this if you want to intercept or sanitize the workspace symbols data provided by bsc or other plugins
|
|
282
|
+
* @param event
|
|
283
|
+
*/
|
|
284
|
+
afterProvideWorkspaceSymbols?(event: AfterProvideWorkspaceSymbolsEvent): any;
|
|
285
|
+
onScopeValidate?(event: OnScopeValidateEvent): any;
|
|
286
|
+
afterScopeValidate?(event: BeforeScopeValidateEvent): any;
|
|
287
|
+
onGetCodeActions?(event: OnGetCodeActionsEvent): any;
|
|
288
|
+
onGetSemanticTokens?(event: OnGetSemanticTokensEvent): any;
|
|
289
|
+
/**
|
|
290
|
+
* Called before plugins are asked to provide files to the program. (excludes virtual files produced by `provideFile` events).
|
|
291
|
+
* Call the `setFileData()` method to override the file contents.
|
|
292
|
+
*/
|
|
293
|
+
beforeProvideFile?(event: BeforeProvideFileEvent): any;
|
|
294
|
+
/**
|
|
295
|
+
* Give plugins the opportunity to handle processing a file. (excludes virtual files produced by `provideFile` events)
|
|
296
|
+
*/
|
|
297
|
+
provideFile?(event: ProvideFileEvent): any;
|
|
298
|
+
/**
|
|
299
|
+
* Called after a file was added to the program. (excludes virtual files produced by `provideFile` events)
|
|
300
|
+
*/
|
|
301
|
+
afterProvideFile?(event: AfterProvideFileEvent): any;
|
|
302
|
+
/**
|
|
303
|
+
* Called before a file is added to the program.
|
|
304
|
+
* Includes physical files as well as any virtual files produced by `provideFile` events
|
|
305
|
+
*/
|
|
306
|
+
beforeFileAdd?(event: BeforeFileAddEvent): any;
|
|
307
|
+
/**
|
|
308
|
+
* Called after a file has been added to the program.
|
|
309
|
+
* Includes physical files as well as any virtual files produced by `provideFile` events
|
|
310
|
+
*/
|
|
311
|
+
afterFileAdd?(event: AfterFileAddEvent): any;
|
|
312
|
+
/**
|
|
313
|
+
* Called before a file is removed from the program. This includes physical and virtual files
|
|
314
|
+
*/
|
|
315
|
+
beforeFileRemove?(event: BeforeFileRemoveEvent): any;
|
|
316
|
+
/**
|
|
317
|
+
* Called after a file has been removed from the program. This includes physical and virtual files
|
|
318
|
+
*/
|
|
319
|
+
afterFileRemove?(event: AfterFileRemoveEvent): any;
|
|
320
|
+
/**
|
|
321
|
+
* Called before each file is validated
|
|
322
|
+
*/
|
|
323
|
+
beforeFileValidate?(event: BeforeFileValidateEvent): any;
|
|
324
|
+
/**
|
|
325
|
+
* Called during the file validation process. If your plugin contributes file validations, this is a good place to contribute them.
|
|
326
|
+
*/
|
|
327
|
+
onFileValidate?(event: OnFileValidateEvent): any;
|
|
328
|
+
/**
|
|
329
|
+
* Called after each file is validated
|
|
330
|
+
*/
|
|
331
|
+
afterFileValidate?(event: AfterFileValidateEvent): any;
|
|
332
|
+
/**
|
|
333
|
+
* Called right before the program builds (i.e. generates the code and puts it in the stagingDir
|
|
334
|
+
*/
|
|
335
|
+
beforeBuildProgram?(event: BeforeBuildProgramEvent): any;
|
|
336
|
+
/**
|
|
337
|
+
* Called right after the program builds (i.e. generates the code and puts it in the stagingDir
|
|
338
|
+
*/
|
|
339
|
+
afterBuildProgram?(event: AfterBuildProgramEvent): any;
|
|
340
|
+
/**
|
|
341
|
+
* Before preparing the file for building
|
|
342
|
+
*/
|
|
343
|
+
beforePrepareFile?(event: BeforePrepareFileEvent): any;
|
|
344
|
+
/**
|
|
345
|
+
* Prepare the file for building
|
|
346
|
+
*/
|
|
347
|
+
prepareFile?(event: PrepareFileEvent): any;
|
|
348
|
+
/**
|
|
349
|
+
* After preparing the file for building
|
|
350
|
+
*/
|
|
351
|
+
afterPrepareFile?(event: AfterPrepareFileEvent): any;
|
|
352
|
+
/**
|
|
353
|
+
* Before the program turns all file objects into their final buffers
|
|
354
|
+
*/
|
|
355
|
+
beforeSerializeProgram?(event: BeforeSerializeProgramEvent): any;
|
|
356
|
+
/**
|
|
357
|
+
* Emitted right at the start of the program turning all file objects into their final buffers
|
|
358
|
+
*/
|
|
359
|
+
onSerializeProgram?(event: OnSerializeProgramEvent): any;
|
|
360
|
+
/**
|
|
361
|
+
* After the program turns all file objects into their final buffers
|
|
362
|
+
*/
|
|
363
|
+
afterSerializeProgram?(event: AfterSerializeProgramEvent): any;
|
|
364
|
+
/**
|
|
365
|
+
* Before turning the file into its final contents
|
|
366
|
+
*/
|
|
367
|
+
beforeSerializeFile?(event: BeforeSerializeFileEvent): any;
|
|
368
|
+
/**
|
|
369
|
+
* Turn the file into its final contents (i.e. transpile a bs file, compress a jpeg, etc)
|
|
370
|
+
*/
|
|
371
|
+
serializeFile?(event: SerializeFileEvent): any;
|
|
372
|
+
/**
|
|
373
|
+
* After turning the file into its final contents
|
|
374
|
+
*/
|
|
375
|
+
afterSerializeFile?(event: AfterSerializeFileEvent): any;
|
|
376
|
+
/**
|
|
377
|
+
* Called before any files are written
|
|
378
|
+
*/
|
|
379
|
+
beforeWriteProgram?(event: BeforeWriteProgramEvent): any;
|
|
380
|
+
/**
|
|
381
|
+
* Called after all files are written
|
|
382
|
+
*/
|
|
383
|
+
afterWriteProgram?(event: AfterWriteProgramEvent): any;
|
|
384
|
+
/**
|
|
385
|
+
* Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
|
|
386
|
+
*/
|
|
387
|
+
beforeWriteFile?(event: BeforeWriteFileEvent): any;
|
|
388
|
+
/**
|
|
389
|
+
* Called when a file should be persisted (usually writing to storage). These are raw files that contain the final output. One `File` may produce several of these.
|
|
390
|
+
* When a plugin has handled a file, it should be pushed to the `handledFiles` set so future plugins don't write the file multiple times
|
|
391
|
+
*/
|
|
392
|
+
writeFile?(event: WriteFileEvent): any;
|
|
393
|
+
/**
|
|
394
|
+
* Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
|
|
395
|
+
*/
|
|
396
|
+
afterWriteFile?(event: AfterWriteFileEvent): any;
|
|
195
397
|
}
|
|
196
|
-
export interface
|
|
197
|
-
builder: ProgramBuilder;
|
|
398
|
+
export interface OnGetCodeActionsEvent<TFile extends BscFile = BscFile> {
|
|
198
399
|
program: Program;
|
|
199
|
-
|
|
400
|
+
file: TFile;
|
|
401
|
+
range: Range;
|
|
402
|
+
scopes: Scope[];
|
|
403
|
+
diagnostics: BsDiagnostic[];
|
|
404
|
+
codeActions: CodeAction[];
|
|
200
405
|
}
|
|
201
|
-
export interface
|
|
406
|
+
export interface BeforeProgramCreateEvent {
|
|
202
407
|
builder: ProgramBuilder;
|
|
203
|
-
program: Program;
|
|
204
|
-
files: FileObj[];
|
|
205
408
|
}
|
|
206
409
|
export interface AfterProgramCreateEvent {
|
|
207
410
|
builder: ProgramBuilder;
|
|
@@ -210,25 +413,47 @@ export interface AfterProgramCreateEvent {
|
|
|
210
413
|
export interface BeforeProgramValidateEvent {
|
|
211
414
|
program: Program;
|
|
212
415
|
}
|
|
213
|
-
export
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
export interface BeforeProgramTranspileEvent {
|
|
416
|
+
export declare type OnProgramValidateEvent = BeforeProgramValidateEvent;
|
|
417
|
+
export declare type AfterProgramValidateEvent = BeforeProgramValidateEvent;
|
|
418
|
+
export interface ProvideCompletionsEvent<TFile extends BscFile = BscFile> {
|
|
217
419
|
program: Program;
|
|
218
|
-
|
|
420
|
+
file: TFile;
|
|
421
|
+
scopes: Scope[];
|
|
422
|
+
position: Position;
|
|
423
|
+
completions: CompletionItem[];
|
|
219
424
|
}
|
|
220
|
-
export
|
|
425
|
+
export declare type BeforeProvideCompletionsEvent<TFile extends BscFile = BscFile> = ProvideCompletionsEvent<TFile>;
|
|
426
|
+
export declare type AfterProvideCompletionsEvent<TFile extends BscFile = BscFile> = ProvideCompletionsEvent<TFile>;
|
|
427
|
+
export interface BeforeBuildProgramEvent {
|
|
221
428
|
program: Program;
|
|
222
|
-
|
|
429
|
+
files: BscFile[];
|
|
430
|
+
editor: Editor;
|
|
223
431
|
}
|
|
224
|
-
export
|
|
432
|
+
export declare type AfterBuildProgramEvent = BeforeBuildProgramEvent;
|
|
433
|
+
export interface ProvideHoverEvent {
|
|
225
434
|
program: Program;
|
|
226
435
|
file: BscFile;
|
|
227
|
-
|
|
436
|
+
position: Position;
|
|
228
437
|
scopes: Scope[];
|
|
229
|
-
|
|
230
|
-
|
|
438
|
+
hovers: Hover[];
|
|
439
|
+
}
|
|
440
|
+
export interface Hover {
|
|
441
|
+
/**
|
|
442
|
+
* The contents of the hover, written in markdown. If you want to display code in the hover, use code blocks, like this:
|
|
443
|
+
* ```text
|
|
444
|
+
* ```brighterscript
|
|
445
|
+
* some = "code" + "here"
|
|
446
|
+
* ```
|
|
447
|
+
* ```
|
|
448
|
+
*/
|
|
449
|
+
contents: string | string[];
|
|
450
|
+
/**
|
|
451
|
+
* An optional range
|
|
452
|
+
*/
|
|
453
|
+
range?: Range;
|
|
231
454
|
}
|
|
455
|
+
export declare type BeforeProvideHoverEvent = ProvideHoverEvent;
|
|
456
|
+
export declare type AfterProvideHoverEvent = ProvideHoverEvent;
|
|
232
457
|
export interface AfterScopeCreateEvent {
|
|
233
458
|
program: Program;
|
|
234
459
|
scope: Scope;
|
|
@@ -237,30 +462,25 @@ export interface BeforeScopeDisposeEvent {
|
|
|
237
462
|
program: Program;
|
|
238
463
|
scope: Scope;
|
|
239
464
|
}
|
|
240
|
-
export interface
|
|
465
|
+
export interface OnScopeDisposeEvent {
|
|
241
466
|
program: Program;
|
|
242
467
|
scope: Scope;
|
|
243
468
|
}
|
|
244
|
-
export interface
|
|
469
|
+
export interface AfterScopeDisposeEvent {
|
|
245
470
|
program: Program;
|
|
246
471
|
scope: Scope;
|
|
247
472
|
}
|
|
248
|
-
export interface
|
|
473
|
+
export interface BeforeScopeValidateEvent {
|
|
249
474
|
program: Program;
|
|
250
475
|
scope: Scope;
|
|
251
476
|
}
|
|
252
|
-
export
|
|
477
|
+
export declare type AfterScopeValidateEvent = BeforeScopeValidateEvent;
|
|
478
|
+
export interface BeforeFileParseEvent {
|
|
253
479
|
program: Program;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
range: Range;
|
|
257
|
-
/**
|
|
258
|
-
* A filtered list of diagnostics whose lines touch the lines of the given range
|
|
259
|
-
*/
|
|
260
|
-
diagnostics: BsDiagnostic[];
|
|
261
|
-
codeActions: CodeAction[];
|
|
480
|
+
srcPath: string;
|
|
481
|
+
source: string;
|
|
262
482
|
}
|
|
263
|
-
export interface
|
|
483
|
+
export interface OnFileParseEvent {
|
|
264
484
|
program: Program;
|
|
265
485
|
srcPath: string;
|
|
266
486
|
source: string;
|
|
@@ -269,57 +489,435 @@ export interface AfterFileParseEvent {
|
|
|
269
489
|
program: Program;
|
|
270
490
|
file: BscFile;
|
|
271
491
|
}
|
|
272
|
-
export interface
|
|
492
|
+
export interface ProvideDefinitionEvent<TFile = BscFile> {
|
|
273
493
|
program: Program;
|
|
274
|
-
|
|
494
|
+
/**
|
|
495
|
+
* The file that the getDefinition request was invoked in
|
|
496
|
+
*/
|
|
497
|
+
file: TFile;
|
|
498
|
+
/**
|
|
499
|
+
* The position in the text document where the getDefinition request was invoked
|
|
500
|
+
*/
|
|
501
|
+
position: Position;
|
|
502
|
+
/**
|
|
503
|
+
* The list of locations for where the item at the file and position was defined
|
|
504
|
+
*/
|
|
505
|
+
definitions: Location[];
|
|
275
506
|
}
|
|
276
|
-
export
|
|
507
|
+
export declare type BeforeProvideDefinitionEvent<TFile = BscFile> = ProvideDefinitionEvent<TFile>;
|
|
508
|
+
export declare type AfterProvideDefinitionEvent<TFile = BscFile> = ProvideDefinitionEvent<TFile>;
|
|
509
|
+
export interface ProvideReferencesEvent<TFile = BscFile> {
|
|
277
510
|
program: Program;
|
|
278
|
-
|
|
511
|
+
/**
|
|
512
|
+
* The file that the getDefinition request was invoked in
|
|
513
|
+
*/
|
|
514
|
+
file: TFile;
|
|
515
|
+
/**
|
|
516
|
+
* The position in the text document where the getDefinition request was invoked
|
|
517
|
+
*/
|
|
518
|
+
position: Position;
|
|
519
|
+
/**
|
|
520
|
+
* The list of locations for where the item at the file and position was defined
|
|
521
|
+
*/
|
|
522
|
+
references: Location[];
|
|
523
|
+
}
|
|
524
|
+
export declare type BeforeProvideReferencesEvent<TFile = BscFile> = ProvideReferencesEvent<TFile>;
|
|
525
|
+
export declare type AfterProvideReferencesEvent<TFile = BscFile> = ProvideReferencesEvent<TFile>;
|
|
526
|
+
export interface ProvideDocumentSymbolsEvent<TFile = BscFile> {
|
|
527
|
+
program: Program;
|
|
528
|
+
/**
|
|
529
|
+
* The file that the `documentSymbol` request was invoked in
|
|
530
|
+
*/
|
|
531
|
+
file: TFile;
|
|
532
|
+
/**
|
|
533
|
+
* The result list of symbols
|
|
534
|
+
*/
|
|
535
|
+
documentSymbols: DocumentSymbol[];
|
|
536
|
+
}
|
|
537
|
+
export declare type BeforeProvideDocumentSymbolsEvent<TFile = BscFile> = ProvideDocumentSymbolsEvent<TFile>;
|
|
538
|
+
export declare type AfterProvideDocumentSymbolsEvent<TFile = BscFile> = ProvideDocumentSymbolsEvent<TFile>;
|
|
539
|
+
export interface ProvideWorkspaceSymbolsEvent {
|
|
540
|
+
program: Program;
|
|
541
|
+
/**
|
|
542
|
+
* The result list of symbols
|
|
543
|
+
*/
|
|
544
|
+
workspaceSymbols: WorkspaceSymbol[];
|
|
545
|
+
}
|
|
546
|
+
export declare type BeforeProvideWorkspaceSymbolsEvent = ProvideWorkspaceSymbolsEvent;
|
|
547
|
+
export declare type AfterProvideWorkspaceSymbolsEvent = ProvideWorkspaceSymbolsEvent;
|
|
548
|
+
export interface OnGetSemanticTokensEvent<T extends BscFile = BscFile> {
|
|
549
|
+
/**
|
|
550
|
+
* The program this file is from
|
|
551
|
+
*/
|
|
552
|
+
program: Program;
|
|
553
|
+
/**
|
|
554
|
+
* The file to get semantic tokens for
|
|
555
|
+
*/
|
|
556
|
+
file: T;
|
|
557
|
+
/**
|
|
558
|
+
* The list of scopes that this file is a member of
|
|
559
|
+
*/
|
|
560
|
+
scopes: Scope[];
|
|
561
|
+
/**
|
|
562
|
+
* The list of semantic tokens being produced during this event.
|
|
563
|
+
*/
|
|
564
|
+
semanticTokens: SemanticToken[];
|
|
565
|
+
}
|
|
566
|
+
export declare type BeforeFileValidateEvent = OnFileValidateEvent;
|
|
567
|
+
export interface OnFileValidateEvent<T extends BscFile = BscFile> {
|
|
568
|
+
program: Program;
|
|
569
|
+
file: T;
|
|
279
570
|
}
|
|
280
|
-
export
|
|
571
|
+
export declare type AfterFileValidateEvent<T extends BscFile = BscFile> = OnFileValidateEvent;
|
|
572
|
+
export interface OnFileValidateEvent<T extends BscFile = BscFile> {
|
|
281
573
|
program: Program;
|
|
574
|
+
file: T;
|
|
575
|
+
}
|
|
576
|
+
export interface TranspileEntry {
|
|
282
577
|
file: BscFile;
|
|
283
578
|
outputPath: string;
|
|
284
579
|
}
|
|
285
|
-
export interface
|
|
580
|
+
export interface ScopeValidationOptions {
|
|
581
|
+
filesToBeValidatedInScopeContext?: Set<BscFile>;
|
|
582
|
+
changedSymbols?: Map<SymbolTypeFlag, Set<string>>;
|
|
583
|
+
changedFiles?: Set<BscFile>;
|
|
584
|
+
force?: boolean;
|
|
585
|
+
initialValidation?: boolean;
|
|
586
|
+
}
|
|
587
|
+
export interface OnScopeValidateEvent {
|
|
286
588
|
program: Program;
|
|
287
|
-
|
|
589
|
+
scope: Scope;
|
|
590
|
+
changedFiles?: BscFile[];
|
|
591
|
+
changedSymbols?: Map<SymbolTypeFlag, Set<string>>;
|
|
592
|
+
}
|
|
593
|
+
export interface AfterFileTranspileEvent<TFile extends BscFile = BscFile> {
|
|
594
|
+
/**
|
|
595
|
+
* The program this event was triggered for
|
|
596
|
+
*/
|
|
597
|
+
program: Program;
|
|
598
|
+
file: TFile;
|
|
288
599
|
outputPath: string;
|
|
600
|
+
/**
|
|
601
|
+
* The resulting transpiled file contents
|
|
602
|
+
*/
|
|
603
|
+
code: string;
|
|
604
|
+
/**
|
|
605
|
+
* The sourceMaps for the generated code (if emitting source maps is enabled)
|
|
606
|
+
*/
|
|
607
|
+
map?: string;
|
|
608
|
+
/**
|
|
609
|
+
* The generated type definition file contents (if emitting type definitions are enabled)
|
|
610
|
+
*/
|
|
611
|
+
typedef?: string;
|
|
289
612
|
}
|
|
290
|
-
export
|
|
613
|
+
export declare type BeforeProvideFileEvent<TFile extends BscFile = BscFile> = ProvideFileEvent<TFile>;
|
|
614
|
+
export interface ProvideFileEvent<TFile extends BscFile = BscFile> {
|
|
615
|
+
/**
|
|
616
|
+
* The lower-case file extension for the srcPath. (i.e. ".brs", ".xml")
|
|
617
|
+
*/
|
|
618
|
+
srcExtension: string;
|
|
619
|
+
/**
|
|
620
|
+
* The srcPath for the file. (i.e. `/user/bob/projects/VideoApp/source/main.bs`)
|
|
621
|
+
*/
|
|
622
|
+
srcPath: string;
|
|
623
|
+
/**
|
|
624
|
+
* The destPath for the file. (i.e. for `/user/bob/projects/VideoApp/source/main.bs`, destPath would be `source/main.bs`)
|
|
625
|
+
*/
|
|
626
|
+
destPath: string;
|
|
627
|
+
/**
|
|
628
|
+
* A lazy-loading container for this file's data. Call `.get()` to lazy load the data, and `.set()` to override file contents
|
|
629
|
+
*/
|
|
630
|
+
data: LazyFileData;
|
|
631
|
+
/**
|
|
632
|
+
* An array of files that should be added to the program as a result of this event
|
|
633
|
+
*/
|
|
634
|
+
files: TFile[];
|
|
635
|
+
/**
|
|
636
|
+
* The program for this event
|
|
637
|
+
*/
|
|
291
638
|
program: Program;
|
|
292
|
-
|
|
639
|
+
/**
|
|
640
|
+
* A factory used to create new instances of the BrighterScript built-in file types. This mitigates the issue
|
|
641
|
+
* of a plugin's version of a File not being the same as the LanguageServer or CLI version of BrighterScript
|
|
642
|
+
* (due to npm installing multiple versions of brighterscript)
|
|
643
|
+
*/
|
|
644
|
+
fileFactory: FileFactory;
|
|
293
645
|
}
|
|
294
|
-
export
|
|
646
|
+
export declare type AfterProvideFileEvent<TFile extends BscFile = BscFile> = ProvideFileEvent<TFile>;
|
|
647
|
+
export interface BeforeFileAddEvent<TFile extends BscFile = BscFile> {
|
|
648
|
+
file: TFile;
|
|
295
649
|
program: Program;
|
|
296
|
-
file: BscFile;
|
|
297
650
|
}
|
|
298
|
-
export
|
|
651
|
+
export declare type AfterFileAddEvent<TFile extends BscFile = BscFile> = BeforeFileAddEvent<TFile>;
|
|
652
|
+
export interface BeforeFileRemoveEvent<TFile extends BscFile = BscFile> {
|
|
653
|
+
file: TFile;
|
|
299
654
|
program: Program;
|
|
300
|
-
|
|
301
|
-
|
|
655
|
+
}
|
|
656
|
+
export declare type AfterFileRemoveEvent<TFile extends BscFile = BscFile> = BeforeFileRemoveEvent<TFile>;
|
|
657
|
+
export declare type BeforePrepareProgramEvent = PrepareProgramEvent;
|
|
658
|
+
/**
|
|
659
|
+
* Event for when the program prepares itself for building
|
|
660
|
+
*/
|
|
661
|
+
export interface PrepareProgramEvent {
|
|
662
|
+
program: Program;
|
|
663
|
+
editor: Editor;
|
|
664
|
+
}
|
|
665
|
+
export declare type AfterPrepareProgramEvent = PrepareProgramEvent;
|
|
666
|
+
export declare type BeforePrepareFileEvent<TFile extends BscFile = BscFile> = PrepareFileEvent<TFile>;
|
|
667
|
+
/**
|
|
668
|
+
* Prepare the file for building
|
|
669
|
+
*/
|
|
670
|
+
export interface PrepareFileEvent<TFile extends BscFile = BscFile> {
|
|
671
|
+
program: Program;
|
|
672
|
+
file: TFile;
|
|
673
|
+
editor: Editor;
|
|
674
|
+
}
|
|
675
|
+
export declare type OnPrepareFileEvent<TFile extends BscFile = BscFile> = PrepareFileEvent<TFile>;
|
|
676
|
+
export declare type AfterPrepareFileEvent<TFile extends BscFile = BscFile> = PrepareFileEvent<TFile>;
|
|
677
|
+
/**
|
|
678
|
+
* A container that holds the code, map, and typedef for serialized code files.
|
|
679
|
+
*/
|
|
680
|
+
export interface SerializedCodeFile {
|
|
681
|
+
code?: string;
|
|
682
|
+
map?: string;
|
|
683
|
+
typedef?: string;
|
|
684
|
+
}
|
|
685
|
+
export interface BeforeSerializeProgramEvent {
|
|
686
|
+
program: Program;
|
|
687
|
+
files: BscFile[];
|
|
688
|
+
result: Map<BscFile, SerializedFile[]>;
|
|
689
|
+
}
|
|
690
|
+
export declare type OnSerializeProgramEvent = BeforeSerializeProgramEvent;
|
|
691
|
+
export declare type AfterSerializeProgramEvent = BeforeSerializeProgramEvent;
|
|
692
|
+
/**
|
|
693
|
+
* During the `SerializeFile` events, this is how plugins will contribute file data for a specific file
|
|
694
|
+
*/
|
|
695
|
+
export interface SerializedFile {
|
|
302
696
|
/**
|
|
303
|
-
*
|
|
697
|
+
* The raw data for this file (i.e. a binary buffer for a .jpeg file, or the transpiled code for a .bs file)
|
|
304
698
|
*/
|
|
305
|
-
|
|
306
|
-
|
|
699
|
+
data: Buffer;
|
|
700
|
+
/**
|
|
701
|
+
* The pkgPath for this chunk of data.
|
|
702
|
+
*/
|
|
703
|
+
pkgPath: string;
|
|
307
704
|
}
|
|
308
|
-
export
|
|
705
|
+
export declare type BeforeSerializeFileEvent<TFile extends BscFile = BscFile> = SerializeFileEvent<TFile>;
|
|
706
|
+
export interface SerializeFileEvent<TFile extends BscFile = BscFile> {
|
|
707
|
+
program: Program;
|
|
708
|
+
file: TFile;
|
|
709
|
+
/**
|
|
710
|
+
* The list of all files created across all the `SerializeFile` events.
|
|
711
|
+
* The key is the pkgPath of the file, and the
|
|
712
|
+
*/
|
|
713
|
+
result: Map<TFile, SerializedFile[]>;
|
|
714
|
+
}
|
|
715
|
+
export declare type AfterSerializeFileEvent<TFile extends BscFile = BscFile> = SerializeFileEvent<TFile>;
|
|
716
|
+
export interface BeforeWriteProgramEvent {
|
|
717
|
+
program: Program;
|
|
718
|
+
stagingDir: string;
|
|
719
|
+
files: Map<BscFile, SerializedFile[]>;
|
|
720
|
+
}
|
|
721
|
+
export declare type AfterWriteProgramEvent = BeforeWriteProgramEvent;
|
|
722
|
+
export declare type BeforeWriteFileEvent = WriteFileEvent;
|
|
723
|
+
export interface WriteFileEvent {
|
|
724
|
+
program: Program;
|
|
725
|
+
file: SerializedFile;
|
|
726
|
+
/**
|
|
727
|
+
* The full path to where the file was (or will be) written to.
|
|
728
|
+
*/
|
|
729
|
+
outputPath: string;
|
|
730
|
+
/**
|
|
731
|
+
* A set of all files that have been properly written. Plugins should add any handled files to this list so future plugins don't write then again
|
|
732
|
+
*/
|
|
733
|
+
processedFiles: Set<SerializedFile>;
|
|
734
|
+
}
|
|
735
|
+
export declare type AfterWriteFileEvent = BeforeWriteFileEvent;
|
|
736
|
+
export interface TranspileObj {
|
|
309
737
|
file: BscFile;
|
|
738
|
+
/**
|
|
739
|
+
* The absolute path to where the file should be written during build. (i.e. somewhere inside the stagingDir)
|
|
740
|
+
*/
|
|
310
741
|
outputPath: string;
|
|
311
742
|
}
|
|
743
|
+
export interface BeforeFileDisposeEvent {
|
|
744
|
+
program: Program;
|
|
745
|
+
file: BscFile;
|
|
746
|
+
}
|
|
747
|
+
export declare type AfterFileDisposeEvent = BeforeFileDisposeEvent;
|
|
748
|
+
export interface BeforeProgramDisposeEvent {
|
|
749
|
+
program: Program;
|
|
750
|
+
}
|
|
751
|
+
export interface SemanticToken {
|
|
752
|
+
range: Range;
|
|
753
|
+
tokenType: SemanticTokenTypes;
|
|
754
|
+
/**
|
|
755
|
+
* An optional array of modifiers for this token
|
|
756
|
+
*/
|
|
757
|
+
tokenModifiers?: SemanticTokenModifiers[];
|
|
758
|
+
}
|
|
312
759
|
export interface TypedefProvider {
|
|
313
|
-
getTypedef(state: TranspileState):
|
|
760
|
+
getTypedef(state: TranspileState): TranspileResult;
|
|
314
761
|
}
|
|
315
|
-
export declare type TranspileResult = Array<(string | SourceNode)>;
|
|
762
|
+
export declare type TranspileResult = Array<(string | SourceNode | TranspileResult)>;
|
|
316
763
|
/**
|
|
317
|
-
*
|
|
764
|
+
* This is the type that the SourceNode class is declared as taking in its constructor.
|
|
765
|
+
* The actual type that SourceNode accepts is the more permissive TranspileResult, but
|
|
766
|
+
* we need to use this declared type for some type casts.
|
|
318
767
|
*/
|
|
319
|
-
export declare type
|
|
768
|
+
export declare type FlattenedTranspileResult = Array<string | SourceNode>;
|
|
769
|
+
export declare type FileResolver = (srcPath: string) => string | Buffer | undefined | Thenable<string | Buffer | undefined> | void;
|
|
320
770
|
export interface ExpressionInfo {
|
|
321
771
|
expressions: Expression[];
|
|
322
772
|
varExpressions: Expression[];
|
|
323
773
|
uniqueVarNames: string[];
|
|
324
774
|
}
|
|
325
775
|
export declare type DiagnosticCode = number | string;
|
|
776
|
+
export interface FileLink<T> {
|
|
777
|
+
item: T;
|
|
778
|
+
file: BrsFile;
|
|
779
|
+
}
|
|
780
|
+
export interface ExtraSymbolData {
|
|
781
|
+
/**
|
|
782
|
+
* What AST node defined this symbol?
|
|
783
|
+
*/
|
|
784
|
+
definingNode?: AstNode;
|
|
785
|
+
/**
|
|
786
|
+
* Description of this symbol
|
|
787
|
+
*/
|
|
788
|
+
description?: string;
|
|
789
|
+
/**
|
|
790
|
+
* the higher the number, the lower the priority
|
|
791
|
+
*/
|
|
792
|
+
completionPriority?: number;
|
|
793
|
+
/**
|
|
794
|
+
* Flags for this symbol
|
|
795
|
+
*/
|
|
796
|
+
flags?: SymbolTypeFlag;
|
|
797
|
+
/**
|
|
798
|
+
* this symbol comes from an ancestor symbol table
|
|
799
|
+
*/
|
|
800
|
+
memberOfAncestor?: boolean;
|
|
801
|
+
/**
|
|
802
|
+
* Do not merge this symbol when merging symbol tables
|
|
803
|
+
*/
|
|
804
|
+
doNotMerge?: boolean;
|
|
805
|
+
/**
|
|
806
|
+
* is this symbol an alias?
|
|
807
|
+
*/
|
|
808
|
+
isAlias?: boolean;
|
|
809
|
+
/**
|
|
810
|
+
* Is this symbol an instance of the type.
|
|
811
|
+
*
|
|
812
|
+
* `true` means `true`, and `false` or `undefined` means `false`,
|
|
813
|
+
*
|
|
814
|
+
* so check for `=== true` or `!== true`
|
|
815
|
+
*/
|
|
816
|
+
isInstance?: boolean;
|
|
817
|
+
}
|
|
818
|
+
export interface GetTypeOptions {
|
|
819
|
+
flags: SymbolTypeFlag;
|
|
820
|
+
typeChain?: TypeChainEntry[];
|
|
821
|
+
data?: ExtraSymbolData;
|
|
822
|
+
ignoreCall?: boolean;
|
|
823
|
+
onlyCacheResolvedTypes?: boolean;
|
|
824
|
+
ignoreCacheForRetrieval?: boolean;
|
|
825
|
+
isExistenceTest?: boolean;
|
|
826
|
+
}
|
|
827
|
+
export declare class TypeChainEntry {
|
|
828
|
+
constructor(options: {
|
|
829
|
+
name: string;
|
|
830
|
+
type: BscType;
|
|
831
|
+
data: ExtraSymbolData;
|
|
832
|
+
range?: Range;
|
|
833
|
+
separatorToken?: Token;
|
|
834
|
+
astNode: AstNode;
|
|
835
|
+
});
|
|
836
|
+
get range(): Range;
|
|
837
|
+
readonly name: string;
|
|
838
|
+
readonly type: BscType;
|
|
839
|
+
readonly data: ExtraSymbolData;
|
|
840
|
+
private readonly _range;
|
|
841
|
+
readonly separatorToken: Token;
|
|
842
|
+
isResolved: boolean;
|
|
843
|
+
astNode: AstNode;
|
|
844
|
+
}
|
|
845
|
+
export interface TypeChainProcessResult {
|
|
846
|
+
/**
|
|
847
|
+
* The name of the last item in the chain, OR the first unresolved item in the chain
|
|
848
|
+
*/
|
|
849
|
+
itemName: string;
|
|
850
|
+
/**
|
|
851
|
+
* The TypeKind of the item of `itemName`
|
|
852
|
+
*/
|
|
853
|
+
itemTypeKind: BscTypeKind | string;
|
|
854
|
+
/**
|
|
855
|
+
* The name of the parent of the item of `itemName`
|
|
856
|
+
*/
|
|
857
|
+
itemParentTypeName: string;
|
|
858
|
+
/**
|
|
859
|
+
* The TypeKind of the parent of the item of `itemName`
|
|
860
|
+
*/
|
|
861
|
+
itemParentTypeKind: BscTypeKind | string;
|
|
862
|
+
/**
|
|
863
|
+
* The complete chain leading up to the item of `itemName`
|
|
864
|
+
*/
|
|
865
|
+
fullNameOfItem: string;
|
|
866
|
+
/**
|
|
867
|
+
* The complete chain (even including unresolved items)
|
|
868
|
+
*/
|
|
869
|
+
fullChainName: string;
|
|
870
|
+
/**
|
|
871
|
+
* the range of the first unresolved item
|
|
872
|
+
*/
|
|
873
|
+
range: Range;
|
|
874
|
+
/**
|
|
875
|
+
* Does the chain contain a dynamic type?
|
|
876
|
+
*/
|
|
877
|
+
containsDynamic: boolean;
|
|
878
|
+
/**
|
|
879
|
+
* The AstNode of the item
|
|
880
|
+
*/
|
|
881
|
+
astNode: AstNode;
|
|
882
|
+
}
|
|
883
|
+
export interface TypeCompatibilityData {
|
|
884
|
+
missingFields?: {
|
|
885
|
+
name: string;
|
|
886
|
+
expectedType: BscType;
|
|
887
|
+
}[];
|
|
888
|
+
fieldMismatches?: {
|
|
889
|
+
name: string;
|
|
890
|
+
expectedType: BscType;
|
|
891
|
+
actualType: BscType;
|
|
892
|
+
}[];
|
|
893
|
+
depth?: number;
|
|
894
|
+
}
|
|
895
|
+
export interface NamespaceContainer {
|
|
896
|
+
file: BscFile;
|
|
897
|
+
fullName: string;
|
|
898
|
+
fullNameLower: string;
|
|
899
|
+
parentNameLower: string;
|
|
900
|
+
nameParts: Identifier[];
|
|
901
|
+
nameRange: Range;
|
|
902
|
+
lastPartName: string;
|
|
903
|
+
lastPartNameLower: string;
|
|
904
|
+
functionStatements: Map<string, FunctionStatement>;
|
|
905
|
+
isTopLevel: boolean;
|
|
906
|
+
namespaceStatements?: NamespaceStatement[];
|
|
907
|
+
statements?: Statement[];
|
|
908
|
+
classStatements?: Map<string, ClassStatement>;
|
|
909
|
+
enumStatements?: Map<string, EnumStatement>;
|
|
910
|
+
constStatements?: Map<string, ConstStatement>;
|
|
911
|
+
namespaces?: Map<string, NamespaceContainer>;
|
|
912
|
+
symbolTable: SymbolTable;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Use Writable<T> to remove readonly flag from properties in T
|
|
916
|
+
* Be careful!
|
|
917
|
+
*/
|
|
918
|
+
export declare type Writeable<T> = {
|
|
919
|
+
-readonly [P in keyof T]: T[P];
|
|
920
|
+
};
|
|
921
|
+
export declare type DeepWriteable<T> = {
|
|
922
|
+
-readonly [P in keyof T]: DeepWriteable<T[P]>;
|
|
923
|
+
};
|