brighterscript 1.0.0-alpha.5 → 1.0.0-alpha.50
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/README.md +76 -138
- package/bsconfig.schema.json +121 -5
- 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 +45 -0
- package/dist/AstValidationSegmenter.js +322 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +72 -39
- package/dist/BusyStatusTracker.d.ts +61 -0
- package/dist/BusyStatusTracker.js +148 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.d.ts +3 -8
- package/dist/Cache.js +9 -14
- 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 +12 -4
- package/dist/CodeActionUtil.js +22 -5
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +7 -6
- package/dist/CommentFlagProcessor.js +11 -8
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/CrossScopeValidator.d.ts +68 -0
- package/dist/CrossScopeValidator.js +642 -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 +21 -5
- package/dist/DiagnosticCollection.js +77 -24
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +27 -6
- package/dist/DiagnosticFilterer.js +273 -60
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticManager.d.ts +82 -0
- package/dist/DiagnosticManager.js +406 -0
- package/dist/DiagnosticManager.js.map +1 -0
- package/dist/DiagnosticMessages.d.ts +558 -196
- package/dist/DiagnosticMessages.js +870 -340
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.d.ts +7 -0
- package/dist/DiagnosticSeverityAdjuster.js +45 -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 +100 -105
- package/dist/LanguageServer.js +444 -745
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +17 -13
- package/dist/Logger.js +64 -34
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +32 -10
- package/dist/PluginInterface.js +117 -7
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +241 -98
- package/dist/Program.js +1432 -717
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +47 -23
- package/dist/ProgramBuilder.js +224 -178
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +149 -109
- package/dist/Scope.js +557 -550
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.js +5 -1
- package/dist/SemanticTokenUtils.js.map +1 -1
- 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 +136 -24
- package/dist/SymbolTable.js +565 -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 +34 -90
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/CachedLookups.d.ts +50 -0
- package/dist/astUtils/CachedLookups.js +334 -0
- package/dist/astUtils/CachedLookups.js.map +1 -0
- package/dist/astUtils/CachedLookups.spec.js +39 -0
- package/dist/astUtils/CachedLookups.spec.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 +54 -19
- package/dist/astUtils/creators.js +242 -42
- 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 +196 -85
- package/dist/astUtils/reflection.js +497 -144
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +267 -167
- 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 +116 -53
- package/dist/astUtils/visitors.js +95 -15
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +629 -51
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +9 -8
- package/dist/astUtils/xml.js +12 -7
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +24 -4
- package/dist/bscPlugin/BscPlugin.js +88 -4
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +36 -0
- package/dist/bscPlugin/CallExpressionInfo.js +143 -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 +6 -5
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +173 -27
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +138 -21
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +65 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js +633 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +2512 -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 +212 -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/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 +230 -0
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +991 -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 +57 -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 +164 -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 +564 -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 +33 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +12 -0
- package/dist/bscPlugin/serialize/BslibManager.js +46 -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 +75 -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 +141 -0
- package/dist/bscPlugin/symbols/symbolUtils.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +27 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +418 -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 +75 -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 +37 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +638 -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 +1517 -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 +141 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +1323 -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 +6135 -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 +36 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -0
- package/dist/cli.js +126 -27
- package/dist/cli.js.map +1 -1
- package/dist/common/Sequencer.d.ts +53 -0
- package/dist/common/Sequencer.js +233 -0
- package/dist/common/Sequencer.js.map +1 -0
- package/dist/common/Sequencer.spec.d.ts +1 -0
- package/dist/common/Sequencer.spec.js +75 -0
- package/dist/common/Sequencer.spec.js.map +1 -0
- package/dist/deferred.d.ts +5 -3
- package/dist/deferred.js +10 -0
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +10 -3
- package/dist/diagnosticUtils.js +64 -25
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.d.ts +2 -2
- 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 +1213 -259
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +145 -87
- package/dist/files/BrsFile.js +836 -934
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +4226 -902
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/BscFile.d.ts +102 -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 +21 -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 +80 -41
- package/dist/files/XmlFile.js +161 -137
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +444 -336
- 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 +424 -184
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +32 -4
- package/dist/index.js +54 -7
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +942 -125
- 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 +51 -12
- package/dist/lexer/Lexer.js +215 -65
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +812 -568
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +27 -11
- package/dist/lexer/Token.js +10 -2
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +40 -2
- package/dist/lexer/TokenKind.js +147 -10
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/logging.d.ts +14 -0
- package/dist/logging.js +29 -0
- package/dist/logging.js.map +1 -0
- package/dist/lsp/ActionQueue.d.ts +35 -0
- package/dist/lsp/ActionQueue.js +115 -0
- package/dist/lsp/ActionQueue.js.map +1 -0
- package/dist/lsp/ActionQueue.spec.d.ts +1 -0
- package/dist/lsp/ActionQueue.spec.js +80 -0
- package/dist/lsp/ActionQueue.spec.js.map +1 -0
- package/dist/lsp/DocumentManager.d.ts +63 -0
- package/dist/lsp/DocumentManager.js +122 -0
- package/dist/lsp/DocumentManager.js.map +1 -0
- package/dist/lsp/DocumentManager.spec.d.ts +1 -0
- package/dist/lsp/DocumentManager.spec.js +103 -0
- package/dist/lsp/DocumentManager.spec.js.map +1 -0
- package/dist/lsp/LspProject.d.ts +239 -0
- package/dist/lsp/LspProject.js +3 -0
- package/dist/lsp/LspProject.js.map +1 -0
- package/dist/lsp/PathFilterer.d.ts +75 -0
- package/dist/lsp/PathFilterer.js +196 -0
- package/dist/lsp/PathFilterer.js.map +1 -0
- package/dist/lsp/PathFilterer.spec.d.ts +1 -0
- package/dist/lsp/PathFilterer.spec.js +182 -0
- package/dist/lsp/PathFilterer.spec.js.map +1 -0
- package/dist/lsp/Project.d.ts +168 -0
- package/dist/lsp/Project.js +437 -0
- package/dist/lsp/Project.js.map +1 -0
- package/dist/lsp/Project.spec.d.ts +1 -0
- package/dist/lsp/Project.spec.js +267 -0
- package/dist/lsp/Project.spec.js.map +1 -0
- package/dist/lsp/ProjectManager.d.ts +242 -0
- package/dist/lsp/ProjectManager.js +824 -0
- package/dist/lsp/ProjectManager.js.map +1 -0
- package/dist/lsp/ProjectManager.spec.d.ts +1 -0
- package/dist/lsp/ProjectManager.spec.js +913 -0
- package/dist/lsp/ProjectManager.spec.js.map +1 -0
- package/dist/lsp/ReaderWriterManager.d.ts +21 -0
- package/dist/lsp/ReaderWriterManager.js +60 -0
- package/dist/lsp/ReaderWriterManager.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.d.ts +99 -0
- package/dist/lsp/worker/MessageHandler.js +138 -0
- package/dist/lsp/worker/MessageHandler.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.spec.d.ts +1 -0
- package/dist/lsp/worker/MessageHandler.spec.js +64 -0
- package/dist/lsp/worker/MessageHandler.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.d.ts +38 -0
- package/dist/lsp/worker/WorkerPool.js +78 -0
- package/dist/lsp/worker/WorkerPool.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.spec.d.ts +1 -0
- package/dist/lsp/worker/WorkerPool.spec.js +59 -0
- package/dist/lsp/worker/WorkerPool.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.d.ts +143 -0
- package/dist/lsp/worker/WorkerThreadProject.js +189 -0
- package/dist/lsp/worker/WorkerThreadProject.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.d.ts +2 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js +71 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.d.ts +15 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js +58 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js.map +1 -0
- package/dist/lsp/worker/run.d.ts +1 -0
- package/dist/lsp/worker/run.js +14 -0
- package/dist/lsp/worker/run.js.map +1 -0
- package/dist/parser/AstNode.d.ts +203 -0
- package/dist/parser/AstNode.js +303 -0
- package/dist/parser/AstNode.js.map +1 -0
- package/dist/parser/AstNode.spec.d.ts +1 -0
- package/dist/parser/AstNode.spec.js +1455 -0
- package/dist/parser/AstNode.spec.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.d.ts +56 -0
- package/dist/parser/BrightScriptDocParser.js +294 -0
- package/dist/parser/BrightScriptDocParser.js.map +1 -0
- package/dist/parser/BrightScriptDocParser.spec.d.ts +1 -0
- package/dist/parser/BrightScriptDocParser.spec.js +310 -0
- package/dist/parser/BrightScriptDocParser.spec.js.map +1 -0
- package/dist/parser/BrsTranspileState.d.ts +22 -3
- package/dist/parser/BrsTranspileState.js +19 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +553 -221
- package/dist/parser/Expression.js +1414 -505
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Expression.spec.d.ts +1 -0
- package/dist/parser/Expression.spec.js +40 -0
- package/dist/parser/Expression.spec.js.map +1 -0
- package/dist/parser/Parser.Class.spec.js +255 -125
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +117 -124
- package/dist/parser/Parser.js +1669 -982
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.d.ts +3 -1
- package/dist/parser/Parser.spec.js +2111 -525
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +29 -13
- package/dist/parser/SGParser.js +85 -56
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +30 -45
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +134 -46
- package/dist/parser/SGTypes.js +206 -115
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/Statement.d.ts +849 -267
- package/dist/parser/Statement.js +2412 -625
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +133 -36
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +26 -12
- package/dist/parser/TranspileState.js +115 -24
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +3 -9
- package/dist/parser/tests/Parser.spec.js +7 -13
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +83 -75
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +85 -51
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +382 -239
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +52 -45
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +51 -43
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +192 -142
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +236 -160
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +41 -34
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +173 -55
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +20 -20
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +291 -282
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +193 -110
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +42 -42
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +260 -115
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +58 -52
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +76 -60
- 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 +50 -50
- 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 +281 -94
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +747 -192
- 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 +44 -44
- 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 +500 -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 +61 -55
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +29 -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 +744 -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 +226 -215
- 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 +64 -61
- 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 +22 -22
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +127 -168
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +133 -114
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +57 -54
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +131 -117
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +14 -13
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +11 -8
- 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 +20347 -0
- package/dist/roku-types/index.d.ts +5726 -0
- package/dist/roku-types/index.js +11 -0
- package/dist/roku-types/index.js.map +1 -0
- package/dist/types/ArrayType.d.ts +12 -5
- package/dist/types/ArrayType.js +89 -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 +15 -0
- package/dist/types/AssociativeArrayType.js +64 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +10 -0
- package/dist/types/BaseFunctionType.js +26 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +9 -5
- package/dist/types/BooleanType.js +19 -8
- 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 +41 -3
- package/dist/types/BscType.js +152 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +28 -0
- package/dist/types/BscTypeKind.js +33 -0
- package/dist/types/BscTypeKind.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.d.ts +28 -0
- package/dist/types/BuiltInInterfaceAdder.js +212 -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/CallFuncableType.d.ts +24 -0
- package/dist/types/CallFuncableType.js +91 -0
- package/dist/types/CallFuncableType.js.map +1 -0
- package/dist/types/ClassType.d.ts +17 -0
- package/dist/types/ClassType.js +60 -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 +22 -0
- package/dist/types/ComponentType.js +107 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +10 -5
- package/dist/types/DoubleType.js +21 -17
- 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 +13 -5
- package/dist/types/DynamicType.js +26 -5
- 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 +42 -0
- package/dist/types/EnumType.js +98 -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 +21 -17
- 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 +8 -22
- package/dist/types/FunctionType.js +25 -63
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +29 -0
- package/dist/types/InheritableType.js +173 -0
- package/dist/types/InheritableType.js.map +1 -0
- package/dist/types/InlineInterfaceType.d.ts +5 -0
- package/dist/types/InlineInterfaceType.js +17 -0
- package/dist/types/InlineInterfaceType.js.map +1 -0
- package/dist/types/IntegerType.d.ts +10 -5
- package/dist/types/IntegerType.js +21 -17
- 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 +30 -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/IntersectionType.d.ts +29 -0
- package/dist/types/IntersectionType.js +253 -0
- package/dist/types/IntersectionType.js.map +1 -0
- package/dist/types/IntersectionType.spec.d.ts +1 -0
- package/dist/types/IntersectionType.spec.js +150 -0
- package/dist/types/IntersectionType.spec.js.map +1 -0
- package/dist/types/InvalidType.d.ts +10 -5
- package/dist/types/InvalidType.js +21 -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 +21 -17
- 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 +12 -5
- package/dist/types/ObjectType.js +25 -8
- 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 +123 -0
- package/dist/types/ReferenceType.js +720 -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 +12 -5
- package/dist/types/StringType.js +23 -8
- 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/TypeStatementType.d.ts +18 -0
- package/dist/types/TypeStatementType.js +45 -0
- package/dist/types/TypeStatementType.js.map +1 -0
- package/dist/types/TypedFunctionType.d.ts +34 -0
- package/dist/types/TypedFunctionType.js +147 -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 +11 -6
- package/dist/types/UninitializedType.js +20 -11
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +27 -0
- package/dist/types/UnionType.js +193 -0
- package/dist/types/UnionType.js.map +1 -0
- package/dist/types/UnionType.spec.d.ts +1 -0
- package/dist/types/UnionType.spec.js +205 -0
- package/dist/types/UnionType.spec.js.map +1 -0
- package/dist/types/VoidType.d.ts +11 -5
- package/dist/types/VoidType.js +22 -8
- 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 +174 -0
- package/dist/types/helper.spec.js.map +1 -0
- package/dist/types/helpers.d.ts +51 -0
- package/dist/types/helpers.js +323 -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/types/roFunctionType.d.ts +11 -0
- package/dist/types/roFunctionType.js +37 -0
- package/dist/types/roFunctionType.js.map +1 -0
- package/dist/types/roFunctionType.spec.d.ts +1 -0
- package/dist/types/roFunctionType.spec.js +20 -0
- package/dist/types/roFunctionType.spec.js.map +1 -0
- package/dist/util.d.ts +288 -187
- package/dist/util.js +2018 -575
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +9 -15
- package/dist/validators/ClassValidator.js +93 -138
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +185 -138
- package/CHANGELOG.md +0 -1188
- 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/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +0 -7
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +0 -63
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +0 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +0 -45
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.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/SGTypes.spec.js +0 -351
- package/dist/parser/SGTypes.spec.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/{bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts → astUtils/CachedLookups.spec.d.ts} +0 -0
- /package/dist/{parser/SGTypes.spec.d.ts → astUtils/Editor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/Preprocessor.spec.d.ts → bscPlugin/completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{preprocessor/PreprocessorParser.spec.d.ts → bscPlugin/definition/DefinitionProvider.spec.d.ts} +0 -0
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/hover/HoverProcessor.spec.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
# BrighterScript
|
|
1
|
+
# BrighterScript
|
|
2
2
|
|
|
3
3
|
A superset of Roku's BrightScript language. Compiles to standard BrightScript.
|
|
4
4
|
|
|
5
|
-
[](https://github.com/rokucommunity/brighterscript/actions?query=branch%3Amaster+workflow%3Abuild)
|
|
6
|
+
[](https://coveralls.io/github/rokucommunity/brighterscript?branch=master)
|
|
7
|
+
[](https://npmcharts.com/compare/brighterscript?minimal=true)
|
|
8
|
+
[](https://www.npmjs.com/package/brighterscript)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA)
|
|
8
11
|
|
|
9
|
-
This is the v1 branch. Unless you're specifically looking for v1, you probably want to view [the master branch](https://github.com/rokucommunity/brighterscript).
|
|
10
12
|
## Overview
|
|
11
13
|
|
|
14
|
+
**WARNING: this is the `v1` branch with experimental features**
|
|
15
|
+
|
|
12
16
|
The BrighterScript language provides new features and syntax enhancements to Roku's BrightScript language. Because the language is a superset of BrightScript, the parser and associated tools (VSCode integration, cli, etc...) work with standard BrightScript (.brs) files. This means you will get benefits (as described in the following section) from using the BrighterScript compiler, whether your project contains BrighterScript (.bs) files or not. The BrighterScript language transpiles to standard BrightScript, so your code is fully compatible with all roku devices.
|
|
13
17
|
|
|
18
|
+
## Help!
|
|
19
|
+
|
|
20
|
+
> [!IMPORTANT]
|
|
21
|
+
> We are currently seeking testers for two major rewrites:
|
|
22
|
+
|
|
23
|
+
- Language Server Protocol (LSP) Rewrite: We’ve been hard at work revamping our LSP to improve stability, performance, and add new features. We would love your feedback as you put it through its paces. ([Join the LSP discussion](https://github.com/rokucommunity/brighterscript/discussions/1322))
|
|
24
|
+
|
|
25
|
+
- Version 1 (v1) Rewrite: This is a complete overhaul of the core of our project. Your input is crucial in helping us identify bugs and further refine the release. ([Join the v1 discussion](https://github.com/rokucommunity/brighterscript/discussions/1321))
|
|
26
|
+
|
|
27
|
+
If you're interested in helping, please visit the GitHub discussion links above for more information and instructions on how to get involved.
|
|
28
|
+
|
|
14
29
|
## Features
|
|
15
|
-
BrighterScript adds several new features to the BrightScript language such as
|
|
30
|
+
BrighterScript adds several new features to the BrightScript language such as namespaces, classes, import statements, and more. Take a look at the language specification docs for more information.
|
|
16
31
|
|
|
17
32
|
[BrighterScript Language Specification](https://github.com/rokucommunity/BrighterScript/blob/master/docs/readme.md)
|
|
18
33
|
|
|
@@ -56,15 +71,44 @@ BrighterScript adds several new features to the BrightScript language such as Na
|
|
|
56
71
|
|
|
57
72
|
- Full BrighterScript support for syntax checking, validation, and intellisense is available within the [Brightscript Language](https://marketplace.visualstudio.com/items?itemName=celsoaf.brightscript) VSCode extension.
|
|
58
73
|
|
|
74
|
+
- Configure the language server behavior using [language server settings](https://github.com/rokucommunity/brighterscript/blob/master/docs/language-server.md).
|
|
75
|
+
|
|
59
76
|
- And if it's not enough, the [plugin API](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md) allows extending the compiler to provide extra diagnostics or transformations.
|
|
60
77
|
|
|
61
78
|
## Who uses Brighterscript?
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
<br/>
|
|
80
|
+
<p align="center">
|
|
81
|
+
<a href="https://www.fubo.tv/">
|
|
82
|
+
<img height="38" src="https://user-images.githubusercontent.com/2544493/192530108-eb470b85-e687-4575-af69-254aab13428c.png">
|
|
83
|
+
</a>
|
|
84
|
+
<a href="mailto:chris@inverted-solutions.com">
|
|
85
|
+
<img height="38" src="https://user-images.githubusercontent.com/2544493/197794500-2bac4903-ed00-463a-b243-24c68fba7962.png">
|
|
86
|
+
</a>
|
|
87
|
+
<a href="https://www.applicaster.com/">
|
|
88
|
+
<img height="38" src="https://user-images.githubusercontent.com/2544493/192591901-20441fc8-3c6c-45ea-8851-b22430e6fb8e.png">
|
|
89
|
+
</a>
|
|
90
|
+
<a href="https://www.redspace.com/">
|
|
91
|
+
<img height="38" src="https://user-images.githubusercontent.com/2544493/195908446-8d9652f8-9877-426f-b3c6-09119d788fd8.png">
|
|
92
|
+
</a>
|
|
93
|
+
<br/><br/>
|
|
94
|
+
<a href="https://tantawowa.com/">
|
|
95
|
+
<img height="38" src="https://user-images.githubusercontent.com/2544493/197795138-2ec870db-71fe-49e3-a014-692a3f31e6aa.png">
|
|
96
|
+
</a>
|
|
97
|
+
<a href="https://www.miraclechannel.ca/corcoplus">
|
|
98
|
+
<img height="38" src="https://user-images.githubusercontent.com/2544493/192593254-f2a32cd4-0482-40de-830d-c1d09690c46b.png">
|
|
99
|
+
</a>
|
|
100
|
+
<a href="https://digitalpictureframe.tv">
|
|
101
|
+
<img height="38" src="https://s3.us-east-1.wasabisys.com/tv.digitalpictureframe.assets/logo-wide.png">
|
|
102
|
+
</a>
|
|
103
|
+
<a href="https://www.haystack.tv/">
|
|
104
|
+
<img height="38" src="https://user-images.githubusercontent.com/2544493/192610056-d1b5a382-edf4-47b9-a6a5-d2d3ee9094cb.png">
|
|
105
|
+
</a>
|
|
106
|
+
</p>
|
|
107
|
+
<br/>
|
|
108
|
+
|
|
109
|
+
The BrighterScript project is used to power the popular [Brightscript Language](https://marketplace.visualstudio.com/items?itemName=rokucommunity.brightscript) VSCode extension, the [maestro framework](https://github.com/georgejecook/maestro-roku), and more.
|
|
110
|
+
|
|
111
|
+
[Contact us](https://github.com/rokucommunity/brighterscript/issues/new) if you use BrighterScript in your project and would like your logo listed above. More projects are adopting BrighterScript all the time, from using the new BrighterScript language features to simply using the compiler in their build pipeline.
|
|
68
112
|
|
|
69
113
|
## What's with the name?
|
|
70
114
|
The name BrighterScript is a compliment to everything that is great about Roku's awesome BrightScript language. Naming things is hard, and discoverability and recognizability are both very important. Here are the reasons we chose this name:
|
|
@@ -108,7 +152,7 @@ If you need to configure `bsc`, you can do so in two ways:
|
|
|
108
152
|
1. Your project resides in a subdirectory of your workspace folder.
|
|
109
153
|
|
|
110
154
|
```bash
|
|
111
|
-
bsc --
|
|
155
|
+
bsc --rootDir ./rokuSourceFiles
|
|
112
156
|
```
|
|
113
157
|
2. Run the compiler in watch mode
|
|
114
158
|
|
|
@@ -116,16 +160,12 @@ If you need to configure `bsc`, you can do so in two ways:
|
|
|
116
160
|
bsc --watch
|
|
117
161
|
```
|
|
118
162
|
|
|
119
|
-
3.
|
|
120
|
-
```bash
|
|
121
|
-
bsc --watch --deploy --host 192.168.1.10 --password secret_password
|
|
122
|
-
```
|
|
123
|
-
4. Use a bsconfig.json file not located at cwd
|
|
163
|
+
3. Use a bsconfig.json file not located at cwd
|
|
124
164
|
```bash
|
|
125
165
|
bsc --project ./some_folder/bsconfig.json
|
|
126
166
|
```
|
|
127
167
|
|
|
128
|
-
|
|
168
|
+
4. Run the compiler as a **linter** only (watch mode supported)
|
|
129
169
|
```bash
|
|
130
170
|
bsc --create-package false --copy-to-staging false
|
|
131
171
|
```
|
|
@@ -133,128 +173,26 @@ If you need to configure `bsc`, you can do so in two ways:
|
|
|
133
173
|
## bsconfig.json
|
|
134
174
|
|
|
135
175
|
### Overview
|
|
136
|
-
The presence of a `bsconfig.json` file in a directory indicates that the directory is the root of a BrightScript project. The `bsconfig.json` file specifies the root files and the compiler options required to compile the project.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
### Optional `extends` and `project`
|
|
151
|
-
There are situations where you want to store some compiler settings in a config file, but not fail if that config file doesn't exist. To do this, you can denote that your `extends` or `project` path is optional by prefixing it with a question mark (`?`). For example:
|
|
152
|
-
|
|
153
|
-
- **bsconfig.json** `extends`
|
|
154
|
-
```json
|
|
155
|
-
{
|
|
156
|
-
"extends": "?path/to/optional/bsconfig.json"
|
|
157
|
-
}
|
|
158
|
-
```
|
|
159
|
-
- CLI "extends"
|
|
160
|
-
```
|
|
161
|
-
bsc --extends "?path/to/optional/bsconfig.json"
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
- CLI `project` argument
|
|
165
|
-
```
|
|
166
|
-
bsc --project "?path/to/optional/bsconfig.json"
|
|
167
|
-
```
|
|
168
|
-
- Node.js API `extends`
|
|
169
|
-
```
|
|
170
|
-
var programBuilder = new ProgramBuilder({
|
|
171
|
-
"extends": "?path/to/optional/bsconfig.json"
|
|
172
|
-
});
|
|
173
|
-
```
|
|
174
|
-
- Node.js API `project`
|
|
175
|
-
```
|
|
176
|
-
var programBuilder = new ProgramBuilder({
|
|
177
|
-
"project": "?path/to/optional/bsconfig.json"
|
|
178
|
-
});
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### bsconfig.json options
|
|
182
|
-
|
|
183
|
-
These are the options available in the `bsconfig.json` file.
|
|
184
|
-
|
|
185
|
-
- **project**: `string` - A path to a project file. This is really only passed in from the command line or the NodeJS API, and should not be present in `bsconfig.json` files. Prefix with a question mark (?) to prevent throwing an exception when the file does not exist.
|
|
186
|
-
|
|
187
|
-
- **extends**: `string` - Relative or absolute path to another `bsconfig.json` file that this `bsconfig.json` file should import and then override. Prefix with a question mark (?) to prevent throwing an exception when the file does not exist.
|
|
188
|
-
|
|
189
|
-
- **cwd**: `string` - Override the current working directory
|
|
190
|
-
|
|
191
|
-
- **rootDir**: `string` - The root directory of your roku project. Defaults to current directory
|
|
192
|
-
|
|
193
|
-
- **files**: ` (string | string[] | { src: string | string[]; dest?: string })[]` - The list file globs used to find all files for the project. If using the {src;dest;} format, you can specify a different destination directory for the matched files in src.
|
|
194
|
-
|
|
195
|
-
- **outFile**: `string` - The path (including filename) where the output file should be placed (defaults to `"./out/[WORKSPACE_FOLDER_NAME].zip"`).
|
|
196
|
-
|
|
197
|
-
- **createPackage**: `boolean` - Creates a zip package. Defaults to true. This setting is ignored when `deploy` is enabled.
|
|
198
|
-
|
|
199
|
-
- **watch**: `boolean` - If true, the server will keep running and will watch and recompile on every file change.
|
|
200
|
-
|
|
201
|
-
- **deploy**: `boolean` - If true, after a successful build, the project will be deployed to the Roku specified in host.
|
|
202
|
-
|
|
203
|
-
- **host**: `string` - The host of the Roku that this project will deploy to.
|
|
204
|
-
|
|
205
|
-
- **username**: `string` - the username to use when deploying to a Roku device.
|
|
206
|
-
|
|
207
|
-
- **password**: `string` - The password to use when deploying to a roku device.
|
|
208
|
-
|
|
209
|
-
- **emitFullPaths**: `boolean` - Emit full paths to files when printing diagnostics to the console. Defaults to false
|
|
210
|
-
|
|
211
|
-
- **diagnosticFilters**: `Array<string | number | {src: string; codes: number[]}` - A list of filters used to hide diagnostics.
|
|
212
|
-
- A `string` value should be a relative-to-root-dir or absolute file path or glob pattern of the files that should be excluded. Any file matching this pattern will have all diagnostics supressed.
|
|
213
|
-
- A `number` value should be a diagnostic code. This will supress all diagnostics with that code for the whole project.
|
|
214
|
-
- An object can also be provided to filter specific diagnostic codes for a file pattern. For example,
|
|
215
|
-
```jsonc
|
|
216
|
-
"diagnosticFilters": [{
|
|
217
|
-
"src": "vendor/**/*",
|
|
218
|
-
"codes": [1000, 1011] //ignore these specific codes from vendor libraries
|
|
219
|
-
}]
|
|
220
|
-
```
|
|
221
|
-
- **diagnosticLevel**: `'hint' | 'info' | 'warn' | 'error'` - Specify what diagnostic levels are printed to the console. This has no effect on what diagnostics are reported in the LanguageServer. Defaults to 'warn'
|
|
222
|
-
|
|
223
|
-
- **autoImportComponentScript**: `bool` - BrighterScript only: will automatically import a script at transpile-time for a component with the same name if it exists.
|
|
224
|
-
|
|
225
|
-
- **sourceRoot**: `string` - Override the root directory path where debugger should locate the source files. The location will be embedded in the source map to help debuggers locate the original source files. This only applies to files found within rootDir. This is useful when you want to preprocess files before passing them to BrighterScript, and want a debugger to open the original files. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.
|
|
226
|
-
|
|
227
|
-
- **plugins**: `Array<string>` - List of node scripts or npm modules to load as plugins to the BrighterScript compiler.
|
|
228
|
-
|
|
229
|
-
## Ignore errors and warnings on a per-line basis
|
|
230
|
-
In addition to disabling an entire class of errors in `bsconfig.json` by using `ignoreErrorCodes`, you may also disable errors for a subset of the complier rules within a file with the following comment flags:
|
|
231
|
-
- `bs:disable-next-line`
|
|
232
|
-
- `bs:disable-next-line: code1 code2 code3`
|
|
233
|
-
- `bs:disable-line`
|
|
234
|
-
- `bs:disable-line: code1 code2 code3`
|
|
235
|
-
|
|
236
|
-
Here are some examples:
|
|
237
|
-
|
|
238
|
-
```BrightScript
|
|
239
|
-
sub Main()
|
|
240
|
-
'disable errors about invalid syntax here
|
|
241
|
-
'bs:disable-next-line
|
|
242
|
-
DoSomething(
|
|
243
|
-
|
|
244
|
-
DoSomething( 'bs:disable-line
|
|
245
|
-
|
|
246
|
-
'disable errors about wrong parameter count
|
|
247
|
-
DoSomething(1,2,3) 'bs:disable-next-line
|
|
248
|
-
|
|
249
|
-
DoSomething(1,2,3) 'bs:disable-next-line:1002
|
|
250
|
-
end sub
|
|
251
|
-
|
|
252
|
-
sub DoSomething()
|
|
253
|
-
end sub
|
|
176
|
+
The presence of a `bsconfig.json` file in a directory indicates that the directory is the root of a BrightScript project. The `bsconfig.json` file specifies the root files and the compiler options required to compile the project. Here is a minimal example, which is recommended for new projects:
|
|
177
|
+
|
|
178
|
+
```jsonc
|
|
179
|
+
{
|
|
180
|
+
"rootDir": "src",
|
|
181
|
+
"files": [
|
|
182
|
+
"**/*"
|
|
183
|
+
],
|
|
184
|
+
"outDir": "out",
|
|
185
|
+
//this flag tells BrighterScript that for every xml file, try to import a .bs file with the same name and location
|
|
186
|
+
"autoImportComponentScript": true,
|
|
187
|
+
"sourceMap": true
|
|
188
|
+
}
|
|
254
189
|
```
|
|
255
190
|
|
|
256
|
-
|
|
191
|
+
More information on the config file format may be found in the [bsconfig.json documentation](https://github.com/rokucommunity/BrighterScript/blob/master/docs/bsconfig.md).
|
|
192
|
+
|
|
193
|
+
## Suppressing compiler messages
|
|
257
194
|
|
|
195
|
+
The BrighterScript compiler emits errors and warnings when it encounters potentially invalid code. Errors and warnings may also be emitted by compiler plugins, such as by [the BrighterScript linter](https://github.com/rokucommunity/bslint). These messages can be suppressed if needed; see [the documentation](https://github.com/rokucommunity/BrighterScript/blob/master/docs/suppressing-compiler-messages.md).
|
|
258
196
|
|
|
259
197
|
## ropm support
|
|
260
198
|
In order for BrighterScript-transpiled projects to work as ropm modules, they need a reference to [bslib](https://github.com/rokucommunity/bslib/blob/master/source/bslib.brs) (the BrightScript runtime library for BrighterScript features) in their package. As `ropm` and `brighterscript` become more popular, this could result in many duplicate copies of `bslib.brs`.
|
package/bsconfig.schema.json
CHANGED
|
@@ -21,6 +21,24 @@
|
|
|
21
21
|
"description": "The root directory of your Roku project. Defaults to the current working directory (or cwd property)",
|
|
22
22
|
"type": "string"
|
|
23
23
|
},
|
|
24
|
+
"manifest": {
|
|
25
|
+
"description": "A entry to modify manifest values",
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"bs_const": {
|
|
29
|
+
"description": "A dictionary of bs_consts to change or add to the manifest. Each entry ",
|
|
30
|
+
"type": "object",
|
|
31
|
+
"patternProperties": {
|
|
32
|
+
"^.+$": {
|
|
33
|
+
"type": [
|
|
34
|
+
"boolean",
|
|
35
|
+
"null"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
24
42
|
"files": {
|
|
25
43
|
"description": "The list of files that should be used in this project. Supports globs. Optionally, you can specify an object with `src` and `dest` properties to move files from one location into a different destination location",
|
|
26
44
|
"default": [
|
|
@@ -29,6 +47,7 @@
|
|
|
29
47
|
"components/**/*.*",
|
|
30
48
|
"images/**/*.*"
|
|
31
49
|
],
|
|
50
|
+
"type": "array",
|
|
32
51
|
"items": {
|
|
33
52
|
"anyOf": [
|
|
34
53
|
{
|
|
@@ -69,11 +88,15 @@
|
|
|
69
88
|
},
|
|
70
89
|
"outFile": {
|
|
71
90
|
"description": "The path where the output zip or package should be placed. This includes the filename. Defaults to \"./out/package\"",
|
|
91
|
+
"deprecated": true,
|
|
92
|
+
"deprecationMessage": "Deprecated in v1",
|
|
72
93
|
"type": "string"
|
|
73
94
|
},
|
|
74
95
|
"createPackage": {
|
|
75
96
|
"description": "Creates a zip package. Defaults to true. This setting is ignored when deploy is enabled.",
|
|
76
|
-
"type": "boolean"
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"deprecated": true,
|
|
99
|
+
"deprecationMessage": "Deprecated starting in v1"
|
|
77
100
|
},
|
|
78
101
|
"sourceMap": {
|
|
79
102
|
"description": "Enables generating sourcemap files, which allow debugging tools to show the original source code while running the emitted files.",
|
|
@@ -82,6 +105,12 @@
|
|
|
82
105
|
},
|
|
83
106
|
"copyToStaging": {
|
|
84
107
|
"description": "If true, the files are copied to staging. This setting is ignored when deploy is enabled or if createPackage is enabled",
|
|
108
|
+
"deprecated": true,
|
|
109
|
+
"deprecationMessage": "Deprecated starting in v1. Use `noEmit` instead.",
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"noEmit": {
|
|
113
|
+
"description": "If true, then no files are copied to outDir.",
|
|
85
114
|
"type": "boolean"
|
|
86
115
|
},
|
|
87
116
|
"watch": {
|
|
@@ -91,27 +120,56 @@
|
|
|
91
120
|
},
|
|
92
121
|
"deploy": {
|
|
93
122
|
"description": "If true, after a successful buld, the project will be deployed to the roku specified in host",
|
|
123
|
+
"deprecated": true,
|
|
124
|
+
"deprecationMessage": "Deprecated starting in v1. No longer supporting deployment in this tool.",
|
|
94
125
|
"type": "boolean"
|
|
95
126
|
},
|
|
96
127
|
"host": {
|
|
97
|
-
"description": "
|
|
128
|
+
"description": "host of the Roku that the package will be deploy to",
|
|
129
|
+
"deprecated": true,
|
|
130
|
+
"deprecationMessage": "Deprecated starting in v1. No longer supporting deployment in this tool.",
|
|
98
131
|
"type": "string"
|
|
99
132
|
},
|
|
100
133
|
"username": {
|
|
101
134
|
"description": "The username to use when deploying to a Roku device",
|
|
135
|
+
"deprecated": true,
|
|
136
|
+
"deprecationMessage": "Deprecated starting in v1. No longer supporting deployment in this tool.",
|
|
102
137
|
"type": "string"
|
|
103
138
|
},
|
|
104
139
|
"password": {
|
|
105
|
-
"description": "
|
|
140
|
+
"description": "The password to use when deploying to a Roku device",
|
|
141
|
+
"deprecated": true,
|
|
142
|
+
"deprecationMessage": "Deprecated starting in v1. No longer supporting deployment in this tool.",
|
|
106
143
|
"type": "string"
|
|
107
144
|
},
|
|
145
|
+
"retainStagingDir": {
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"description": "Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
|
|
148
|
+
"deprecated": true,
|
|
149
|
+
"deprecationMessage": "Deprecated starting in v1. No longer supporting package zipping in this tool.",
|
|
150
|
+
"default": false
|
|
151
|
+
},
|
|
108
152
|
"retainStagingFolder": {
|
|
109
153
|
"type": "boolean",
|
|
110
154
|
"description": "Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
|
|
155
|
+
"deprecated": true,
|
|
156
|
+
"deprecationMessage": "Deprecated starting in v1. No longer supporting package zipping in this tool.",
|
|
111
157
|
"default": false
|
|
112
158
|
},
|
|
159
|
+
"stagingDir": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"deprecated": true,
|
|
162
|
+
"deprecationMessage": "Deprecated starting in v1. Use `outDir` instead.",
|
|
163
|
+
"description": "The path to the staging folder (where all files are copied before creating the zip package)"
|
|
164
|
+
},
|
|
165
|
+
"outDir": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"description": "TODO better description: The path to the output directory (where all files are copied before creating the zip package)"
|
|
168
|
+
},
|
|
113
169
|
"stagingFolderPath": {
|
|
114
170
|
"type": "string",
|
|
171
|
+
"deprecated": true,
|
|
172
|
+
"deprecationMessage": "Deprecated starting in v1. Use `outDir` instead.",
|
|
115
173
|
"description": "The path to the staging folder (where all files are copied before creating the zip package)"
|
|
116
174
|
},
|
|
117
175
|
"ignoreErrorCodes": {
|
|
@@ -128,6 +186,24 @@
|
|
|
128
186
|
]
|
|
129
187
|
}
|
|
130
188
|
},
|
|
189
|
+
"diagnosticSeverityOverrides": {
|
|
190
|
+
"description": "A map of error codes with their severity level override (error|warn|info)",
|
|
191
|
+
"type": "object",
|
|
192
|
+
"patternProperties": {
|
|
193
|
+
".{1,}": {
|
|
194
|
+
"type": [
|
|
195
|
+
"number",
|
|
196
|
+
"string"
|
|
197
|
+
],
|
|
198
|
+
"enum": [
|
|
199
|
+
"error",
|
|
200
|
+
"warn",
|
|
201
|
+
"info",
|
|
202
|
+
"hint"
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
131
207
|
"emitFullPaths": {
|
|
132
208
|
"description": "Emit full paths to files when printing diagnostics to the console.",
|
|
133
209
|
"type": "boolean",
|
|
@@ -138,6 +214,11 @@
|
|
|
138
214
|
"type": "boolean",
|
|
139
215
|
"default": false
|
|
140
216
|
},
|
|
217
|
+
"removeParameterTypes": {
|
|
218
|
+
"description": "Removes the explicit type to function's parameters and return (i.e. the `as type` syntax) ",
|
|
219
|
+
"type": "boolean",
|
|
220
|
+
"default": false
|
|
221
|
+
},
|
|
141
222
|
"diagnosticFilters": {
|
|
142
223
|
"description": "A collection of filters used to hide diagnostics for certain files",
|
|
143
224
|
"type": "array",
|
|
@@ -165,7 +246,10 @@
|
|
|
165
246
|
"items": {
|
|
166
247
|
"anyOf": [
|
|
167
248
|
{
|
|
168
|
-
"type": [
|
|
249
|
+
"type": [
|
|
250
|
+
"number",
|
|
251
|
+
"string"
|
|
252
|
+
],
|
|
169
253
|
"description": "A code of diagnostics that should be filtered out from the files matched in 'src'"
|
|
170
254
|
}
|
|
171
255
|
]
|
|
@@ -176,6 +260,11 @@
|
|
|
176
260
|
]
|
|
177
261
|
}
|
|
178
262
|
},
|
|
263
|
+
"diagnosticFiltersV0Compatibility": {
|
|
264
|
+
"description": "Use the deprecated diagnosticFilters format from v0. This is useful for backwards compatibility.",
|
|
265
|
+
"type": "boolean",
|
|
266
|
+
"default": false
|
|
267
|
+
},
|
|
179
268
|
"plugins": {
|
|
180
269
|
"description": "A list of node scripts or npm modules to add extra diagnostics or transform the AST.",
|
|
181
270
|
"type": "array",
|
|
@@ -188,6 +277,18 @@
|
|
|
188
277
|
]
|
|
189
278
|
}
|
|
190
279
|
},
|
|
280
|
+
"require": {
|
|
281
|
+
"description": "A list of scripts or modules to pass to node's `require()` on startup. This is useful for doing things like ts-node registration",
|
|
282
|
+
"type": "array",
|
|
283
|
+
"items": {
|
|
284
|
+
"anyOf": [
|
|
285
|
+
{
|
|
286
|
+
"type": "string",
|
|
287
|
+
"description": "a path to a node script or an npm module to load dynamically at startup."
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
},
|
|
191
292
|
"autoImportComponentScript": {
|
|
192
293
|
"description": "When enabled, every xml component will search for a .bs or .brs file with the same name in the same folder, and add it as a script import if found. Disabled by default",
|
|
193
294
|
"type": "boolean",
|
|
@@ -210,6 +311,11 @@
|
|
|
210
311
|
"description": "Override the root directory path where debugger should locate the source files. The location will be embedded in the source map to help debuggers locate the original source files. This only applies to files found within rootDir. This is useful when you want to preprocess files before passing them to BrighterScript, and want a debugger to open the original files. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.",
|
|
211
312
|
"type": "string"
|
|
212
313
|
},
|
|
314
|
+
"resolveSourceRoot": {
|
|
315
|
+
"description": "Should the `sourceRoot` property be resolve to an absolute path (relative to the bsconfig it's defined in)",
|
|
316
|
+
"type": "boolean",
|
|
317
|
+
"default": false
|
|
318
|
+
},
|
|
213
319
|
"diagnosticLevel": {
|
|
214
320
|
"description": "Specify what diagnostic levels are printed to the console. This has no effect on what diagnostics are reported in the LanguageServer. Defaults to 'warn'",
|
|
215
321
|
"type": "string",
|
|
@@ -220,6 +326,16 @@
|
|
|
220
326
|
"warn",
|
|
221
327
|
"error"
|
|
222
328
|
]
|
|
329
|
+
},
|
|
330
|
+
"allowBrighterScriptInBrightScript": {
|
|
331
|
+
"description": "Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.",
|
|
332
|
+
"type": "boolean",
|
|
333
|
+
"default": false
|
|
334
|
+
},
|
|
335
|
+
"legacyCallfuncHandling": {
|
|
336
|
+
"description": "Legacy RokuOS versions required at least one argument in callfunc() invocations. Previous brighterscript versions handled this by inserting invalid as an argument when no other args are present. This is not necessary in modern RokuOS versions.",
|
|
337
|
+
"type": "boolean",
|
|
338
|
+
"default": false
|
|
223
339
|
}
|
|
224
340
|
}
|
|
225
|
-
}
|
|
341
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enforces that a single action can be running at a time
|
|
3
|
+
*/
|
|
4
|
+
export declare class ActionPipeline {
|
|
5
|
+
private workQueue;
|
|
6
|
+
run<T extends Action<any>, R extends Awaited<PromiseLike<ReturnType<T>>>>(action: T): Promise<R>;
|
|
7
|
+
private process;
|
|
8
|
+
private isProcessing;
|
|
9
|
+
}
|
|
10
|
+
export declare type Action<T> = () => T | PromiseLike<T>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionPipeline = void 0;
|
|
4
|
+
const deferred_1 = require("./deferred");
|
|
5
|
+
/**
|
|
6
|
+
* Enforces that a single action can be running at a time
|
|
7
|
+
*/
|
|
8
|
+
class ActionPipeline {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.workQueue = [];
|
|
11
|
+
this.isProcessing = false;
|
|
12
|
+
}
|
|
13
|
+
run(action) {
|
|
14
|
+
const work = {
|
|
15
|
+
action: action,
|
|
16
|
+
deferred: new deferred_1.Deferred()
|
|
17
|
+
};
|
|
18
|
+
this.workQueue.push(work);
|
|
19
|
+
this.process();
|
|
20
|
+
return work.deferred.promise;
|
|
21
|
+
}
|
|
22
|
+
process() {
|
|
23
|
+
//if we're already processing,
|
|
24
|
+
if (this.isProcessing) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
while (this.workQueue.length > 0) {
|
|
28
|
+
const work = this.workQueue.shift();
|
|
29
|
+
try {
|
|
30
|
+
const result = Promise.resolve(work.action());
|
|
31
|
+
work.deferred.resolve(result);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
work.deferred.reject(e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ActionPipeline = ActionPipeline;
|
|
40
|
+
//# sourceMappingURL=ActionPipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionPipeline.js","sourceRoot":"","sources":["../src/ActionPipeline.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC;;GAEG;AACH,MAAa,cAAc;IAA3B;QACY,cAAS,GAAqB,EAAE,CAAC;QA6BjC,iBAAY,GAAG,KAAK,CAAC;IACjC,CAAC;IA5BU,GAAG,CAAuE,MAAS;QACtF,MAAM,IAAI,GAAG;YACT,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,IAAI,mBAAQ,EAAO;SAChC,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IACjC,CAAC;IAEO,OAAO;QACX,8BAA8B;QAC9B,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,OAAO;SACV;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YACpC,IAAI;gBACA,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAC1B,IAAI,CAAC,MAAM,EAAE,CAChB,CAAC;gBACF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aACjC;YAAC,OAAO,CAAC,EAAE;gBACR,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aAC3B;SACJ;IACL,CAAC;CAEJ;AA/BD,wCA+BC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DottedGetExpression, TypeExpression, VariableExpression } from './parser/Expression';
|
|
2
|
+
import type { TypeChainEntry } from './interfaces';
|
|
3
|
+
import type { AstNode } from './parser/AstNode';
|
|
4
|
+
import { SymbolTypeFlag } from './SymbolTypeFlag';
|
|
5
|
+
import type { Token } from './lexer/Token';
|
|
6
|
+
import type { BrsFile } from './files/BrsFile';
|
|
7
|
+
export declare const InsideSegmentWalkMode: number;
|
|
8
|
+
export interface UnresolvedSymbol {
|
|
9
|
+
typeChain: TypeChainEntry[];
|
|
10
|
+
flags: SymbolTypeFlag;
|
|
11
|
+
endChainFlags: SymbolTypeFlag;
|
|
12
|
+
containingNamespaces: string[];
|
|
13
|
+
file: BrsFile;
|
|
14
|
+
lookups: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface AssignedSymbol {
|
|
17
|
+
token: Token;
|
|
18
|
+
node: AstNode;
|
|
19
|
+
}
|
|
20
|
+
export declare class AstValidationSegmenter {
|
|
21
|
+
file: BrsFile;
|
|
22
|
+
validatedSegments: Map<AstNode, boolean>;
|
|
23
|
+
segmentsForValidation: AstNode[];
|
|
24
|
+
singleValidationSegments: Set<AstNode>;
|
|
25
|
+
unresolvedSegmentsSymbols: Map<AstNode, Set<UnresolvedSymbol>>;
|
|
26
|
+
assignedTokensInSegment: Map<AstNode, Set<AssignedSymbol>>;
|
|
27
|
+
ast: AstNode;
|
|
28
|
+
constructor(file: BrsFile);
|
|
29
|
+
reset(): void;
|
|
30
|
+
processTree(ast: AstNode): void;
|
|
31
|
+
checkExpressionForUnresolved(segment: AstNode, expression: VariableExpression | DottedGetExpression | TypeExpression, assignedSymbolsNames?: Set<string>): any;
|
|
32
|
+
private addUnresolvedSymbol;
|
|
33
|
+
private currentNamespaceStatement;
|
|
34
|
+
private currentClassStatement;
|
|
35
|
+
private unresolvedTypeCastTypeExpressions;
|
|
36
|
+
checkSegmentWalk(segment: AstNode): void;
|
|
37
|
+
private handleTypeCastTypeExpression;
|
|
38
|
+
getAllUnvalidatedSegments(): AstNode[];
|
|
39
|
+
getSegmentsWithChangedSymbols(changedSymbols: Map<SymbolTypeFlag, Set<string>>): AstNode[];
|
|
40
|
+
markSegmentAsValidated(segment: AstNode): void;
|
|
41
|
+
unValidateAllSegments(): void;
|
|
42
|
+
hasUnvalidatedSegments(): boolean;
|
|
43
|
+
checkIfSegmentNeedsRevalidation(segment: AstNode, changedSymbols: Map<SymbolTypeFlag, Set<string>>): boolean;
|
|
44
|
+
markSegmentsInvalidatedBySymbol(symbolName: string, flag: SymbolTypeFlag): void;
|
|
45
|
+
}
|