brighterscript 1.0.0-alpha.1 → 1.0.0-alpha.13
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 +362 -248
- package/README.md +2 -2
- package/bsconfig.schema.json +1 -1
- package/dist/CodeActionUtil.d.ts +11 -2
- package/dist/CodeActionUtil.js +17 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +4 -4
- package/dist/CommentFlagProcessor.js +5 -3
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.js +2 -2
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.js +3 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +15 -5
- package/dist/DiagnosticMessages.js +19 -9
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/LanguageServer.d.ts +11 -10
- package/dist/LanguageServer.js +87 -58
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +2 -0
- package/dist/Logger.js +5 -3
- package/dist/Logger.js.map +1 -1
- package/dist/Program.d.ts +76 -46
- package/dist/Program.js +254 -180
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +7 -7
- package/dist/ProgramBuilder.js +37 -43
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +33 -23
- package/dist/Scope.js +222 -147
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.d.ts +14 -0
- package/dist/SemanticTokenUtils.js +81 -0
- package/dist/SemanticTokenUtils.js.map +1 -0
- package/dist/SymbolTable.d.ts +9 -3
- package/dist/SymbolTable.js +40 -13
- package/dist/SymbolTable.js.map +1 -1
- package/dist/XmlScope.d.ts +7 -2
- package/dist/XmlScope.js +67 -29
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/AstEditor.d.ts +27 -0
- package/dist/astUtils/AstEditor.js +97 -0
- package/dist/astUtils/AstEditor.js.map +1 -0
- package/dist/astUtils/AstEditor.spec.d.ts +1 -0
- package/dist/astUtils/AstEditor.spec.js +133 -0
- package/dist/astUtils/AstEditor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +15 -1
- package/dist/astUtils/creators.js +39 -9
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +4 -4
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/index.js +1 -1
- package/dist/astUtils/reflection.d.ts +20 -8
- package/dist/astUtils/reflection.js +42 -1
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +115 -115
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +13 -13
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.js +1 -1
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +28 -28
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +4 -3
- package/dist/astUtils/xml.js +8 -3
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +2 -1
- package/dist/bscPlugin/BscPlugin.js +4 -0
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +5 -6
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +30 -30
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +7 -0
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +63 -0
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +45 -0
- package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +1 -0
- package/dist/diagnosticUtils.d.ts +1 -0
- package/dist/diagnosticUtils.js +14 -7
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +2 -2
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/BrsFile.Class.spec.js +486 -71
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +48 -23
- package/dist/files/BrsFile.js +403 -233
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +367 -316
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +13 -6
- package/dist/files/XmlFile.js +27 -21
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +274 -228
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +49 -49
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/globalCallables.d.ts +3 -1
- package/dist/globalCallables.js +359 -87
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +51 -14
- package/dist/lexer/Lexer.d.ts +14 -1
- package/dist/lexer/Lexer.js +91 -21
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +187 -132
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +2 -2
- package/dist/lexer/TokenKind.d.ts +7 -1
- package/dist/lexer/TokenKind.js +51 -3
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/lexer/index.js +2 -1
- package/dist/lexer/index.js.map +1 -1
- package/dist/parser/BrsTranspileState.d.ts +7 -0
- package/dist/parser/BrsTranspileState.js +10 -1
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +23 -5
- package/dist/parser/Expression.js +124 -75
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +159 -60
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +114 -26
- package/dist/parser/Parser.js +471 -126
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +396 -235
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +41 -4
- package/dist/parser/SGParser.js +186 -175
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +35 -22
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +206 -38
- package/dist/parser/SGTypes.js +470 -161
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/SGTypes.spec.d.ts +1 -0
- package/dist/parser/SGTypes.spec.js +351 -0
- package/dist/parser/SGTypes.spec.js.map +1 -0
- package/dist/parser/Statement.d.ts +92 -18
- package/dist/parser/Statement.js +287 -58
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +11 -11
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +15 -7
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/index.js +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +8 -7
- package/dist/parser/tests/Parser.spec.js +12 -8
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +50 -50
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +31 -31
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +174 -156
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +32 -32
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +21 -21
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +105 -105
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +148 -124
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +17 -17
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +30 -30
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +16 -16
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +247 -247
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +73 -73
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +36 -36
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +59 -47
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +35 -35
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +26 -26
- 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 +170 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/Relational.spec.js +42 -42
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +8 -8
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +12 -12
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +100 -100
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +35 -35
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/Declaration.spec.js +39 -39
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +21 -21
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Function.spec.js +192 -192
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +11 -11
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +46 -46
- 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 +61 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/LibraryStatement.spec.js +10 -10
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +37 -36
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +30 -30
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +43 -43
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +69 -69
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +9 -9
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +5 -5
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +13 -13
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Chunk.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +1 -1
- package/dist/preprocessor/Preprocessor.js +1 -1
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +49 -49
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +72 -72
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/preprocessor/index.js +1 -1
- package/dist/types/ArrayType.js +5 -4
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +8 -8
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/BooleanType.js +3 -3
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +2 -2
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +19 -5
- package/dist/types/BscType.js +9 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/CustomType.d.ts +8 -5
- package/dist/types/CustomType.js +17 -6
- package/dist/types/CustomType.js.map +1 -1
- package/dist/types/DoubleType.js +8 -8
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +2 -2
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.js +1 -1
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +2 -2
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/FloatType.d.ts +1 -1
- package/dist/types/FloatType.js +8 -8
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +2 -2
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +5 -11
- package/dist/types/FunctionType.js +24 -13
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/FunctionType.spec.js +11 -5
- package/dist/types/FunctionType.spec.js.map +1 -1
- package/dist/types/IntegerType.d.ts +1 -1
- package/dist/types/IntegerType.js +8 -8
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +2 -2
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +8 -2
- package/dist/types/InterfaceType.js +42 -6
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.d.ts +1 -0
- package/dist/types/InterfaceType.spec.js +174 -0
- package/dist/types/InterfaceType.spec.js.map +1 -0
- package/dist/types/InvalidType.js +4 -4
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +2 -2
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LazyType.d.ts +9 -7
- package/dist/types/LazyType.js +22 -10
- package/dist/types/LazyType.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +1 -1
- package/dist/types/LongIntegerType.js +8 -8
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +2 -2
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/ObjectType.d.ts +7 -4
- package/dist/types/ObjectType.js +6 -3
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +2 -2
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/StringType.js +3 -3
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +2 -2
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/UninitializedType.js +3 -3
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/VoidType.js +3 -3
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +2 -2
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helpers.d.ts +42 -0
- package/dist/types/helpers.js +113 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/util.d.ts +77 -17
- package/dist/util.js +247 -59
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +5 -1
- package/dist/validators/ClassValidator.js +59 -24
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +13 -13
package/dist/Program.d.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import type { CodeAction, CompletionItem, Position, Range, SignatureInformation } from 'vscode-languageserver';
|
|
1
|
+
import type { CodeAction, CompletionItem, Position, Range, SignatureInformation, SymbolInformation } from 'vscode-languageserver';
|
|
2
2
|
import { Location } from 'vscode-languageserver';
|
|
3
3
|
import type { BsConfig } from './BsConfig';
|
|
4
4
|
import { Scope } from './Scope';
|
|
5
5
|
import { BrsFile } from './files/BrsFile';
|
|
6
6
|
import { XmlFile } from './files/XmlFile';
|
|
7
|
-
import type { BsDiagnostic,
|
|
7
|
+
import type { BsDiagnostic, FileReference, FileObj, BscFile, SemanticToken } from './interfaces';
|
|
8
8
|
import { XmlScope } from './XmlScope';
|
|
9
9
|
import { Logger } from './Logger';
|
|
10
|
+
import type { ManifestValue } from './preprocessor/Manifest';
|
|
10
11
|
import PluginInterface from './PluginInterface';
|
|
11
12
|
import type { FunctionStatement, Statement } from './parser/Statement';
|
|
13
|
+
export interface SourceObj {
|
|
14
|
+
srcPath: string;
|
|
15
|
+
source: string;
|
|
16
|
+
definitions?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface TranspileObj {
|
|
19
|
+
file: BscFile;
|
|
20
|
+
outputPath: string;
|
|
21
|
+
}
|
|
12
22
|
export interface SignatureInfoObj {
|
|
13
23
|
index: number;
|
|
14
24
|
key: string;
|
|
@@ -55,13 +65,20 @@ export declare class Program {
|
|
|
55
65
|
/**
|
|
56
66
|
* The path to bslib.brs (the BrightScript runtime for certain BrighterScript features)
|
|
57
67
|
*/
|
|
58
|
-
get bslibPkgPath():
|
|
68
|
+
get bslibPkgPath(): "pkg:/source/roku_modules/bslib/bslib.brs" | "pkg:/source/roku_modules/rokucommunity_bslib/bslib.brs" | "pkg:/source/bslib.brs";
|
|
59
69
|
get bslibPrefix(): "rokucommunity_bslib" | "bslib";
|
|
60
70
|
/**
|
|
61
|
-
* A map of every file loaded
|
|
71
|
+
* A map of every file loaded ino this program, indexed by its lower-case pkgPath
|
|
62
72
|
*/
|
|
63
|
-
files: Record<string, BrsFile | XmlFile>;
|
|
64
73
|
private pkgMap;
|
|
74
|
+
/**
|
|
75
|
+
* A map of every file loaded into this program, indexed by its lower-case srcPath
|
|
76
|
+
*/
|
|
77
|
+
private files;
|
|
78
|
+
/**
|
|
79
|
+
* Get a copy of the list of files currently loaded in the program
|
|
80
|
+
*/
|
|
81
|
+
getFiles(): BscFile[];
|
|
65
82
|
private scopes;
|
|
66
83
|
protected addScope(scope: Scope): void;
|
|
67
84
|
/**
|
|
@@ -96,7 +113,7 @@ export declare class Program {
|
|
|
96
113
|
* Get a list of all files that are included in the project but are not referenced
|
|
97
114
|
* by any scope in the program.
|
|
98
115
|
*/
|
|
99
|
-
getUnreferencedFiles():
|
|
116
|
+
getUnreferencedFiles(): BscFile[];
|
|
100
117
|
/**
|
|
101
118
|
* Get the list of errors for the entire program. It's calculated on the fly
|
|
102
119
|
* by walking through every file, so call this sparingly.
|
|
@@ -106,9 +123,9 @@ export declare class Program {
|
|
|
106
123
|
/**
|
|
107
124
|
* Determine if the specified file is loaded in this program right now.
|
|
108
125
|
* @param filePath
|
|
126
|
+
* @param normalizePath should the provided path be normalized before use
|
|
109
127
|
*/
|
|
110
|
-
hasFile(filePath: string): boolean;
|
|
111
|
-
getPkgPath(...args: any[]): any;
|
|
128
|
+
hasFile(filePath: string, normalizePath?: boolean): boolean;
|
|
112
129
|
/**
|
|
113
130
|
* roku filesystem is case INsensitive, so find the scope by key case insensitive
|
|
114
131
|
* @param scopeName
|
|
@@ -122,51 +139,50 @@ export declare class Program {
|
|
|
122
139
|
* Find the scope for the specified component
|
|
123
140
|
*/
|
|
124
141
|
getComponentScope(componentName: string): XmlScope;
|
|
142
|
+
/**
|
|
143
|
+
* Update internal maps with this file reference
|
|
144
|
+
*/
|
|
145
|
+
private assignFile;
|
|
146
|
+
/**
|
|
147
|
+
* Remove this file from internal maps
|
|
148
|
+
*/
|
|
149
|
+
private unassignFile;
|
|
125
150
|
/**
|
|
126
151
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
127
152
|
* If file contents are provided, those are used, Otherwise, the file is loaded from the file system
|
|
128
|
-
* @param
|
|
153
|
+
* @param srcDestOrPkgPath the absolute path, or the pkg path (i.e. `pkg:/path/to/file.brs`) or the destPath (i.e. `path/to/file.brs` relative to `pkg:/`)
|
|
129
154
|
* @param fileContents the file contents
|
|
130
155
|
*/
|
|
131
|
-
|
|
156
|
+
setFile<T extends BscFile>(srcDestOrPkgPath: string, fileContents: string): T;
|
|
132
157
|
/**
|
|
133
158
|
* Load a file into the program. If that file already exists, it is replaced.
|
|
134
159
|
* @param fileEntry an object that specifies src and dest for the file.
|
|
135
160
|
* @param fileContents the file contents. If not provided, the file will be loaded from disk
|
|
136
161
|
*/
|
|
137
|
-
|
|
162
|
+
setFile<T extends BscFile>(fileEntry: FileObj, fileContents: string): T;
|
|
138
163
|
/**
|
|
139
164
|
* Ensure source scope is created.
|
|
140
165
|
* Note: automatically called internally, and no-op if it exists already.
|
|
141
166
|
*/
|
|
142
167
|
createSourceScope(): void;
|
|
143
|
-
/**
|
|
144
|
-
* Find the file by its absolute path. This is case INSENSITIVE, since
|
|
145
|
-
* Roku is a case insensitive file system. It is an error to have multiple files
|
|
146
|
-
* with the same path with only case being different.
|
|
147
|
-
* @param pathAbsolute
|
|
148
|
-
*/
|
|
149
|
-
getFileByPathAbsolute<T extends BrsFile | XmlFile>(pathAbsolute: string): T;
|
|
150
|
-
/**
|
|
151
|
-
* Get a list of files for the given (platform-normalized) pkgPath array.
|
|
152
|
-
* Missing files are just ignored.
|
|
153
|
-
*/
|
|
154
|
-
getFilesByPkgPaths<T extends BscFile[]>(pkgPaths: string[]): T;
|
|
155
|
-
/**
|
|
156
|
-
* Get a file with the specified (platform-normalized) pkg path.
|
|
157
|
-
* If not found, return undefined
|
|
158
|
-
*/
|
|
159
|
-
getFileByPkgPath<T extends BscFile>(pkgPath: string): T;
|
|
160
168
|
/**
|
|
161
169
|
* Remove a set of files from the program
|
|
162
|
-
* @param
|
|
170
|
+
* @param srcPaths
|
|
163
171
|
*/
|
|
164
|
-
removeFiles(
|
|
172
|
+
removeFiles(srcPaths: string[]): void;
|
|
165
173
|
/**
|
|
166
174
|
* Remove a file from the program
|
|
167
|
-
* @param
|
|
175
|
+
* @param filePath can be a srcPath, a pkgPath, or a destPath (same as pkgPath but without `pkg:/`)
|
|
176
|
+
* @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
|
|
177
|
+
|
|
178
|
+
*/
|
|
179
|
+
removeFile(filePath: string, normalizePath?: boolean): void;
|
|
180
|
+
/**
|
|
181
|
+
* Remove all files from the program that are in the specified folder path (recursive)
|
|
182
|
+
* @param folderSrcPath The absolute path to the folder on disk
|
|
183
|
+
* @param normalizePath should the provided path be normalized before use?
|
|
168
184
|
*/
|
|
169
|
-
|
|
185
|
+
removeFilesInFolder(folderSrcPath: string, normalizePath?: boolean): void;
|
|
170
186
|
/**
|
|
171
187
|
* Traverse the entire project, and validate all scopes
|
|
172
188
|
* @param force - if true, then all scopes are force to validate, even if they aren't marked as dirty
|
|
@@ -182,9 +198,10 @@ export declare class Program {
|
|
|
182
198
|
private fileIsIncludedInAnyScope;
|
|
183
199
|
/**
|
|
184
200
|
* Get the file at the given path
|
|
185
|
-
* @param
|
|
201
|
+
* @param filePath can be a srcPath, a pkgPath, or a destPath (same as pkgPath but without `pkg:/`)
|
|
202
|
+
* @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
|
|
186
203
|
*/
|
|
187
|
-
|
|
204
|
+
getFile<T extends BscFile>(filePath: string, normalizePath?: boolean): T;
|
|
188
205
|
/**
|
|
189
206
|
* Get a list of all scopes the file is loaded into
|
|
190
207
|
* @param file
|
|
@@ -194,29 +211,41 @@ export declare class Program {
|
|
|
194
211
|
getStatementsForXmlFile(scope: XmlScope, filterName?: string): FileLink<FunctionStatement>[];
|
|
195
212
|
/**
|
|
196
213
|
* Find all available completion items at the given position
|
|
197
|
-
* @param
|
|
214
|
+
* @param srcPath The absolute path to the source file on disk
|
|
198
215
|
* @param lineIndex
|
|
199
216
|
* @param columnIndex
|
|
200
217
|
*/
|
|
201
|
-
getCompletions(
|
|
218
|
+
getCompletions(srcPath: string, position: Position): CompletionItem[];
|
|
202
219
|
/**
|
|
203
220
|
* Goes through each file and builds a list of workspace symbols for the program. Used by LanguageServer's onWorkspaceSymbol functionality
|
|
204
221
|
*/
|
|
205
|
-
getWorkspaceSymbols():
|
|
222
|
+
getWorkspaceSymbols(): SymbolInformation[];
|
|
206
223
|
/**
|
|
207
224
|
* Given a position in a file, if the position is sitting on some type of identifier,
|
|
208
225
|
* go to the definition of that identifier (where this thing was first defined)
|
|
226
|
+
* @param srcPath The absolute path to the source file on disk
|
|
209
227
|
*/
|
|
210
|
-
getDefinition(
|
|
211
|
-
|
|
228
|
+
getDefinition(srcPath: string, position: Position): Location[];
|
|
229
|
+
/**
|
|
230
|
+
* @param srcPath The absolute path to the source file on disk
|
|
231
|
+
*/
|
|
232
|
+
getHover(srcPath: string, position: Position): Promise<import("vscode-languageserver-types").Hover>;
|
|
212
233
|
/**
|
|
213
234
|
* Compute code actions for the given file and range
|
|
235
|
+
* @param srcPath The absolute path to the source file on disk
|
|
236
|
+
*/
|
|
237
|
+
getCodeActions(srcPath: string, range: Range): CodeAction[];
|
|
238
|
+
/**
|
|
239
|
+
* Get semantic tokens for the specified file
|
|
214
240
|
*/
|
|
215
|
-
|
|
241
|
+
getSemanticTokens(srcPath: string): SemanticToken[];
|
|
216
242
|
getSignatureHelp(filepath: string, position: Position): SignatureInfoObj[];
|
|
217
243
|
private getPartialStatementInfo;
|
|
218
244
|
private getPartialItemCounts;
|
|
219
|
-
|
|
245
|
+
/**
|
|
246
|
+
* @param srcPath The absolute path to the source file on disk
|
|
247
|
+
*/
|
|
248
|
+
getReferences(srcPath: string, position: Position): Location[] | Promise<Location[]>;
|
|
220
249
|
/**
|
|
221
250
|
* Get a list of all script imports, relative to the specified pkgPath
|
|
222
251
|
* @param sourcePkgPath - the pkgPath of the source that wants to resolve script imports.
|
|
@@ -225,9 +254,10 @@ export declare class Program {
|
|
|
225
254
|
/**
|
|
226
255
|
* Transpile a single file and get the result as a string.
|
|
227
256
|
* This does not write anything to the file system.
|
|
257
|
+
* @param srcPath The absolute path to the source file on disk
|
|
228
258
|
*/
|
|
229
|
-
getTranspiledFileContents(
|
|
230
|
-
|
|
259
|
+
getTranspiledFileContents(srcPath: string): {
|
|
260
|
+
srcPath: string;
|
|
231
261
|
pkgPath: string;
|
|
232
262
|
code: string;
|
|
233
263
|
map: import("source-map").SourceMapGenerator;
|
|
@@ -236,15 +266,15 @@ export declare class Program {
|
|
|
236
266
|
/**
|
|
237
267
|
* Find a list of files in the program that have a function with the given name (case INsensitive)
|
|
238
268
|
*/
|
|
239
|
-
findFilesForFunction(functionName: string):
|
|
269
|
+
findFilesForFunction(functionName: string): BscFile[];
|
|
240
270
|
/**
|
|
241
271
|
* Find a list of files in the program that have a function with the given name (case INsensitive)
|
|
242
272
|
*/
|
|
243
|
-
findFilesForClass(className: string):
|
|
273
|
+
findFilesForClass(className: string): BscFile[];
|
|
244
274
|
/**
|
|
245
275
|
* Get a map of the manifest information
|
|
246
276
|
*/
|
|
247
|
-
getManifest(): Map<string,
|
|
277
|
+
getManifest(): Map<string, ManifestValue>;
|
|
248
278
|
private _manifest;
|
|
249
279
|
dispose(): void;
|
|
250
280
|
}
|