brighterscript 0.66.0-alpha.5 → 0.66.0-alpha.7
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 +64 -10
- package/README.md +16 -0
- 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/BsConfig.d.ts +15 -1
- package/dist/CommentFlagProcessor.d.ts +4 -3
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +19 -4
- package/dist/DiagnosticMessages.js +45 -5
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/LanguageServer.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 +101 -37
- package/dist/Program.js +492 -274
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +10 -4
- package/dist/ProgramBuilder.js +44 -54
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +27 -13
- package/dist/Scope.js +44 -26
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.d.ts +5 -0
- package/dist/SymbolTable.js +15 -2
- package/dist/SymbolTable.js.map +1 -1
- package/dist/XmlScope.d.ts +7 -4
- package/dist/XmlScope.js +47 -8
- 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 +9 -1
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +30 -8
- package/dist/astUtils/reflection.js +64 -14
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +85 -4
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +3 -3
- package/dist/astUtils/visitors.spec.js +7 -7
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +10 -2
- package/dist/bscPlugin/BscPlugin.js +24 -4
- package/dist/bscPlugin/BscPlugin.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 +11 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +112 -58
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +151 -6
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -1
- 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 +1 -7
- package/dist/bscPlugin/hover/HoverProcessor.js +2 -8
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +55 -0
- 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} +25 -4
- 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.js +2 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +12 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +137 -19
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +671 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/XmlFileValidator.js +2 -2
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/deferred.d.ts +2 -2
- package/dist/deferred.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +1 -0
- package/dist/diagnosticUtils.js +4 -3
- 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 +40 -40
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +42 -15
- package/dist/files/BrsFile.js +120 -78
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +266 -167
- 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 +55 -17
- package/dist/files/XmlFile.js +88 -47
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +64 -57
- 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 +2 -6
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +326 -85
- package/dist/interfaces.js +4 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.js +1 -1
- package/dist/lexer/TokenKind.js +0 -1
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +2 -2
- package/dist/parser/AstNode.js +1 -1
- 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 +1 -1
- package/dist/parser/Expression.js +35 -19
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.js +12 -1
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +18 -2
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +2 -2
- 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 +1 -1
- package/dist/parser/Statement.js +1 -1
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +10 -10
- 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 +64 -36
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +34 -34
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/statement/ConstStatement.spec.js +17 -17
- 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 +26 -26
- 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 +18 -10
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +10 -10
- package/dist/parser/tests/statement/PrintStatement.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 +111 -149
- package/dist/roku-types/index.d.ts +27 -13
- package/dist/types/ArrayType.d.ts +2 -1
- package/dist/types/ArrayType.js +6 -2
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +11 -1
- 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 +2 -1
- package/dist/types/BaseFunctionType.js +1 -1
- package/dist/types/BaseFunctionType.js.map +1 -1
- package/dist/types/BooleanType.d.ts +2 -1
- package/dist/types/BooleanType.js +3 -2
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BscType.d.ts +3 -3
- package/dist/types/BscType.js +26 -12
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BscTypeKind.d.ts +2 -0
- package/dist/types/BscTypeKind.js +2 -0
- package/dist/types/BscTypeKind.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.d.ts +8 -0
- package/dist/types/BuiltInInterfaceAdder.js +88 -23
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -1
- package/dist/types/ClassType.d.ts +2 -1
- package/dist/types/ClassType.js +2 -2
- package/dist/types/ClassType.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 +4 -2
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DynamicType.d.ts +2 -2
- package/dist/types/DynamicType.js +1 -1
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/EnumType.d.ts +3 -2
- package/dist/types/EnumType.js +3 -3
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/FloatType.d.ts +2 -1
- package/dist/types/FloatType.js +4 -2
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FunctionType.d.ts +2 -1
- package/dist/types/FunctionType.js +2 -2
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/IntegerType.d.ts +2 -1
- package/dist/types/IntegerType.js +4 -2
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +2 -1
- package/dist/types/InterfaceType.js +3 -7
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.js +25 -2
- package/dist/types/InterfaceType.spec.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +2 -1
- package/dist/types/LongIntegerType.js +4 -2
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/ObjectType.d.ts +2 -2
- package/dist/types/ObjectType.js +1 -1
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +2 -0
- package/dist/types/ReferenceType.js +45 -1
- package/dist/types/ReferenceType.js.map +1 -1
- package/dist/types/StringType.d.ts +2 -1
- package/dist/types/StringType.js +4 -4
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +7 -1
- package/dist/types/TypedFunctionType.js +47 -17
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/TypedFunctionType.spec.js +99 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -1
- 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 +2 -2
- package/dist/types/UnionType.js +10 -3
- package/dist/types/UnionType.js.map +1 -1
- package/dist/types/UnionType.spec.js +3 -2
- package/dist/types/UnionType.spec.js.map +1 -1
- package/dist/types/VoidType.d.ts +2 -1
- package/dist/types/VoidType.js +2 -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 -1
- package/dist/types/helpers.js +31 -3
- package/dist/types/helpers.js.map +1 -1
- package/dist/util.d.ts +26 -6
- package/dist/util.js +181 -52
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +1 -1
- 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/astUtils/{AstEditor.spec.d.ts → Editor.spec.d.ts} +0 -0
- /package/dist/bscPlugin/{transpile/BrsFilePreTranspileProcessor.spec.d.ts → serialize/BslibInjector.spec.d.ts} +0 -0
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { Range, Diagnostic, CodeAction, SemanticTokenTypes, SemanticTokenModifiers, Position, CompletionItem } from 'vscode-languageserver';
|
|
2
3
|
import type { Scope } from './Scope';
|
|
3
4
|
import type { BrsFile } from './files/BrsFile';
|
|
@@ -10,22 +11,24 @@ import type { ProgramBuilder } from './ProgramBuilder';
|
|
|
10
11
|
import type { FunctionStatement } from './parser/Statement';
|
|
11
12
|
import type { AstNode, Expression } from './parser/AstNode';
|
|
12
13
|
import type { TranspileState } from './parser/TranspileState';
|
|
13
|
-
import type {
|
|
14
|
+
import type { SourceNode } from 'source-map';
|
|
14
15
|
import type { BscType } from './types/BscType';
|
|
15
|
-
import type {
|
|
16
|
+
import type { Editor } from './astUtils/Editor';
|
|
16
17
|
import type { Token } from './lexer/Token';
|
|
18
|
+
import type { File } from './files/File';
|
|
19
|
+
import type { FileFactory } from './files/Factory';
|
|
20
|
+
import type { LazyFileData } from './files/LazyFileData';
|
|
17
21
|
import type { SymbolTypeFlag } from './SymbolTable';
|
|
18
22
|
import type { CallExpression } from './parser/Expression';
|
|
19
23
|
export interface BsDiagnostic extends Diagnostic {
|
|
20
|
-
file:
|
|
24
|
+
file: File;
|
|
21
25
|
/**
|
|
22
26
|
* A generic data container where additional details of the diagnostic can be stored. These are stripped out before being sent to a languageclient, and not printed to the console.
|
|
23
27
|
*/
|
|
24
28
|
data?: any;
|
|
25
29
|
}
|
|
26
|
-
export declare type BscFile = BrsFile | XmlFile;
|
|
27
30
|
export interface Callable {
|
|
28
|
-
file:
|
|
31
|
+
file: File;
|
|
29
32
|
name: string;
|
|
30
33
|
/**
|
|
31
34
|
* Is the callable declared as "sub". If falsey, assumed declared as "function"
|
|
@@ -103,12 +106,12 @@ export interface FileObj {
|
|
|
103
106
|
*/
|
|
104
107
|
export interface FileReference {
|
|
105
108
|
/**
|
|
106
|
-
* The
|
|
109
|
+
* The destPath for the referenced file.
|
|
107
110
|
*/
|
|
108
|
-
|
|
111
|
+
destPath: string;
|
|
109
112
|
text: string;
|
|
110
113
|
/**
|
|
111
|
-
* The file that is doing the import. Note this is NOT the file the
|
|
114
|
+
* The file that is doing the import. Note this is NOT the file the destPath points to.
|
|
112
115
|
*/
|
|
113
116
|
sourceFile: XmlFile | BrsFile;
|
|
114
117
|
/**
|
|
@@ -119,14 +122,6 @@ export interface FileReference {
|
|
|
119
122
|
*/
|
|
120
123
|
filePathRange?: Range;
|
|
121
124
|
}
|
|
122
|
-
export interface File {
|
|
123
|
-
/**
|
|
124
|
-
* The absolute path to the file, relative to the pkg
|
|
125
|
-
*/
|
|
126
|
-
pkgPath: string;
|
|
127
|
-
srcPath: string;
|
|
128
|
-
getDiagnostics(): BsDiagnostic[];
|
|
129
|
-
}
|
|
130
125
|
export interface VariableDeclaration {
|
|
131
126
|
name: string;
|
|
132
127
|
getType: () => BscType;
|
|
@@ -160,7 +155,7 @@ export interface CallableContainer {
|
|
|
160
155
|
}
|
|
161
156
|
export declare type CallableContainerMap = Map<string, CallableContainer[]>;
|
|
162
157
|
export interface CommentFlag {
|
|
163
|
-
file:
|
|
158
|
+
file: File;
|
|
164
159
|
/**
|
|
165
160
|
* The location of the ignore comment.
|
|
166
161
|
*/
|
|
@@ -174,18 +169,42 @@ export interface CommentFlag {
|
|
|
174
169
|
export declare type CompilerPluginFactory = () => CompilerPlugin;
|
|
175
170
|
export interface CompilerPlugin {
|
|
176
171
|
name: string;
|
|
172
|
+
/**
|
|
173
|
+
* Called before a new program is created
|
|
174
|
+
*/
|
|
177
175
|
beforeProgramCreate?: PluginHandler<BeforeProgramCreateEvent>;
|
|
176
|
+
/**
|
|
177
|
+
* Called after a new program is created
|
|
178
|
+
*/
|
|
178
179
|
afterProgramCreate?: PluginHandler<AfterProgramCreateEvent>;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Called before the program gets prepared for building
|
|
182
|
+
*/
|
|
183
|
+
beforePrepareProgram?: PluginHandler<BeforePrepareProgramEvent>;
|
|
184
|
+
/**
|
|
185
|
+
* Called when the program gets prepared for building
|
|
186
|
+
*/
|
|
187
|
+
prepareProgram?: PluginHandler<PrepareProgramEvent>;
|
|
188
|
+
/**
|
|
189
|
+
* Called after the program gets prepared for building
|
|
190
|
+
*/
|
|
191
|
+
afterPrepareProgram?: PluginHandler<AfterPrepareProgramEvent>;
|
|
192
|
+
/**
|
|
193
|
+
* Called before the entire program is validated
|
|
194
|
+
*/
|
|
183
195
|
beforeProgramValidate?: PluginHandler<BeforeProgramValidateEvent>;
|
|
196
|
+
/**
|
|
197
|
+
* Called before the entire program is validated
|
|
198
|
+
*/
|
|
199
|
+
onProgramValidate?: PluginHandler<OnProgramValidateEvent>;
|
|
200
|
+
/**
|
|
201
|
+
* Called after the program has been validated
|
|
202
|
+
*/
|
|
184
203
|
afterProgramValidate?: PluginHandler<AfterProgramValidateEvent>;
|
|
185
|
-
|
|
186
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Called right before the program is disposed/destroyed
|
|
206
|
+
*/
|
|
187
207
|
beforeProgramDispose?: PluginHandler<BeforeProgramDisposeEvent>;
|
|
188
|
-
onGetCodeActions?: PluginHandler<OnGetCodeActionsEvent>;
|
|
189
208
|
/**
|
|
190
209
|
* Emitted before the program starts collecting completions
|
|
191
210
|
*/
|
|
@@ -210,15 +229,49 @@ export interface CompilerPlugin {
|
|
|
210
229
|
* Called after the `provideHover` hook. Use this if you want to intercept or sanitize the hover data (even from other plugins) before it gets sent to the client.
|
|
211
230
|
*/
|
|
212
231
|
afterProvideHover?: PluginHandler<AfterProvideHoverEvent>;
|
|
213
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Called after a scope was created
|
|
234
|
+
*/
|
|
214
235
|
afterScopeCreate?: PluginHandler<AfterScopeCreateEvent>;
|
|
215
236
|
beforeScopeDispose?: PluginHandler<BeforeScopeDisposeEvent>;
|
|
237
|
+
onScopeDispose?: PluginHandler<OnScopeDisposeEvent>;
|
|
216
238
|
afterScopeDispose?: PluginHandler<AfterScopeDisposeEvent>;
|
|
217
239
|
beforeScopeValidate?: PluginHandler<BeforeScopeValidateEvent>;
|
|
218
240
|
onScopeValidate?: PluginHandler<OnScopeValidateEvent>;
|
|
219
241
|
afterScopeValidate?: PluginHandler<BeforeScopeValidateEvent>;
|
|
220
|
-
|
|
221
|
-
|
|
242
|
+
onGetCodeActions?: PluginHandler<OnGetCodeActionsEvent>;
|
|
243
|
+
onGetSemanticTokens?: PluginHandler<OnGetSemanticTokensEvent>;
|
|
244
|
+
/**
|
|
245
|
+
* Called before plugins are asked to provide files to the program. (excludes virtual files produced by `provideFile` events).
|
|
246
|
+
* Call the `setFileData()` method to override the file contents.
|
|
247
|
+
*/
|
|
248
|
+
beforeProvideFile?: PluginHandler<BeforeProvideFileEvent>;
|
|
249
|
+
/**
|
|
250
|
+
* Give plugins the opportunity to handle processing a file. (excludes virtual files produced by `provideFile` events)
|
|
251
|
+
*/
|
|
252
|
+
provideFile?: PluginHandler<ProvideFileEvent>;
|
|
253
|
+
/**
|
|
254
|
+
* Called after a file was added to the program. (excludes virtual files produced by `provideFile` events)
|
|
255
|
+
*/
|
|
256
|
+
afterProvideFile?: PluginHandler<AfterProvideFileEvent>;
|
|
257
|
+
/**
|
|
258
|
+
* Called before a file is added to the program.
|
|
259
|
+
* Includes physical files as well as any virtual files produced by `provideFile` events
|
|
260
|
+
*/
|
|
261
|
+
beforeFileAdd?: PluginHandler<BeforeFileAddEvent>;
|
|
262
|
+
/**
|
|
263
|
+
* Called after a file has been added to the program.
|
|
264
|
+
* Includes physical files as well as any virtual files produced by `provideFile` events
|
|
265
|
+
*/
|
|
266
|
+
afterFileAdd?: PluginHandler<AfterFileAddEvent>;
|
|
267
|
+
/**
|
|
268
|
+
* Called before a file is removed from the program. This includes physical and virtual files
|
|
269
|
+
*/
|
|
270
|
+
beforeFileRemove?: PluginHandler<BeforeFileRemoveEvent>;
|
|
271
|
+
/**
|
|
272
|
+
* Called after a file has been removed from the program. This includes physical and virtual files
|
|
273
|
+
*/
|
|
274
|
+
afterFileRemove?: PluginHandler<AfterFileRemoveEvent>;
|
|
222
275
|
/**
|
|
223
276
|
* Called before each file is validated
|
|
224
277
|
*/
|
|
@@ -231,61 +284,111 @@ export interface CompilerPlugin {
|
|
|
231
284
|
* Called after each file is validated
|
|
232
285
|
*/
|
|
233
286
|
afterFileValidate?: PluginHandler<AfterFileValidateEvent>;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
287
|
+
/**
|
|
288
|
+
* Called right before the program builds (i.e. generates the code and puts it in the stagingDir
|
|
289
|
+
*/
|
|
290
|
+
beforeBuildProgram?: PluginHandler<BeforeBuildProgramEvent>;
|
|
291
|
+
/**
|
|
292
|
+
* Called right after the program builds (i.e. generates the code and puts it in the stagingDir
|
|
293
|
+
*/
|
|
294
|
+
afterBuildProgram?: PluginHandler<AfterBuildProgramEvent>;
|
|
295
|
+
/**
|
|
296
|
+
* Before preparing the file for building
|
|
297
|
+
*/
|
|
298
|
+
beforePrepareFile?: PluginHandler<BeforePrepareFileEvent>;
|
|
299
|
+
/**
|
|
300
|
+
* Prepare the file for building
|
|
301
|
+
*/
|
|
302
|
+
prepareFile?: PluginHandler<PrepareFileEvent>;
|
|
303
|
+
/**
|
|
304
|
+
* After preparing the file for building
|
|
305
|
+
*/
|
|
306
|
+
afterPrepareFile?: PluginHandler<AfterPrepareFileEvent>;
|
|
307
|
+
/**
|
|
308
|
+
* Before the program turns all file objects into their final buffers
|
|
309
|
+
*/
|
|
310
|
+
beforeSerializeProgram?: PluginHandler<BeforeSerializeProgramEvent>;
|
|
311
|
+
/**
|
|
312
|
+
* Emitted right at the start of the program turning all file objects into their final buffers
|
|
313
|
+
*/
|
|
314
|
+
onSerializeProgram?: PluginHandler<OnSerializeProgramEvent>;
|
|
315
|
+
/**
|
|
316
|
+
* After the program turns all file objects into their final buffers
|
|
317
|
+
*/
|
|
318
|
+
afterSerializeProgram?: PluginHandler<AfterSerializeProgramEvent>;
|
|
319
|
+
/**
|
|
320
|
+
* Before turning the file into its final contents
|
|
321
|
+
*/
|
|
322
|
+
beforeSerializeFile?: PluginHandler<BeforeSerializeFileEvent>;
|
|
323
|
+
/**
|
|
324
|
+
* Turn the file into its final contents (i.e. transpile a bs file, compress a jpeg, etc)
|
|
325
|
+
*/
|
|
326
|
+
serializeFile?: PluginHandler<SerializeFileEvent>;
|
|
327
|
+
/**
|
|
328
|
+
* After turning the file into its final contents
|
|
329
|
+
*/
|
|
330
|
+
afterSerializeFile?: PluginHandler<AfterSerializeFileEvent>;
|
|
331
|
+
/**
|
|
332
|
+
* Called before any files are written
|
|
333
|
+
*/
|
|
334
|
+
beforeWriteProgram?: PluginHandler<BeforeWriteProgramEvent>;
|
|
335
|
+
/**
|
|
336
|
+
* Called after all files are written
|
|
337
|
+
*/
|
|
338
|
+
afterWriteProgram?: PluginHandler<AfterWriteProgramEvent>;
|
|
339
|
+
/**
|
|
340
|
+
* Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
|
|
341
|
+
*/
|
|
342
|
+
beforeWriteFile?: PluginHandler<BeforeWriteFileEvent>;
|
|
343
|
+
/**
|
|
344
|
+
* Called when a file should be persisted (usually writing to storage). These are raw files that contain the final output. One `File` may produce several of these.
|
|
345
|
+
* When a plugin has handled a file, it should be pushed to the `handledFiles` set so future plugins don't write the file multiple times
|
|
346
|
+
*/
|
|
347
|
+
writeFile?: PluginHandler<WriteFileEvent>;
|
|
348
|
+
/**
|
|
349
|
+
* Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
|
|
350
|
+
*/
|
|
351
|
+
afterWriteFile?: PluginHandler<AfterWriteFileEvent>;
|
|
238
352
|
}
|
|
239
353
|
export declare type PluginHandler<T, R = void> = (event: T) => R;
|
|
240
|
-
export interface
|
|
241
|
-
builder: ProgramBuilder;
|
|
242
|
-
}
|
|
243
|
-
export interface AfterProgramCreateEvent {
|
|
244
|
-
builder: ProgramBuilder;
|
|
354
|
+
export interface OnGetCodeActionsEvent<TFile extends File = File> {
|
|
245
355
|
program: Program;
|
|
356
|
+
file: TFile;
|
|
357
|
+
range: Range;
|
|
358
|
+
scopes: Scope[];
|
|
359
|
+
diagnostics: BsDiagnostic[];
|
|
360
|
+
codeActions: CodeAction[];
|
|
246
361
|
}
|
|
247
|
-
export interface
|
|
362
|
+
export interface BeforeProgramCreateEvent {
|
|
248
363
|
builder: ProgramBuilder;
|
|
249
|
-
program: Program;
|
|
250
|
-
files: FileObj[];
|
|
251
364
|
}
|
|
252
|
-
export
|
|
253
|
-
export interface BeforePublishEvent {
|
|
365
|
+
export interface AfterProgramCreateEvent {
|
|
254
366
|
builder: ProgramBuilder;
|
|
255
367
|
program: Program;
|
|
256
|
-
files: FileObj[];
|
|
257
368
|
}
|
|
258
|
-
export declare type AfterPublishEvent = BeforePublishEvent;
|
|
259
369
|
export interface BeforeProgramValidateEvent {
|
|
260
370
|
program: Program;
|
|
261
371
|
}
|
|
372
|
+
export declare type OnProgramValidateEvent = BeforeProgramValidateEvent;
|
|
262
373
|
export declare type AfterProgramValidateEvent = BeforeProgramValidateEvent;
|
|
263
|
-
export interface
|
|
264
|
-
program: Program;
|
|
265
|
-
entries: TranspileEntry[];
|
|
266
|
-
editor: AstEditor;
|
|
267
|
-
}
|
|
268
|
-
export declare type AfterProgramTranspileEvent = BeforeProgramTranspileEvent;
|
|
269
|
-
export interface OnGetCodeActionsEvent {
|
|
270
|
-
program: Program;
|
|
271
|
-
file: BscFile;
|
|
272
|
-
range: Range;
|
|
273
|
-
scopes: Scope[];
|
|
274
|
-
diagnostics: BsDiagnostic[];
|
|
275
|
-
codeActions: CodeAction[];
|
|
276
|
-
}
|
|
277
|
-
export interface ProvideCompletionsEvent<TFile extends BscFile = BscFile> {
|
|
374
|
+
export interface ProvideCompletionsEvent<TFile extends File = File> {
|
|
278
375
|
program: Program;
|
|
279
376
|
file: TFile;
|
|
280
377
|
scopes: Scope[];
|
|
281
378
|
position: Position;
|
|
282
379
|
completions: CompletionItem[];
|
|
283
380
|
}
|
|
284
|
-
export declare type BeforeProvideCompletionsEvent<TFile extends
|
|
285
|
-
export declare type AfterProvideCompletionsEvent<TFile extends
|
|
381
|
+
export declare type BeforeProvideCompletionsEvent<TFile extends File = File> = ProvideCompletionsEvent<TFile>;
|
|
382
|
+
export declare type AfterProvideCompletionsEvent<TFile extends File = File> = ProvideCompletionsEvent<TFile>;
|
|
383
|
+
export interface BeforeBuildProgramEvent {
|
|
384
|
+
program: Program;
|
|
385
|
+
files: File[];
|
|
386
|
+
editor: Editor;
|
|
387
|
+
}
|
|
388
|
+
export declare type AfterBuildProgramEvent = BeforeBuildProgramEvent;
|
|
286
389
|
export interface ProvideHoverEvent {
|
|
287
390
|
program: Program;
|
|
288
|
-
file:
|
|
391
|
+
file: File;
|
|
289
392
|
position: Position;
|
|
290
393
|
scopes: Scope[];
|
|
291
394
|
hovers: Hover[];
|
|
@@ -315,6 +418,10 @@ export interface BeforeScopeDisposeEvent {
|
|
|
315
418
|
program: Program;
|
|
316
419
|
scope: Scope;
|
|
317
420
|
}
|
|
421
|
+
export interface OnScopeDisposeEvent {
|
|
422
|
+
program: Program;
|
|
423
|
+
scope: Scope;
|
|
424
|
+
}
|
|
318
425
|
export interface AfterScopeDisposeEvent {
|
|
319
426
|
program: Program;
|
|
320
427
|
scope: Scope;
|
|
@@ -329,11 +436,16 @@ export interface BeforeFileParseEvent {
|
|
|
329
436
|
srcPath: string;
|
|
330
437
|
source: string;
|
|
331
438
|
}
|
|
439
|
+
export interface OnFileParseEvent {
|
|
440
|
+
program: Program;
|
|
441
|
+
srcPath: string;
|
|
442
|
+
source: string;
|
|
443
|
+
}
|
|
332
444
|
export interface AfterFileParseEvent {
|
|
333
445
|
program: Program;
|
|
334
|
-
file:
|
|
446
|
+
file: File;
|
|
335
447
|
}
|
|
336
|
-
export interface OnGetSemanticTokensEvent<T extends
|
|
448
|
+
export interface OnGetSemanticTokensEvent<T extends File = File> {
|
|
337
449
|
/**
|
|
338
450
|
* The program this file is from
|
|
339
451
|
*/
|
|
@@ -352,32 +464,24 @@ export interface OnGetSemanticTokensEvent<T extends BscFile = BscFile> {
|
|
|
352
464
|
semanticTokens: SemanticToken[];
|
|
353
465
|
}
|
|
354
466
|
export declare type BeforeFileValidateEvent = OnFileValidateEvent;
|
|
355
|
-
export interface OnFileValidateEvent<T extends
|
|
467
|
+
export interface OnFileValidateEvent<T extends File = File> {
|
|
356
468
|
program: Program;
|
|
357
469
|
file: T;
|
|
358
470
|
}
|
|
359
471
|
export declare type AfterFileValidateEvent = OnFileValidateEvent;
|
|
472
|
+
export interface OnFileValidateEvent<T extends File = File> {
|
|
473
|
+
program: Program;
|
|
474
|
+
file: T;
|
|
475
|
+
}
|
|
360
476
|
export interface TranspileEntry {
|
|
361
|
-
file:
|
|
477
|
+
file: File;
|
|
362
478
|
outputPath: string;
|
|
363
479
|
}
|
|
364
480
|
export interface OnScopeValidateEvent {
|
|
365
481
|
program: Program;
|
|
366
482
|
scope: Scope;
|
|
367
483
|
}
|
|
368
|
-
export
|
|
369
|
-
export interface BeforeFileTranspileEvent<TFile extends BscFile = BscFile> {
|
|
370
|
-
program: Program;
|
|
371
|
-
file: TFile;
|
|
372
|
-
outputPath: string;
|
|
373
|
-
/**
|
|
374
|
-
* An editor that can be used to transform properties or arrays. Once the `afterFileTranspile` event has fired, these changes will be reverted,
|
|
375
|
-
* restoring the objects to their prior state. This is useful for changing code right before a file gets transpiled, but when you don't want
|
|
376
|
-
* the changes to persist in the in-memory file.
|
|
377
|
-
*/
|
|
378
|
-
editor: Editor;
|
|
379
|
-
}
|
|
380
|
-
export interface AfterFileTranspileEvent<TFile extends BscFile = BscFile> {
|
|
484
|
+
export interface AfterFileTranspileEvent<TFile extends File = File> {
|
|
381
485
|
/**
|
|
382
486
|
* The program this event was triggered for
|
|
383
487
|
*/
|
|
@@ -391,21 +495,145 @@ export interface AfterFileTranspileEvent<TFile extends BscFile = BscFile> {
|
|
|
391
495
|
/**
|
|
392
496
|
* The sourceMaps for the generated code (if emitting source maps is enabled)
|
|
393
497
|
*/
|
|
394
|
-
map?:
|
|
498
|
+
map?: string;
|
|
395
499
|
/**
|
|
396
500
|
* The generated type definition file contents (if emitting type definitions are enabled)
|
|
397
501
|
*/
|
|
398
502
|
typedef?: string;
|
|
503
|
+
}
|
|
504
|
+
export declare type BeforeProvideFileEvent<TFile extends File = File> = ProvideFileEvent<TFile>;
|
|
505
|
+
export interface ProvideFileEvent<TFile extends File = File> {
|
|
506
|
+
/**
|
|
507
|
+
* The lower-case file extension for the srcPath. (i.e. ".brs", ".xml")
|
|
508
|
+
*/
|
|
509
|
+
srcExtension: string;
|
|
510
|
+
/**
|
|
511
|
+
* The srcPath for the file. (i.e. `/user/bob/projects/VideoApp/source/main.bs`)
|
|
512
|
+
*/
|
|
513
|
+
srcPath: string;
|
|
514
|
+
/**
|
|
515
|
+
* The destPath for the file. (i.e. for `/user/bob/projects/VideoApp/source/main.bs`, destPath would be `source/main.bs`)
|
|
516
|
+
*/
|
|
517
|
+
destPath: string;
|
|
399
518
|
/**
|
|
400
|
-
*
|
|
401
|
-
* restoring the objects to their prior state. This is useful for changing code right before a file gets transpiled, but when you don't want
|
|
402
|
-
* the changes to persist in the in-memory file.
|
|
519
|
+
* A lazy-loading container for this file's data. Call `.get()` to lazy load the data, and `.set()` to override file contents
|
|
403
520
|
*/
|
|
521
|
+
data: LazyFileData;
|
|
522
|
+
/**
|
|
523
|
+
* An array of files that should be added to the program as a result of this event
|
|
524
|
+
*/
|
|
525
|
+
files: TFile[];
|
|
526
|
+
/**
|
|
527
|
+
* The program for this event
|
|
528
|
+
*/
|
|
529
|
+
program: Program;
|
|
530
|
+
/**
|
|
531
|
+
* A factory used to create new instances of the BrighterScript built-in file types. This mitigates the issue
|
|
532
|
+
* of a plugin's version of a File not being the same as the LanguageServer or CLI version of BrighterScript
|
|
533
|
+
* (due to npm installing multiple versions of brighterscript)
|
|
534
|
+
*/
|
|
535
|
+
fileFactory: FileFactory;
|
|
536
|
+
}
|
|
537
|
+
export declare type AfterProvideFileEvent<TFile extends File = File> = ProvideFileEvent<TFile>;
|
|
538
|
+
export interface BeforeFileAddEvent<TFile extends File = File> {
|
|
539
|
+
file: TFile;
|
|
540
|
+
program: Program;
|
|
541
|
+
}
|
|
542
|
+
export declare type AfterFileAddEvent<TFile extends File = File> = BeforeFileAddEvent<TFile>;
|
|
543
|
+
export interface BeforeFileRemoveEvent<TFile extends File = File> {
|
|
544
|
+
file: TFile;
|
|
545
|
+
program: Program;
|
|
546
|
+
}
|
|
547
|
+
export declare type AfterFileRemoveEvent<TFile extends File = File> = BeforeFileRemoveEvent<TFile>;
|
|
548
|
+
export declare type BeforePrepareProgramEvent = PrepareProgramEvent;
|
|
549
|
+
/**
|
|
550
|
+
* Event for when the program prepares itself for building
|
|
551
|
+
*/
|
|
552
|
+
export interface PrepareProgramEvent {
|
|
553
|
+
program: Program;
|
|
554
|
+
editor: Editor;
|
|
555
|
+
}
|
|
556
|
+
export declare type AfterPrepareProgramEvent = PrepareProgramEvent;
|
|
557
|
+
export declare type BeforePrepareFileEvent<TFile extends File = File> = PrepareFileEvent<TFile>;
|
|
558
|
+
/**
|
|
559
|
+
* Prepare the file for building
|
|
560
|
+
*/
|
|
561
|
+
export interface PrepareFileEvent<TFile extends File = File> {
|
|
562
|
+
program: Program;
|
|
563
|
+
file: TFile;
|
|
404
564
|
editor: Editor;
|
|
405
565
|
}
|
|
566
|
+
export declare type OnPrepareFileEvent<TFile extends File = File> = PrepareFileEvent<TFile>;
|
|
567
|
+
export declare type AfterPrepareFileEvent<TFile extends File = File> = PrepareFileEvent<TFile>;
|
|
568
|
+
/**
|
|
569
|
+
* A container that holds the code, map, and typedef for serialized code files.
|
|
570
|
+
*/
|
|
571
|
+
export interface SerializedCodeFile {
|
|
572
|
+
code?: string;
|
|
573
|
+
map?: string;
|
|
574
|
+
typedef?: string;
|
|
575
|
+
}
|
|
576
|
+
export interface BeforeSerializeProgramEvent {
|
|
577
|
+
program: Program;
|
|
578
|
+
files: File[];
|
|
579
|
+
result: Map<File, SerializedFile[]>;
|
|
580
|
+
}
|
|
581
|
+
export declare type OnSerializeProgramEvent = BeforeSerializeProgramEvent;
|
|
582
|
+
export declare type AfterSerializeProgramEvent = BeforeSerializeProgramEvent;
|
|
583
|
+
/**
|
|
584
|
+
* During the `SerializeFile` events, this is how plugins will contribute file data for a specific file
|
|
585
|
+
*/
|
|
586
|
+
export interface SerializedFile {
|
|
587
|
+
/**
|
|
588
|
+
* The raw data for this file (i.e. a binary buffer for a .jpeg file, or the transpiled code for a .bs file)
|
|
589
|
+
*/
|
|
590
|
+
data: Buffer;
|
|
591
|
+
/**
|
|
592
|
+
* The pkgPath for this chunk of data.
|
|
593
|
+
*/
|
|
594
|
+
pkgPath: string;
|
|
595
|
+
}
|
|
596
|
+
export declare type BeforeSerializeFileEvent<TFile extends File = File> = SerializeFileEvent<TFile>;
|
|
597
|
+
export interface SerializeFileEvent<TFile extends File = File> {
|
|
598
|
+
program: Program;
|
|
599
|
+
file: TFile;
|
|
600
|
+
/**
|
|
601
|
+
* The list of all files created across all the `SerializeFile` events.
|
|
602
|
+
* The key is the pkgPath of the file, and the
|
|
603
|
+
*/
|
|
604
|
+
result: Map<TFile, SerializedFile[]>;
|
|
605
|
+
}
|
|
606
|
+
export declare type AfterSerializeFileEvent<TFile extends File = File> = SerializeFileEvent<TFile>;
|
|
607
|
+
export interface BeforeWriteProgramEvent {
|
|
608
|
+
program: Program;
|
|
609
|
+
stagingDir: string;
|
|
610
|
+
files: Map<File, SerializedFile[]>;
|
|
611
|
+
}
|
|
612
|
+
export declare type AfterWriteProgramEvent = BeforeWriteProgramEvent;
|
|
613
|
+
export declare type BeforeWriteFileEvent = WriteFileEvent;
|
|
614
|
+
export interface WriteFileEvent {
|
|
615
|
+
program: Program;
|
|
616
|
+
file: SerializedFile;
|
|
617
|
+
/**
|
|
618
|
+
* The full path to where the file was (or will be) written to.
|
|
619
|
+
*/
|
|
620
|
+
outputPath: string;
|
|
621
|
+
/**
|
|
622
|
+
* A set of all files that have been properly written. Plugins should add any handled files to this list so future plugins don't write then again
|
|
623
|
+
*/
|
|
624
|
+
processedFiles: Set<SerializedFile>;
|
|
625
|
+
}
|
|
626
|
+
export declare type AfterWriteFileEvent = BeforeWriteFileEvent;
|
|
627
|
+
export interface TranspileObj {
|
|
628
|
+
file: File;
|
|
629
|
+
/**
|
|
630
|
+
* The absolute path to where the file should be written during build. (i.e. somewhere inside the stagingDir)
|
|
631
|
+
*/
|
|
632
|
+
outputPath: string;
|
|
633
|
+
}
|
|
406
634
|
export interface BeforeFileDisposeEvent {
|
|
407
635
|
program: Program;
|
|
408
|
-
file:
|
|
636
|
+
file: File;
|
|
409
637
|
}
|
|
410
638
|
export declare type AfterFileDisposeEvent = BeforeFileDisposeEvent;
|
|
411
639
|
export interface BeforeProgramDisposeEvent {
|
|
@@ -423,7 +651,7 @@ export interface TypedefProvider {
|
|
|
423
651
|
getTypedef(state: TranspileState): Array<SourceNode | string>;
|
|
424
652
|
}
|
|
425
653
|
export declare type TranspileResult = Array<(string | SourceNode)>;
|
|
426
|
-
export declare type FileResolver = (srcPath: string) => string | undefined | Thenable<string | undefined> | void;
|
|
654
|
+
export declare type FileResolver = (srcPath: string) => string | Buffer | undefined | Thenable<string | Buffer | undefined> | void;
|
|
427
655
|
export interface ExpressionInfo {
|
|
428
656
|
expressions: Expression[];
|
|
429
657
|
varExpressions: Expression[];
|
|
@@ -443,12 +671,14 @@ export interface GetTypeOptions {
|
|
|
443
671
|
flags: SymbolTypeFlag;
|
|
444
672
|
typeChain?: TypeChainEntry[];
|
|
445
673
|
data?: ExtraSymbolData;
|
|
674
|
+
ignoreCall?: boolean;
|
|
446
675
|
}
|
|
447
676
|
export declare class TypeChainEntry {
|
|
448
677
|
name: string;
|
|
449
678
|
type: BscType;
|
|
450
679
|
range: Range;
|
|
451
|
-
|
|
680
|
+
separatorToken: Token;
|
|
681
|
+
constructor(name: string, type: BscType, range: Range, separatorToken?: Token);
|
|
452
682
|
get isResolved(): boolean;
|
|
453
683
|
}
|
|
454
684
|
export interface TypeChainProcessResult {
|
|
@@ -459,3 +689,14 @@ export interface TypeChainProcessResult {
|
|
|
459
689
|
range: Range;
|
|
460
690
|
containsDynamic: boolean;
|
|
461
691
|
}
|
|
692
|
+
export interface TypeCompatibilityData {
|
|
693
|
+
missingFields?: {
|
|
694
|
+
name: string;
|
|
695
|
+
expectedType: BscType;
|
|
696
|
+
}[];
|
|
697
|
+
fieldMismatches?: {
|
|
698
|
+
name: string;
|
|
699
|
+
expectedType: BscType;
|
|
700
|
+
actualType: BscType;
|
|
701
|
+
}[];
|
|
702
|
+
}
|
package/dist/interfaces.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TypeChainEntry = void 0;
|
|
4
|
+
const creators_1 = require("./astUtils/creators");
|
|
5
|
+
const TokenKind_1 = require("./lexer/TokenKind");
|
|
4
6
|
class TypeChainEntry {
|
|
5
|
-
constructor(name, type, range) {
|
|
7
|
+
constructor(name, type, range, separatorToken = (0, creators_1.createToken)(TokenKind_1.TokenKind.Dot)) {
|
|
6
8
|
this.name = name;
|
|
7
9
|
this.type = type;
|
|
8
10
|
this.range = range;
|
|
11
|
+
this.separatorToken = separatorToken;
|
|
9
12
|
}
|
|
10
13
|
get isResolved() {
|
|
11
14
|
var _a;
|
package/dist/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AAqBA,kDAAkD;AAClD,iDAA8C;AAsuB9C,MAAa,cAAc;IACvB,YAAmB,IAAY,EAAS,IAAa,EAAS,KAAY,EAAS,iBAAwB,IAAA,sBAAW,EAAC,qBAAS,CAAC,GAAG,CAAC;QAAlH,SAAI,GAAJ,IAAI,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAS;QAAS,UAAK,GAAL,KAAK,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAoC;IACrI,CAAC;IACD,IAAI,UAAU;;QACV,OAAO,MAAA,IAAI,CAAC,IAAI,0CAAE,YAAY,EAAE,CAAC;IACrC,CAAC;CACJ;AAND,wCAMC"}
|
package/dist/lexer/Lexer.js
CHANGED