brighterscript 0.66.0-alpha.0 → 0.66.0-alpha.10
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 +223 -10
- package/README.md +13 -3
- package/bsconfig.schema.json +15 -0
- package/dist/ActionPipeline.d.ts +10 -0
- package/dist/ActionPipeline.js +40 -0
- package/dist/ActionPipeline.js.map +1 -0
- package/dist/AstValidationSegmenter.d.ts +25 -0
- package/dist/AstValidationSegmenter.js +150 -0
- package/dist/AstValidationSegmenter.js.map +1 -0
- package/dist/BsConfig.d.ts +13 -4
- package/dist/BusyStatusTracker.d.ts +31 -0
- package/dist/BusyStatusTracker.js +83 -0
- package/dist/BusyStatusTracker.js.map +1 -0
- package/dist/Cache.js +3 -3
- package/dist/Cache.js.map +1 -1
- package/dist/CacheVerifier.d.ts +0 -1
- package/dist/CodeActionUtil.d.ts +2 -2
- package/dist/CommentFlagProcessor.d.ts +4 -3
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DiagnosticCollection.js +8 -5
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +34 -4
- package/dist/DiagnosticMessages.js +59 -4
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/FunctionScope.d.ts +1 -1
- package/dist/LanguageServer.d.ts +23 -1
- package/dist/LanguageServer.js +139 -57
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +3 -2
- package/dist/Logger.js +10 -2
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +11 -2
- package/dist/PluginInterface.js +69 -10
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +138 -49
- package/dist/Program.js +656 -340
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +10 -4
- package/dist/ProgramBuilder.js +83 -66
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +52 -49
- package/dist/Scope.js +312 -247
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +35 -14
- package/dist/SymbolTable.js +89 -26
- package/dist/SymbolTable.js.map +1 -1
- package/dist/Throttler.d.ts +12 -0
- package/dist/Throttler.js +39 -0
- package/dist/Throttler.js.map +1 -1
- package/dist/XmlScope.d.ts +7 -4
- package/dist/XmlScope.js +52 -12
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/{AstEditor.d.ts → Editor.d.ts} +6 -1
- package/dist/astUtils/{AstEditor.js → Editor.js} +9 -3
- package/dist/astUtils/Editor.js.map +1 -0
- package/dist/astUtils/{AstEditor.spec.js → Editor.spec.js} +10 -6
- package/dist/astUtils/Editor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +3 -1
- package/dist/astUtils/creators.js +14 -4
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +37 -9
- package/dist/astUtils/reflection.js +83 -14
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +87 -5
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +14 -3
- package/dist/astUtils/visitors.js +22 -2
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +58 -7
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +11 -4
- package/dist/bscPlugin/BscPlugin.js +26 -6
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.d.ts +3 -3
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -1
- package/dist/bscPlugin/FileWriter.d.ts +6 -0
- package/dist/bscPlugin/FileWriter.js +24 -0
- package/dist/bscPlugin/FileWriter.js.map +1 -0
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +8 -8
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +4 -4
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +50 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +442 -23
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +1737 -0
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/fileProviders/FileProvider.d.ts +9 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js +51 -0
- package/dist/bscPlugin/fileProviders/FileProvider.js.map +1 -0
- package/dist/bscPlugin/hover/HoverProcessor.d.ts +7 -3
- package/dist/bscPlugin/hover/HoverProcessor.js +133 -103
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +241 -29
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +43 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +22 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/serialize/BslibInjector.spec.js +19 -0
- package/dist/bscPlugin/serialize/BslibInjector.spec.js.map +1 -0
- package/dist/bscPlugin/serialize/BslibManager.d.ts +9 -0
- package/dist/bscPlugin/serialize/BslibManager.js +40 -0
- package/dist/bscPlugin/serialize/BslibManager.js.map +1 -0
- package/dist/bscPlugin/serialize/FileSerializer.d.ts +9 -0
- package/dist/bscPlugin/serialize/FileSerializer.js +72 -0
- package/dist/bscPlugin/serialize/FileSerializer.js.map +1 -0
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.d.ts → BrsFileTranspileProcessor.d.ts} +4 -2
- package/dist/bscPlugin/transpile/{BrsFilePreTranspileProcessor.js → BrsFileTranspileProcessor.js} +29 -5
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js +41 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.d.ts +2 -2
- package/dist/bscPlugin/transpile/XmlFilePreTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +0 -4
- package/dist/bscPlugin/validation/BrsFileValidator.js +35 -65
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ProgramValidator.d.ts +3 -3
- package/dist/bscPlugin/validation/ProgramValidator.js +6 -6
- package/dist/bscPlugin/validation/ProgramValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +28 -7
- package/dist/bscPlugin/validation/ScopeValidator.js +393 -205
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.d.ts +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +2038 -0
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -0
- package/dist/bscPlugin/validation/XmlFileValidator.js +2 -2
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -1
- package/dist/cli.js +104 -13
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +3 -3
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +8 -2
- package/dist/diagnosticUtils.js +45 -16
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +1 -1
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/AssetFile.d.ts +26 -0
- package/dist/files/AssetFile.js +26 -0
- package/dist/files/AssetFile.js.map +1 -0
- package/dist/files/BrsFile.Class.spec.js +383 -56
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +73 -46
- package/dist/files/BrsFile.js +370 -534
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1139 -682
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/Factory.d.ts +25 -0
- package/dist/files/Factory.js +22 -0
- package/dist/files/Factory.js.map +1 -0
- package/dist/files/File.d.ts +106 -0
- package/dist/files/File.js +16 -0
- package/dist/files/File.js.map +1 -0
- package/dist/files/LazyFileData.d.ts +20 -0
- package/dist/files/LazyFileData.js +54 -0
- package/dist/files/LazyFileData.js.map +1 -0
- package/dist/files/LazyFileData.spec.d.ts +1 -0
- package/dist/files/LazyFileData.spec.js +27 -0
- package/dist/files/LazyFileData.spec.js.map +1 -0
- package/dist/files/XmlFile.d.ts +56 -23
- package/dist/files/XmlFile.js +88 -60
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +63 -91
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +21 -8
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.js +14 -14
- package/dist/files/tests/optionalChaning.spec.js.map +1 -1
- package/dist/globalCallables.js +88 -84
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +436 -81
- package/dist/interfaces.js +13 -2
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.d.ts +12 -0
- package/dist/lexer/Lexer.js +28 -8
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +40 -0
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +4 -0
- package/dist/lexer/Token.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +5 -0
- package/dist/lexer/TokenKind.js +14 -2
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +9 -2
- package/dist/parser/AstNode.js +16 -0
- package/dist/parser/AstNode.js.map +1 -1
- package/dist/parser/BrsTranspileState.d.ts +3 -2
- package/dist/parser/BrsTranspileState.js +3 -2
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +21 -5
- package/dist/parser/Expression.js +128 -35
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +103 -1
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +7 -0
- package/dist/parser/Parser.js +117 -21
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +557 -5
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +4 -4
- package/dist/parser/SGParser.js +3 -3
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +2 -2
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +2 -2
- package/dist/parser/Statement.d.ts +37 -12
- package/dist/parser/Statement.js +153 -46
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/tests/Parser.spec.js +2 -1
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +16 -8
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +12 -6
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +8 -4
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +4 -4
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +29 -29
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +10 -10
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +24 -24
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +75 -36
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +36 -36
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/UnaryExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js +52 -0
- package/dist/parser/tests/expression/UnaryExpression.spec.js.map +1 -0
- package/dist/parser/tests/statement/ConstStatement.spec.js +71 -22
- package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Continue.spec.js +2 -2
- package/dist/parser/tests/statement/Continue.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +38 -285
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/For.spec.js +6 -6
- package/dist/parser/tests/statement/For.spec.js.map +1 -1
- package/dist/parser/tests/statement/ForEach.spec.js +4 -4
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +26 -10
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +16 -13
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +5 -3
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +26 -13
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Manifest.js +2 -2
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/roku-types/data.json +243 -293
- package/dist/roku-types/index.d.ts +17 -38
- package/dist/types/ArrayType.d.ts +4 -1
- package/dist/types/ArrayType.js +46 -6
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +32 -3
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +11 -0
- package/dist/types/AssociativeArrayType.js +52 -0
- package/dist/types/AssociativeArrayType.js.map +1 -0
- package/dist/types/BaseFunctionType.d.ts +9 -0
- package/dist/types/BaseFunctionType.js +25 -0
- package/dist/types/BaseFunctionType.js.map +1 -0
- package/dist/types/BooleanType.d.ts +2 -1
- package/dist/types/BooleanType.js +8 -2
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BscType.d.ts +10 -6
- package/dist/types/BscType.js +69 -16
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +3 -0
- package/dist/types/BscTypeKind.js +3 -0
- package/dist/types/BscTypeKind.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.d.ts +23 -0
- package/dist/types/BuiltInInterfaceAdder.js +157 -0
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.d.ts +1 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js +116 -0
- package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -0
- package/dist/types/ClassType.d.ts +10 -4
- package/dist/types/ClassType.js +32 -5
- package/dist/types/ClassType.js.map +1 -1
- package/dist/types/ClassType.spec.js +5 -3
- package/dist/types/ClassType.spec.js.map +1 -1
- package/dist/types/ComponentType.d.ts +26 -0
- package/dist/types/ComponentType.js +83 -0
- package/dist/types/ComponentType.js.map +1 -0
- package/dist/types/DoubleType.d.ts +2 -1
- package/dist/types/DoubleType.js +9 -2
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DynamicType.d.ts +2 -2
- package/dist/types/DynamicType.js +3 -1
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/EnumType.d.ts +24 -6
- package/dist/types/EnumType.js +29 -7
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/FloatType.d.ts +2 -1
- package/dist/types/FloatType.js +9 -2
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FunctionType.d.ts +8 -20
- package/dist/types/FunctionType.js +17 -45
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/InheritableType.d.ts +7 -4
- package/dist/types/InheritableType.js +67 -3
- package/dist/types/InheritableType.js.map +1 -1
- package/dist/types/IntegerType.d.ts +2 -1
- package/dist/types/IntegerType.js +9 -2
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +6 -4
- package/dist/types/InterfaceType.js +8 -11
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +30 -2
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/InvalidType.d.ts +2 -1
- package/dist/types/InvalidType.js +7 -1
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +2 -1
- package/dist/types/LongIntegerType.js +9 -2
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/NamespaceType.d.ts +2 -1
- package/dist/types/NamespaceType.js +3 -0
- package/dist/types/NamespaceType.js.map +1 -1
- package/dist/types/ObjectType.d.ts +2 -2
- package/dist/types/ObjectType.js +5 -10
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +15 -3
- package/dist/types/ReferenceType.js +173 -24
- package/dist/types/ReferenceType.js.map +1 -1
- package/dist/types/ReferenceType.spec.js +21 -6
- package/dist/types/ReferenceType.spec.js.map +1 -1
- package/dist/types/StringType.d.ts +2 -1
- package/dist/types/StringType.js +9 -2
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +33 -0
- package/dist/types/TypedFunctionType.js +106 -0
- package/dist/types/TypedFunctionType.js.map +1 -0
- package/dist/types/TypedFunctionType.spec.d.ts +1 -0
- package/dist/types/TypedFunctionType.spec.js +122 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -0
- package/dist/types/UninitializedType.d.ts +2 -1
- package/dist/types/UninitializedType.js +1 -1
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.d.ts +4 -2
- package/dist/types/UnionType.js +36 -4
- package/dist/types/UnionType.js.map +1 -1
- package/dist/types/UnionType.spec.js +46 -19
- package/dist/types/UnionType.spec.js.map +1 -1
- package/dist/types/VoidType.d.ts +2 -1
- package/dist/types/VoidType.js +7 -2
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/helper.spec.js +15 -0
- package/dist/types/helper.spec.js.map +1 -1
- package/dist/types/helpers.d.ts +5 -0
- package/dist/types/helpers.js +50 -3
- package/dist/types/helpers.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/util.d.ts +71 -15
- package/dist/util.js +578 -150
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +0 -1
- package/dist/validators/ClassValidator.js +0 -22
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +3 -2
- package/dist/astUtils/AstEditor.js.map +0 -1
- package/dist/astUtils/AstEditor.spec.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +0 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +0 -31
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +0 -1
- package/dist/types/FunctionType.spec.js +0 -23
- package/dist/types/FunctionType.spec.js.map +0 -1
- /package/dist/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → completions/CompletionsProcessor.spec.d.ts} +0 -0
- /package/dist/{types/FunctionType.spec.d.ts → bscPlugin/serialize/BslibInjector.spec.d.ts} +0 -0
|
@@ -14,6 +14,7 @@ const InterfaceType_1 = require("./InterfaceType");
|
|
|
14
14
|
const SymbolTable_1 = require("../SymbolTable");
|
|
15
15
|
const DoubleType_1 = require("./DoubleType");
|
|
16
16
|
const BooleanType_1 = require("./BooleanType");
|
|
17
|
+
const EnumType_1 = require("./EnumType");
|
|
17
18
|
describe('findTypeIntersection', () => {
|
|
18
19
|
it('should return the intersection if the arrays have one element', () => {
|
|
19
20
|
const intersection = (0, helpers_1.findTypeIntersection)([IntegerType_1.IntegerType.instance], [IntegerType_1.IntegerType.instance]);
|
|
@@ -127,4 +128,18 @@ describe('getUniqueType', () => {
|
|
|
127
128
|
}
|
|
128
129
|
});
|
|
129
130
|
});
|
|
131
|
+
describe('isEnumTypeCompatible', () => {
|
|
132
|
+
it('should be true when an enum that is an int is passed to a number type', () => {
|
|
133
|
+
const myEnum = new EnumType_1.EnumType('test', IntegerType_1.IntegerType.instance);
|
|
134
|
+
const myEnumMember = new EnumType_1.EnumMemberType('test', 'val1', IntegerType_1.IntegerType.instance);
|
|
135
|
+
(0, chai_1.expect)(IntegerType_1.IntegerType.instance.isTypeCompatible(myEnum)).to.be.true;
|
|
136
|
+
(0, chai_1.expect)(FloatType_1.FloatType.instance.isTypeCompatible(myEnum)).to.be.true;
|
|
137
|
+
(0, chai_1.expect)(DoubleType_1.DoubleType.instance.isTypeCompatible(myEnum)).to.be.true;
|
|
138
|
+
(0, chai_1.expect)(IntegerType_1.IntegerType.instance.isTypeCompatible(myEnumMember)).to.be.true;
|
|
139
|
+
(0, chai_1.expect)(FloatType_1.FloatType.instance.isTypeCompatible(myEnumMember)).to.be.true;
|
|
140
|
+
(0, chai_1.expect)(DoubleType_1.DoubleType.instance.isTypeCompatible(myEnumMember)).to.be.true;
|
|
141
|
+
(0, chai_1.expect)(StringType_1.StringType.instance.isTypeCompatible(myEnum)).to.be.false;
|
|
142
|
+
(0, chai_1.expect)(StringType_1.StringType.instance.isTypeCompatible(myEnumMember)).to.be.false;
|
|
143
|
+
});
|
|
144
|
+
});
|
|
130
145
|
//# sourceMappingURL=helper.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.spec.js","sourceRoot":"","sources":["../../src/types/helper.spec.ts"],"names":[],"mappings":";;AAAA,+BAAsC;AACtC,uDAAqD;AACrD,0DAAqD;AACrD,2CAAwC;AACxC,+CAA4C;AAC5C,2CAAwC;AACxC,+CAA4C;AAC5C,6CAA0C;AAC1C,2CAA0D;AAC1D,uCAAwG;AACxG,mDAAgD;AAChD,gDAAgD;AAChD,6CAA0C;AAC1C,+CAA4C;
|
|
1
|
+
{"version":3,"file":"helper.spec.js","sourceRoot":"","sources":["../../src/types/helper.spec.ts"],"names":[],"mappings":";;AAAA,+BAAsC;AACtC,uDAAqD;AACrD,0DAAqD;AACrD,2CAAwC;AACxC,+CAA4C;AAC5C,2CAAwC;AACxC,+CAA4C;AAC5C,6CAA0C;AAC1C,2CAA0D;AAC1D,uCAAwG;AACxG,mDAAgD;AAChD,gDAAgD;AAChD,6CAA0C;AAC1C,+CAA4C;AAC5C,yCAAsD;AAGtD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAElC,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACrE,MAAM,YAAY,GAAG,IAAA,8BAAoB,EAAC,CAAC,yBAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,yBAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1F,IAAA,aAAM,EAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,IAAA,aAAM,EAAC,YAAY,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,yBAAW,CAAC,QAAQ,CAAC,CAAC;IAC1D,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,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAC3E,CAAC,CAAC,CAAC;AAGP,CAAC,CAAC,CAAC"}
|
package/dist/types/helpers.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TypeCompatibilityData } from '../interfaces';
|
|
1
2
|
import type { BscType } from './BscType';
|
|
2
3
|
export declare function findTypeIntersection(typesArr1: BscType[], typesArr2: BscType[]): BscType[];
|
|
3
4
|
export declare function findTypeUnion(...typesArr: BscType[][]): BscType[];
|
|
@@ -17,3 +18,7 @@ export declare function reduceTypesToMostGeneric(types: BscType[]): BscType[];
|
|
|
17
18
|
* @returns either the singular most general type, if there is one, otherwise a UnionType of the most general types
|
|
18
19
|
*/
|
|
19
20
|
export declare function getUniqueType(types: BscType[], unionTypeFactory: (types: BscType[]) => BscType): BscType;
|
|
21
|
+
export declare function isUnionTypeCompatible(thisType: BscType, maybeUnionType: BscType, data?: TypeCompatibilityData): boolean;
|
|
22
|
+
export declare function isEnumTypeCompatible(thisType: BscType, maybeEnumType: BscType, data?: TypeCompatibilityData): boolean;
|
|
23
|
+
export declare function isNativeInterfaceCompatible(thisType: BscType, otherType: BscType, allowedType: string, data?: TypeCompatibilityData): boolean;
|
|
24
|
+
export declare function isNativeInterfaceCompatibleNumber(thisType: BscType, otherType: BscType, data?: TypeCompatibilityData): boolean;
|
package/dist/types/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUniqueType = exports.reduceTypesToMostGeneric = exports.getUniqueTypesFromArray = exports.findTypeUnion = exports.findTypeIntersection = void 0;
|
|
3
|
+
exports.isNativeInterfaceCompatibleNumber = exports.isNativeInterfaceCompatible = exports.isEnumTypeCompatible = exports.isUnionTypeCompatible = exports.getUniqueType = exports.reduceTypesToMostGeneric = exports.getUniqueTypesFromArray = exports.findTypeUnion = exports.findTypeIntersection = void 0;
|
|
4
4
|
const reflection_1 = require("../astUtils/reflection");
|
|
5
5
|
function findTypeIntersection(typesArr1, typesArr2) {
|
|
6
6
|
if (!typesArr1 || !typesArr2) {
|
|
@@ -62,7 +62,7 @@ function reduceTypesToMostGeneric(types) {
|
|
|
62
62
|
// only one type after filtering
|
|
63
63
|
return [uniqueTypes[0].type];
|
|
64
64
|
}
|
|
65
|
-
const existingDynamicType = uniqueTypes.find(t => !(0, reflection_1.
|
|
65
|
+
const existingDynamicType = uniqueTypes.find(t => !(0, reflection_1.isAnyReferenceType)(t.type) && (0, reflection_1.isDynamicType)(t.type));
|
|
66
66
|
if (existingDynamicType) {
|
|
67
67
|
// If it includes dynamic, then the result is dynamic
|
|
68
68
|
return [existingDynamicType.type];
|
|
@@ -111,8 +111,15 @@ exports.reduceTypesToMostGeneric = reduceTypesToMostGeneric;
|
|
|
111
111
|
* @returns either the singular most general type, if there is one, otherwise a UnionType of the most general types
|
|
112
112
|
*/
|
|
113
113
|
function getUniqueType(types, unionTypeFactory) {
|
|
114
|
+
if (!types || types.length === 0) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const dynType = types.find((x) => !(0, reflection_1.isAnyReferenceType)(x) && (0, reflection_1.isDynamicType)(x));
|
|
118
|
+
if (dynType) {
|
|
119
|
+
return dynType;
|
|
120
|
+
}
|
|
114
121
|
types = types === null || types === void 0 ? void 0 : types.map(type => {
|
|
115
|
-
if (!(0, reflection_1.
|
|
122
|
+
if (!(0, reflection_1.isAnyReferenceType)(type) && (0, reflection_1.isUnionType)(type)) {
|
|
116
123
|
return type.types;
|
|
117
124
|
}
|
|
118
125
|
return type;
|
|
@@ -128,4 +135,44 @@ function getUniqueType(types, unionTypeFactory) {
|
|
|
128
135
|
return unionTypeFactory(generalizedTypes);
|
|
129
136
|
}
|
|
130
137
|
exports.getUniqueType = getUniqueType;
|
|
138
|
+
function isUnionTypeCompatible(thisType, maybeUnionType, data) {
|
|
139
|
+
if ((0, reflection_1.isUnionType)(maybeUnionType)) {
|
|
140
|
+
for (const innerType of maybeUnionType.types) {
|
|
141
|
+
if (!thisType.isTypeCompatible(innerType, data)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
exports.isUnionTypeCompatible = isUnionTypeCompatible;
|
|
150
|
+
function isEnumTypeCompatible(thisType, maybeEnumType, data) {
|
|
151
|
+
if ((0, reflection_1.isEnumMemberType)(maybeEnumType) || (0, reflection_1.isEnumType)(maybeEnumType)) {
|
|
152
|
+
return thisType.isTypeCompatible(maybeEnumType.underlyingType, data);
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
exports.isEnumTypeCompatible = isEnumTypeCompatible;
|
|
157
|
+
function isNativeInterfaceCompatible(thisType, otherType, allowedType, data) {
|
|
158
|
+
if ((0, reflection_1.isInterfaceType)(otherType)) {
|
|
159
|
+
// TODO: it is not great to do type checking based on interface name
|
|
160
|
+
const lowerOtherName = otherType.name.toLowerCase();
|
|
161
|
+
return allowedType === lowerOtherName;
|
|
162
|
+
}
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
exports.isNativeInterfaceCompatible = isNativeInterfaceCompatible;
|
|
166
|
+
function isNativeInterfaceCompatibleNumber(thisType, otherType, data) {
|
|
167
|
+
if ((0, reflection_1.isInterfaceType)(otherType)) {
|
|
168
|
+
// TODO: it is not great to do type checking based on interface name
|
|
169
|
+
const lowerOtherName = otherType.name.toLowerCase();
|
|
170
|
+
return lowerOtherName === 'roint' ||
|
|
171
|
+
lowerOtherName === 'rofloat' ||
|
|
172
|
+
lowerOtherName === 'rodouble' ||
|
|
173
|
+
lowerOtherName === 'rolonginteger';
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
exports.isNativeInterfaceCompatibleNumber = isNativeInterfaceCompatibleNumber;
|
|
131
178
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/types/helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/types/helpers.ts"],"names":[],"mappings":";;;AACA,uDAA0J;AAG1J,SAAgB,oBAAoB,CAAC,SAAoB,EAAE,SAAoB;IAC3E,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,EAAE;QAC1B,OAAO,SAAS,CAAC;KACpB;IACD,OAAO,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;QACrC,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QACD,MAAM,wBAAwB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;YAC/D,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QACH,OAAO,wBAAwB,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,oDAaC;AAED,SAAgB,aAAa,CAAC,GAAG,QAAqB;IAClD,OAAO,uBAAuB,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC3D,CAAC;AAFD,sCAEC;AAED,SAAgB,uBAAuB,CAAC,KAAgB;IACpD,IAAI,CAAC,KAAK,EAAE;QACR,OAAO,SAAS,CAAC;KACpB;IACD,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE;QAC/C,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QACD,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;YAC9C,OAAO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
export * from './FloatType';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './TypedFunctionType';
|
|
10
10
|
export * from './helpers';
|
|
11
11
|
export * from './InheritableType';
|
|
12
12
|
export * from './IntegerType';
|
package/dist/types/index.js
CHANGED
|
@@ -22,7 +22,7 @@ __exportStar(require("./DoubleType"), exports);
|
|
|
22
22
|
__exportStar(require("./DynamicType"), exports);
|
|
23
23
|
__exportStar(require("./EnumType"), exports);
|
|
24
24
|
__exportStar(require("./FloatType"), exports);
|
|
25
|
-
__exportStar(require("./
|
|
25
|
+
__exportStar(require("./TypedFunctionType"), exports);
|
|
26
26
|
__exportStar(require("./helpers"), exports);
|
|
27
27
|
__exportStar(require("./InheritableType"), exports);
|
|
28
28
|
__exportStar(require("./IntegerType"), exports);
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,gDAA8B;AAC9B,6CAA2B;AAC3B,8CAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,gDAA8B;AAC9B,6CAA2B;AAC3B,8CAA4B;AAC5B,sDAAoC;AACpC,4CAA0B;AAC1B,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,gDAA8B;AAC9B,oDAAkC;AAClC,kDAAgC;AAChC,+CAA6B;AAC7B,kDAAgC;AAChC,+CAA6B;AAC7B,sDAAoC;AACpC,8CAA4B;AAC5B,6CAA2B"}
|
package/dist/util.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Diagnostic, type Position, type Range, type Location } from 'vscode-languageserver';
|
|
2
2
|
import type { BsConfig } from './BsConfig';
|
|
3
3
|
import type { CallableContainer, BsDiagnostic, FileReference, CallableContainerMap, CompilerPlugin, ExpressionInfo, TypeChainEntry, TypeChainProcessResult } from './interfaces';
|
|
4
4
|
import { BooleanType } from './types/BooleanType';
|
|
5
5
|
import { DoubleType } from './types/DoubleType';
|
|
6
6
|
import { DynamicType } from './types/DynamicType';
|
|
7
7
|
import { FloatType } from './types/FloatType';
|
|
8
|
-
import { FunctionType } from './types/FunctionType';
|
|
9
8
|
import { IntegerType } from './types/IntegerType';
|
|
10
|
-
import { InvalidType } from './types/InvalidType';
|
|
11
9
|
import { LongIntegerType } from './types/LongIntegerType';
|
|
12
10
|
import { ObjectType } from './types/ObjectType';
|
|
13
11
|
import { StringType } from './types/StringType';
|
|
@@ -18,7 +16,12 @@ import type { Identifier, Locatable, Token } from './lexer/Token';
|
|
|
18
16
|
import { SourceNode } from 'source-map';
|
|
19
17
|
import type { BrsFile } from './files/BrsFile';
|
|
20
18
|
import type { XmlFile } from './files/XmlFile';
|
|
21
|
-
import type {
|
|
19
|
+
import type { AstNode } from './parser/AstNode';
|
|
20
|
+
import { type Expression, type Statement } from './parser/AstNode';
|
|
21
|
+
import type { BscType } from './types/BscType';
|
|
22
|
+
import { FunctionType } from './types/FunctionType';
|
|
23
|
+
import type { SymbolTable } from './SymbolTable';
|
|
24
|
+
import type { UnresolvedSymbol } from './AstValidationSegmenter';
|
|
22
25
|
export declare class Util {
|
|
23
26
|
clearConsole(): void;
|
|
24
27
|
/**
|
|
@@ -47,6 +50,7 @@ export declare class Util {
|
|
|
47
50
|
startsWithProtocol(path: string): boolean;
|
|
48
51
|
/**
|
|
49
52
|
* Given a pkg path of any kind, transform it to a roku-specific pkg path (i.e. "pkg:/some/path.brs")
|
|
53
|
+
* @deprecated use `sanitizePkgPath instead. Will be removed in v1
|
|
50
54
|
*/
|
|
51
55
|
getRokuPkgPath(pkgPath: string): string;
|
|
52
56
|
/**
|
|
@@ -147,6 +151,21 @@ export declare class Util {
|
|
|
147
151
|
*/
|
|
148
152
|
rangeContains(range: Range, position: Position): boolean;
|
|
149
153
|
comparePositionToRange(position: Position, range: Range): 1 | -1 | 0;
|
|
154
|
+
/**
|
|
155
|
+
* Combine all the documentation found before a token (i.e. comment tokens)
|
|
156
|
+
*/
|
|
157
|
+
getTokenDocumentation(tokens: Token[], token?: Token): string;
|
|
158
|
+
/**
|
|
159
|
+
* Combine all the documentation for a node - uses the AstNode's leadingTrivia property
|
|
160
|
+
*/
|
|
161
|
+
getNodeDocumentation(node: AstNode): string;
|
|
162
|
+
/**
|
|
163
|
+
* Prefixes a component name so it can be used as type in the symbol table, without polluting available symbols
|
|
164
|
+
*
|
|
165
|
+
* @param sgNodeName the Name of the component
|
|
166
|
+
* @returns the node name, prefixed with `roSGNode`
|
|
167
|
+
*/
|
|
168
|
+
getSgNodeTypeName(sgNodeName: string): string;
|
|
150
169
|
/**
|
|
151
170
|
* Parse an xml file and get back a javascript object containing its results
|
|
152
171
|
*/
|
|
@@ -259,6 +278,11 @@ export declare class Util {
|
|
|
259
278
|
* Helper for creating `Location` objects. Prefer using this function because vscode-languageserver's `Location.create()` is significantly slower at scale
|
|
260
279
|
*/
|
|
261
280
|
createLocation(uri: string, range: Range): Location;
|
|
281
|
+
/**
|
|
282
|
+
* A cache of `Range` objects. The key is a 52bit integer created from the 4 range integers and leveraging bitshifting.
|
|
283
|
+
* The whole point of this cache is to reduce garbage collection churn, so we didn't want to use string concatenation for the key
|
|
284
|
+
*/
|
|
285
|
+
private rangeCache;
|
|
262
286
|
/**
|
|
263
287
|
* Helper for creating `Range` objects. Prefer using this function because vscode-languageserver's `Range.create()` is significantly slower
|
|
264
288
|
*/
|
|
@@ -274,13 +298,15 @@ export declare class Util {
|
|
|
274
298
|
createBoundingRange(...locatables: Array<{
|
|
275
299
|
range?: Range;
|
|
276
300
|
}>): Range;
|
|
301
|
+
/**
|
|
302
|
+
* A cache of `Position` objects. The key is a 26bit integer created from line and character and leveraging bitshifting
|
|
303
|
+
* The whole point of this cache is to reduce garbage collection churn, so we didn't want to use string concatenation for the key
|
|
304
|
+
*/
|
|
305
|
+
private positionCache;
|
|
277
306
|
/**
|
|
278
307
|
* Create a `Position` object. Prefer this over `Position.create` for performance reasons
|
|
279
308
|
*/
|
|
280
|
-
createPosition(line: number, character: number):
|
|
281
|
-
line: number;
|
|
282
|
-
character: number;
|
|
283
|
-
};
|
|
309
|
+
createPosition(line: number, character: number): Position;
|
|
284
310
|
/**
|
|
285
311
|
* Convert a list of tokens into a string, including their leading whitespace
|
|
286
312
|
*/
|
|
@@ -288,10 +314,27 @@ export declare class Util {
|
|
|
288
314
|
/**
|
|
289
315
|
* Convert a token into a BscType
|
|
290
316
|
*/
|
|
291
|
-
tokenToBscType(token: Token): DynamicType |
|
|
317
|
+
tokenToBscType(token: Token): DynamicType | ObjectType | StringType | IntegerType | BooleanType | FloatType | DoubleType | LongIntegerType | VoidType | FunctionType;
|
|
318
|
+
/**
|
|
319
|
+
* Deciphers the correct types for fields based on docs
|
|
320
|
+
* https://developer.roku.com/en-ca/docs/references/scenegraph/xml-elements/interface.md
|
|
321
|
+
* @param typeDescriptor the type descriptor from the docs
|
|
322
|
+
* @returns {BscType} the known type, or dynamic
|
|
323
|
+
*/
|
|
324
|
+
getNodeFieldType(typeDescriptor: string, lookupTable?: SymbolTable): BscType;
|
|
325
|
+
/**
|
|
326
|
+
* Return the type of the result of a binary operator
|
|
327
|
+
* Note: compound assignments (eg. +=) internally use a binary expression, so that's why TokenKind.PlusEqual, etc. are here too
|
|
328
|
+
*/
|
|
329
|
+
binaryOperatorResultType(leftType: BscType, operator: Token, rightType: BscType): BscType;
|
|
330
|
+
/**
|
|
331
|
+
* Return the type of the result of a binary operator
|
|
332
|
+
*/
|
|
333
|
+
unaryOperatorResultType(operator: Token, exprType: BscType): BscType;
|
|
292
334
|
/**
|
|
293
335
|
* Get the extension for the given file path. Basically the part after the final dot, except for
|
|
294
336
|
* `d.bs` which is treated as single extension
|
|
337
|
+
* @returns the file extension (i.e. ".d.bs", ".bs", ".brs", ".xml", ".jpg", etc...)
|
|
295
338
|
*/
|
|
296
339
|
getExtension(filePath: string): string;
|
|
297
340
|
/**
|
|
@@ -303,6 +346,7 @@ export declare class Util {
|
|
|
303
346
|
* This is mostly used for the ternary expression
|
|
304
347
|
*/
|
|
305
348
|
getExpressionInfo(expression: Expression): ExpressionInfo;
|
|
349
|
+
concatAnnotationLeadingTrivia(stmt: Statement, otherTrivia: Token[]): Token[];
|
|
306
350
|
/**
|
|
307
351
|
* Create a SourceNode that maps every line to itself. Useful for creating maps for files
|
|
308
352
|
* that haven't changed at all, but we still need the map
|
|
@@ -312,17 +356,13 @@ export declare class Util {
|
|
|
312
356
|
* Converts a path into a standardized format (drive letter to lower, remove extra slashes, use single slash type, resolve relative parts, etc...)
|
|
313
357
|
*/
|
|
314
358
|
standardizePath(thePath: string): string;
|
|
315
|
-
/**
|
|
316
|
-
* Copy the version of bslib from local node_modules to the staging folder
|
|
317
|
-
*/
|
|
318
|
-
copyBslibToStaging(stagingDir: string): Promise<void>;
|
|
319
359
|
/**
|
|
320
360
|
* Given a Diagnostic or BsDiagnostic, return a deep clone of the diagnostic.
|
|
321
361
|
* @param diagnostic the diagnostic to clone
|
|
322
362
|
* @param relatedInformationFallbackLocation a default location to use for all `relatedInformation` entries that are missing a location
|
|
323
363
|
*/
|
|
324
364
|
toDiagnostic(diagnostic: Diagnostic | BsDiagnostic, relatedInformationFallbackLocation: string): {
|
|
325
|
-
severity: import("vscode-languageserver
|
|
365
|
+
severity: import("vscode-languageserver").DiagnosticSeverity;
|
|
326
366
|
range: Range;
|
|
327
367
|
message: string;
|
|
328
368
|
relatedInformation: {
|
|
@@ -359,8 +399,13 @@ export declare class Util {
|
|
|
359
399
|
* @param node any ast expression
|
|
360
400
|
* @returns an array of the parts of the dotted get. If not fully a dotted get, then returns undefined
|
|
361
401
|
*/
|
|
362
|
-
getAllDottedGetParts(node:
|
|
402
|
+
getAllDottedGetParts(node: AstNode): Identifier[] | undefined;
|
|
403
|
+
/**
|
|
404
|
+
* Given an expression, return all the DottedGet name parts as a string.
|
|
405
|
+
* Mostly used to convert namespaced item full names to a strings
|
|
406
|
+
*/
|
|
363
407
|
getAllDottedGetPartsAsString(node: Expression | Statement, parseMode?: ParseMode): string;
|
|
408
|
+
stringJoin(strings: string[], separator: string): string;
|
|
364
409
|
/**
|
|
365
410
|
* Break an expression into each part.
|
|
366
411
|
*/
|
|
@@ -383,6 +428,17 @@ export declare class Util {
|
|
|
383
428
|
*/
|
|
384
429
|
findLastIndex<T>(array: T[], matcher: (T: any) => boolean): number;
|
|
385
430
|
processTypeChain(typeChain: TypeChainEntry[]): TypeChainProcessResult;
|
|
431
|
+
isInTypeExpression(expression: AstNode): boolean;
|
|
432
|
+
setContainsUnresolvedSymbol(symbolLowerNameSet: Set<string>, symbol: UnresolvedSymbol): boolean;
|
|
433
|
+
truncate<T>(options: {
|
|
434
|
+
leadingText: string;
|
|
435
|
+
items: T[];
|
|
436
|
+
trailingText?: string;
|
|
437
|
+
maxLength: number;
|
|
438
|
+
itemSeparator?: string;
|
|
439
|
+
partBuilder?: (item: T) => string;
|
|
440
|
+
}): string;
|
|
441
|
+
getAstNodeFriendlyName(node: AstNode): string;
|
|
386
442
|
}
|
|
387
443
|
/**
|
|
388
444
|
* A tagged template literal function for standardizing the path. This has to be defined as standalone function since it's a tagged template literal function,
|