brighterscript 1.0.0-alpha.20 → 1.0.0-alpha.23
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 +134 -0
- package/README.md +6 -3
- package/bsconfig.schema.json +10 -2
- package/dist/BsConfig.d.ts +5 -0
- package/dist/Cache.d.ts +5 -1
- package/dist/Cache.js +6 -0
- package/dist/Cache.js.map +1 -1
- package/dist/DependencyGraph.d.ts +2 -2
- package/dist/DependencyGraph.js +15 -3
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticCollection.d.ts +5 -3
- package/dist/DiagnosticCollection.js +10 -12
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/DiagnosticFilterer.js +4 -3
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +6 -1
- package/dist/DiagnosticMessages.js +9 -4
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/LanguageServer.d.ts +48 -25
- package/dist/LanguageServer.js +303 -222
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Program.d.ts +7 -3
- package/dist/Program.js +60 -22
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.js +11 -11
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +41 -15
- package/dist/Scope.js +86 -21
- package/dist/Scope.js.map +1 -1
- package/dist/SymbolTable.js +15 -0
- package/dist/SymbolTable.js.map +1 -1
- package/dist/XmlScope.d.ts +3 -3
- package/dist/astUtils/AstEditor.d.ts +32 -0
- package/dist/astUtils/AstEditor.js +132 -0
- package/dist/astUtils/AstEditor.js.map +1 -1
- package/dist/astUtils/AstEditor.spec.js +118 -34
- package/dist/astUtils/AstEditor.spec.js.map +1 -1
- package/dist/astUtils/creators.d.ts +6 -2
- package/dist/astUtils/creators.js +9 -2
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +6 -3
- package/dist/astUtils/reflection.js +18 -8
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +74 -64
- package/dist/astUtils/visitors.js +30 -10
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +95 -3
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +7 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +55 -54
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +205 -17
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +13 -25
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.js +26 -20
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/files/BrsFile.Class.spec.js +167 -2
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +8 -0
- package/dist/files/BrsFile.js +48 -30
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +183 -0
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +5 -5
- package/dist/files/XmlFile.js +5 -4
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +18 -2
- package/dist/parser/BrsTranspileState.d.ts +2 -0
- package/dist/parser/BrsTranspileState.js +5 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.js +6 -23
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +8 -4
- package/dist/parser/Parser.js +40 -7
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +51 -7
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/Statement.d.ts +20 -20
- package/dist/parser/Statement.js +108 -90
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +39 -6
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +16 -2
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -1
- package/dist/types/EnumType.d.ts +22 -0
- package/dist/types/EnumType.js +55 -0
- package/dist/types/EnumType.js.map +1 -0
- package/dist/util.d.ts +6 -7
- package/dist/util.js +32 -24
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +4 -0
- package/dist/validators/ClassValidator.js +27 -7
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +11 -11
package/dist/LanguageServer.d.ts
CHANGED
|
@@ -5,18 +5,18 @@ import { ProgramBuilder } from './ProgramBuilder';
|
|
|
5
5
|
import { Throttler } from './Throttler';
|
|
6
6
|
export declare class LanguageServer {
|
|
7
7
|
private connection;
|
|
8
|
-
|
|
8
|
+
projects: Project[];
|
|
9
9
|
/**
|
|
10
10
|
* The number of milliseconds that should be used for language server typing debouncing
|
|
11
11
|
*/
|
|
12
12
|
private debounceTimeout;
|
|
13
13
|
/**
|
|
14
|
-
* These
|
|
15
|
-
* in any of the workspace projects.
|
|
16
|
-
* Basically these are single-file
|
|
14
|
+
* These projects are created on the fly whenever a file is opened that is not included
|
|
15
|
+
* in any of the workspace-based projects.
|
|
16
|
+
* Basically these are single-file projects to at least get parsing for standalone files.
|
|
17
17
|
* Also, they should only be created when the file is opened, and destroyed when the file is closed.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
standaloneFileProjects: Record<string, Project>;
|
|
20
20
|
private hasConfigurationCapability;
|
|
21
21
|
/**
|
|
22
22
|
* Indicates whether the client supports workspace folders
|
|
@@ -31,6 +31,7 @@ export declare class LanguageServer {
|
|
|
31
31
|
private loggerSubscription;
|
|
32
32
|
private keyedThrottler;
|
|
33
33
|
validateThrottler: Throttler;
|
|
34
|
+
private sendDiagnosticsThrottler;
|
|
34
35
|
private boundValidateAll;
|
|
35
36
|
private validateAllThrottled;
|
|
36
37
|
run(): void;
|
|
@@ -41,7 +42,27 @@ export declare class LanguageServer {
|
|
|
41
42
|
onInitialize(params: InitializeParams): {
|
|
42
43
|
capabilities: ServerCapabilities<any>;
|
|
43
44
|
};
|
|
44
|
-
private
|
|
45
|
+
private initialProjectsCreated;
|
|
46
|
+
/**
|
|
47
|
+
* Ask the client for the list of `files.exclude` patterns. Useful when determining if we should process a file
|
|
48
|
+
*/
|
|
49
|
+
private getWorkspaceExcludeGlobs;
|
|
50
|
+
/**
|
|
51
|
+
* Scan the workspace for all `bsconfig.json` files. If at least one is found, then only folders who have bsconfig.json are returned.
|
|
52
|
+
* If none are found, then the workspaceFolder itself is treated as a project
|
|
53
|
+
*/
|
|
54
|
+
private getProjectPaths;
|
|
55
|
+
/**
|
|
56
|
+
* Find all folders with bsconfig.json files in them, and treat each as a project.
|
|
57
|
+
* Treat workspaces that don't have a bsconfig.json as a project.
|
|
58
|
+
* Handle situations where bsconfig.json files were added or removed (to elevate/lower workspaceFolder projects accordingly)
|
|
59
|
+
* Leave existing projects alone if they are not affected by these changes
|
|
60
|
+
*/
|
|
61
|
+
private syncProjects;
|
|
62
|
+
/**
|
|
63
|
+
* Get all workspace paths from the client
|
|
64
|
+
*/
|
|
65
|
+
private getWorkspacePaths;
|
|
45
66
|
/**
|
|
46
67
|
* Called when the client has finished initializing
|
|
47
68
|
* @param params
|
|
@@ -54,25 +75,16 @@ export declare class LanguageServer {
|
|
|
54
75
|
/**
|
|
55
76
|
* Wait for all programs' first run to complete
|
|
56
77
|
*/
|
|
57
|
-
private
|
|
58
|
-
/**
|
|
59
|
-
* Create project for each new workspace. If the workspace is already known,
|
|
60
|
-
* it is skipped.
|
|
61
|
-
* @param workspaceFolders
|
|
62
|
-
*/
|
|
63
|
-
private createWorkspaces;
|
|
78
|
+
private waitAllProjectFirstRuns;
|
|
64
79
|
/**
|
|
65
80
|
* Event handler for when the program wants to load file contents.
|
|
66
81
|
* anytime the program wants to load a file, check with our in-memory document cache first
|
|
67
82
|
*/
|
|
68
83
|
private documentFileResolver;
|
|
69
84
|
private getConfigFilePath;
|
|
70
|
-
private
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*/
|
|
74
|
-
private createStandaloneFileWorkspace;
|
|
75
|
-
private getWorkspaces;
|
|
85
|
+
private createProject;
|
|
86
|
+
private createStandaloneFileProject;
|
|
87
|
+
private getProjects;
|
|
76
88
|
/**
|
|
77
89
|
* Provide a list of completion items based on the current cursor position
|
|
78
90
|
* @param textDocumentPosition
|
|
@@ -85,9 +97,13 @@ export declare class LanguageServer {
|
|
|
85
97
|
private onCompletionResolve;
|
|
86
98
|
private onCodeAction;
|
|
87
99
|
/**
|
|
88
|
-
*
|
|
100
|
+
* Remove a project from the language server
|
|
101
|
+
*/
|
|
102
|
+
private removeProject;
|
|
103
|
+
/**
|
|
104
|
+
* Reload each of the specified workspaces
|
|
89
105
|
*/
|
|
90
|
-
private
|
|
106
|
+
private reloadProjects;
|
|
91
107
|
private getRootDir;
|
|
92
108
|
/**
|
|
93
109
|
* Sometimes users will alter their bsconfig files array, and will include standalone files.
|
|
@@ -96,7 +112,7 @@ export declare class LanguageServer {
|
|
|
96
112
|
*
|
|
97
113
|
* Sometimes files that used to be included are now excluded, so those open files need to be re-processed as standalone
|
|
98
114
|
*/
|
|
99
|
-
private
|
|
115
|
+
private synchronizeStandaloneProjects;
|
|
100
116
|
private onDidChangeConfiguration;
|
|
101
117
|
/**
|
|
102
118
|
* Called when watched files changed (add/change/delete).
|
|
@@ -111,7 +127,7 @@ export declare class LanguageServer {
|
|
|
111
127
|
* any file changes you receive with no unexpected side-effects
|
|
112
128
|
* @param changes
|
|
113
129
|
*/
|
|
114
|
-
handleFileChanges(
|
|
130
|
+
handleFileChanges(project: Project, changes: {
|
|
115
131
|
type: FileChangeType;
|
|
116
132
|
srcPath: string;
|
|
117
133
|
}[]): Promise<void>;
|
|
@@ -140,14 +156,21 @@ export declare class LanguageServer {
|
|
|
140
156
|
private transpileFile;
|
|
141
157
|
dispose(): void;
|
|
142
158
|
}
|
|
143
|
-
export interface
|
|
159
|
+
export interface Project {
|
|
144
160
|
firstRunPromise: Promise<any>;
|
|
145
161
|
builder: ProgramBuilder;
|
|
162
|
+
/**
|
|
163
|
+
* The path to where the project resides
|
|
164
|
+
*/
|
|
165
|
+
projectPath: string;
|
|
166
|
+
/**
|
|
167
|
+
* The path to the workspace where this project resides. A workspace can have multiple projects (by adding a bsconfig.json to each folder).
|
|
168
|
+
*/
|
|
146
169
|
workspacePath: string;
|
|
147
170
|
isFirstRunComplete: boolean;
|
|
148
171
|
isFirstRunSuccessful: boolean;
|
|
149
172
|
configFilePath?: string;
|
|
150
|
-
|
|
173
|
+
isStandaloneFileProject: boolean;
|
|
151
174
|
}
|
|
152
175
|
export declare enum CustomCommands {
|
|
153
176
|
TranspileFile = "TranspileFile"
|