brighterscript 0.68.5 → 0.69.1
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 +12 -0
- package/dist/BusyStatusTracker.d.ts +37 -7
- package/dist/BusyStatusTracker.js +73 -8
- package/dist/BusyStatusTracker.js.map +1 -1
- package/dist/DiagnosticCollection.d.ts +19 -5
- package/dist/DiagnosticCollection.js +67 -16
- package/dist/DiagnosticCollection.js.map +1 -1
- package/dist/LanguageServer.d.ts +82 -132
- package/dist/LanguageServer.js +403 -940
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +9 -4
- package/dist/Logger.js +30 -6
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +1 -1
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +20 -2
- package/dist/Program.js +124 -49
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +13 -6
- package/dist/ProgramBuilder.js +25 -15
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.js +6 -3
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.js +1 -1
- package/dist/SemanticTokenUtils.js.map +1 -1
- package/dist/bscPlugin/CallExpressionInfo.js +2 -1
- package/dist/bscPlugin/CallExpressionInfo.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +14 -4
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.js +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.js +9 -9
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/common/Sequencer.d.ts +27 -0
- package/dist/common/Sequencer.js +113 -0
- package/dist/common/Sequencer.js.map +1 -0
- package/dist/common/Sequencer.spec.d.ts +1 -0
- package/dist/common/Sequencer.spec.js +75 -0
- package/dist/common/Sequencer.spec.js.map +1 -0
- package/dist/deferred.d.ts +2 -0
- package/dist/deferred.js +10 -0
- package/dist/deferred.js.map +1 -1
- package/dist/files/BrsFile.d.ts +1 -1
- package/dist/files/BrsFile.js +10 -15
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +8 -0
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/interfaces.d.ts +22 -2
- package/dist/lexer/Lexer.js +1 -1
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/logging.d.ts +6 -1
- package/dist/logging.js +14 -1
- package/dist/logging.js.map +1 -1
- package/dist/lsp/ActionQueue.d.ts +35 -0
- package/dist/lsp/ActionQueue.js +115 -0
- package/dist/lsp/ActionQueue.js.map +1 -0
- package/dist/lsp/ActionQueue.spec.d.ts +1 -0
- package/dist/lsp/ActionQueue.spec.js +80 -0
- package/dist/lsp/ActionQueue.spec.js.map +1 -0
- package/dist/lsp/DocumentManager.d.ts +63 -0
- package/dist/lsp/DocumentManager.js +122 -0
- package/dist/lsp/DocumentManager.js.map +1 -0
- package/dist/lsp/DocumentManager.spec.d.ts +1 -0
- package/dist/lsp/DocumentManager.spec.js +103 -0
- package/dist/lsp/DocumentManager.spec.js.map +1 -0
- package/dist/lsp/LspProject.d.ts +231 -0
- package/dist/lsp/LspProject.js +3 -0
- package/dist/lsp/LspProject.js.map +1 -0
- package/dist/lsp/PathFilterer.d.ts +75 -0
- package/dist/lsp/PathFilterer.js +196 -0
- package/dist/lsp/PathFilterer.js.map +1 -0
- package/dist/lsp/PathFilterer.spec.d.ts +1 -0
- package/dist/lsp/PathFilterer.spec.js +182 -0
- package/dist/lsp/PathFilterer.spec.js.map +1 -0
- package/dist/lsp/Project.d.ts +178 -0
- package/dist/lsp/Project.js +438 -0
- package/dist/lsp/Project.js.map +1 -0
- package/dist/lsp/Project.spec.d.ts +1 -0
- package/dist/lsp/Project.spec.js +236 -0
- package/dist/lsp/Project.spec.js.map +1 -0
- package/dist/lsp/ProjectManager.d.ts +221 -0
- package/dist/lsp/ProjectManager.js +735 -0
- package/dist/lsp/ProjectManager.js.map +1 -0
- package/dist/lsp/ProjectManager.spec.d.ts +1 -0
- package/dist/lsp/ProjectManager.spec.js +756 -0
- package/dist/lsp/ProjectManager.spec.js.map +1 -0
- package/dist/lsp/ReaderWriterManager.d.ts +21 -0
- package/dist/lsp/ReaderWriterManager.js +60 -0
- package/dist/lsp/ReaderWriterManager.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.d.ts +99 -0
- package/dist/lsp/worker/MessageHandler.js +138 -0
- package/dist/lsp/worker/MessageHandler.js.map +1 -0
- package/dist/lsp/worker/MessageHandler.spec.d.ts +1 -0
- package/dist/lsp/worker/MessageHandler.spec.js +64 -0
- package/dist/lsp/worker/MessageHandler.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.d.ts +38 -0
- package/dist/lsp/worker/WorkerPool.js +78 -0
- package/dist/lsp/worker/WorkerPool.js.map +1 -0
- package/dist/lsp/worker/WorkerPool.spec.d.ts +1 -0
- package/dist/lsp/worker/WorkerPool.spec.js +59 -0
- package/dist/lsp/worker/WorkerPool.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.d.ts +144 -0
- package/dist/lsp/worker/WorkerThreadProject.js +183 -0
- package/dist/lsp/worker/WorkerThreadProject.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.d.ts +2 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js +68 -0
- package/dist/lsp/worker/WorkerThreadProject.spec.js.map +1 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.d.ts +15 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js +58 -0
- package/dist/lsp/worker/WorkerThreadProjectRunner.js.map +1 -0
- package/dist/util.d.ts +32 -5
- package/dist/util.js +117 -19
- package/dist/util.js.map +1 -1
- package/package.json +13 -3
package/dist/LanguageServer.d.ts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import 'array-flat-polyfill';
|
|
2
|
-
import type { InitializeParams,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Throttler } from './Throttler';
|
|
6
|
-
import { BusyStatusTracker } from './BusyStatusTracker';
|
|
2
|
+
import type { CompletionItem, DidChangeWatchedFilesParams, InitializeParams, TextDocumentPositionParams, ExecuteCommandParams, WorkspaceSymbolParams, DocumentSymbolParams, ReferenceParams, SignatureHelpParams, CodeActionParams, HandlerResult, InitializeError, InitializeResult, CompletionParams, ResultProgressReporter, WorkDoneProgressReporter, CompletionList, CancellationToken, DidChangeConfigurationParams } from 'vscode-languageserver/node';
|
|
3
|
+
import { LogLevel } from './logging';
|
|
4
|
+
import type { WorkspaceConfig } from './lsp/ProjectManager';
|
|
7
5
|
export declare class LanguageServer {
|
|
8
|
-
private connection;
|
|
9
|
-
projects: Project[];
|
|
10
6
|
/**
|
|
11
|
-
* The
|
|
7
|
+
* The default threading setting for the language server. Can be overridden by per-workspace settings
|
|
8
|
+
*/
|
|
9
|
+
static enableThreadingDefault: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The language server protocol connection, used to send and receive all requests and responses
|
|
12
12
|
*/
|
|
13
|
-
private
|
|
13
|
+
private connection;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* in any of the workspace-based projects.
|
|
17
|
-
* Basically these are single-file projects to at least get parsing for standalone files.
|
|
18
|
-
* Also, they should only be created when the file is opened, and destroyed when the file is closed.
|
|
15
|
+
* Manages all projects for this language server
|
|
19
16
|
*/
|
|
20
|
-
|
|
17
|
+
private projectManager;
|
|
21
18
|
private hasConfigurationCapability;
|
|
22
19
|
/**
|
|
23
20
|
* Indicates whether the client supports workspace folders
|
|
@@ -28,157 +25,96 @@ export declare class LanguageServer {
|
|
|
28
25
|
* The text document manager supports full document sync only
|
|
29
26
|
*/
|
|
30
27
|
private documents;
|
|
31
|
-
private createConnection;
|
|
32
28
|
private loggerSubscription;
|
|
33
|
-
private keyedThrottler;
|
|
34
|
-
validateThrottler: Throttler;
|
|
35
|
-
private sendDiagnosticsThrottler;
|
|
36
|
-
private boundValidateAll;
|
|
37
|
-
private validateAllThrottled;
|
|
38
|
-
busyStatusTracker: BusyStatusTracker;
|
|
39
|
-
run(): void;
|
|
40
|
-
private busyStatusIndex;
|
|
41
|
-
private sendBusyStatus;
|
|
42
|
-
/**
|
|
43
|
-
* Called when the client starts initialization
|
|
44
|
-
*/
|
|
45
|
-
onInitialize(params: InitializeParams): {
|
|
46
|
-
capabilities: ServerCapabilities<any>;
|
|
47
|
-
};
|
|
48
|
-
private initialProjectsCreated;
|
|
49
|
-
/**
|
|
50
|
-
* Ask the client for the list of `files.exclude` patterns. Useful when determining if we should process a file
|
|
51
|
-
*/
|
|
52
|
-
private getWorkspaceExcludeGlobs;
|
|
53
29
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
30
|
+
* Used to filter paths based on include/exclude lists (like .gitignore or vscode's `files.exclude`).
|
|
31
|
+
* This is used to prevent the language server from being overwhelmed by files we don't actually want to handle
|
|
56
32
|
*/
|
|
57
|
-
private
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
* Handle situations where bsconfig.json files were added or removed (to elevate/lower workspaceFolder projects accordingly)
|
|
62
|
-
* Leave existing projects alone if they are not affected by these changes
|
|
63
|
-
*/
|
|
64
|
-
private syncProjects;
|
|
33
|
+
private pathFilterer;
|
|
34
|
+
logger: import("@rokucommunity/logger/dist/Logger").Logger;
|
|
35
|
+
constructor();
|
|
36
|
+
run(): void;
|
|
65
37
|
/**
|
|
66
|
-
*
|
|
38
|
+
* Called when the client starts initialization
|
|
67
39
|
*/
|
|
68
|
-
|
|
40
|
+
onInitialize(params: InitializeParams): HandlerResult<InitializeResult, InitializeError>;
|
|
69
41
|
/**
|
|
70
42
|
* Called when the client has finished initializing
|
|
71
43
|
*/
|
|
72
|
-
|
|
44
|
+
onInitialized(): Promise<void>;
|
|
73
45
|
/**
|
|
74
|
-
*
|
|
46
|
+
* Set our logLevel to the most verbose log level found across all projects and workspaces
|
|
75
47
|
*/
|
|
76
|
-
private
|
|
48
|
+
private syncLogLevel;
|
|
49
|
+
private onTextDocumentDidChangeContent;
|
|
77
50
|
/**
|
|
78
|
-
*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
* Event handler for when the program wants to load file contents.
|
|
83
|
-
* anytime the program wants to load a file, check with our in-memory document cache first
|
|
84
|
-
*/
|
|
85
|
-
private documentFileResolver;
|
|
86
|
-
private getConfigFilePath;
|
|
87
|
-
/**
|
|
88
|
-
* A unique project counter to help distinguish log entries in lsp mode
|
|
89
|
-
*/
|
|
90
|
-
private projectCounter;
|
|
91
|
-
/**
|
|
92
|
-
* @param projectPath path to the project
|
|
93
|
-
* @param workspacePath path to the workspace in which all project should reside or are referenced by
|
|
94
|
-
* @param projectNumber an optional project number to assign to the project. Used when reloading projects that should keep the same number
|
|
51
|
+
* Called when watched files changed (add/change/delete).
|
|
52
|
+
* The CLIENT is in charge of what files to watch, so all client
|
|
53
|
+
* implementations should ensure that all valid project
|
|
54
|
+
* file types are watched (.brs,.bs,.xml,manifest, and any json/text/image files)
|
|
95
55
|
*/
|
|
96
|
-
|
|
97
|
-
private
|
|
98
|
-
private getProjects;
|
|
56
|
+
onDidChangeWatchedFiles(params: DidChangeWatchedFilesParams): Promise<void>;
|
|
57
|
+
private onDocumentClose;
|
|
99
58
|
/**
|
|
100
59
|
* Provide a list of completion items based on the current cursor position
|
|
101
60
|
*/
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Provide a full completion item from the selection
|
|
105
|
-
*/
|
|
106
|
-
private onCompletionResolve;
|
|
107
|
-
private onCodeAction;
|
|
61
|
+
onCompletion(params: CompletionParams, cancellationToken: CancellationToken, workDoneProgress: WorkDoneProgressReporter, resultProgress: ResultProgressReporter<CompletionItem[]>): Promise<CompletionList>;
|
|
108
62
|
/**
|
|
109
|
-
*
|
|
63
|
+
* Get a list of workspaces, and their configurations.
|
|
64
|
+
* Get only the settings for the workspace that are relevant to the language server. We do this so we can cache this object for use in change detection in the future.
|
|
110
65
|
*/
|
|
111
|
-
private
|
|
66
|
+
private getWorkspaceConfigs;
|
|
67
|
+
private workspaceConfigsCache;
|
|
68
|
+
onDidChangeConfiguration(args: DidChangeConfigurationParams): Promise<void>;
|
|
69
|
+
onHover(params: TextDocumentPositionParams): Promise<import("vscode-languageserver-types").Hover>;
|
|
70
|
+
onWorkspaceSymbol(params: WorkspaceSymbolParams): Promise<import("vscode-languageserver-types").WorkspaceSymbol[]>;
|
|
71
|
+
onDocumentSymbol(params: DocumentSymbolParams): Promise<import("vscode-languageserver-types").DocumentSymbol[]>;
|
|
72
|
+
onDefinition(params: TextDocumentPositionParams): Promise<import("vscode-languageserver-types").Location[]>;
|
|
73
|
+
onSignatureHelp(params: SignatureHelpParams): Promise<import("vscode-languageserver-types").SignatureHelp>;
|
|
74
|
+
onReferences(params: ReferenceParams): Promise<import("vscode-languageserver-types").Location[]>;
|
|
75
|
+
private onFullSemanticTokens;
|
|
76
|
+
onCodeAction(params: CodeActionParams): Promise<import("vscode-languageserver-types").CodeAction[]>;
|
|
77
|
+
onExecuteCommand(params: ExecuteCommandParams): Promise<import("./Program").FileTranspileResult>;
|
|
112
78
|
/**
|
|
113
|
-
*
|
|
79
|
+
* Establish a connection to the client if not already connected
|
|
114
80
|
*/
|
|
115
|
-
private
|
|
116
|
-
private getRootDir;
|
|
81
|
+
private establishConnection;
|
|
117
82
|
/**
|
|
118
|
-
*
|
|
119
|
-
* If this is the case, those standalone workspaces should be removed because the file was
|
|
120
|
-
* included in an actual program now.
|
|
121
|
-
*
|
|
122
|
-
* Sometimes files that used to be included are now excluded, so those open files need to be re-processed as standalone
|
|
83
|
+
* Send a new busy status notification to the client based on the current busy status
|
|
123
84
|
*/
|
|
124
|
-
private
|
|
125
|
-
private
|
|
85
|
+
private sendBusyStatus;
|
|
86
|
+
private busyStatusIndex;
|
|
87
|
+
private pathFiltererDisposables;
|
|
126
88
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* implementations should ensure that all valid project
|
|
130
|
-
* file types are watched (.brs,.bs,.xml,manifest, and any json/text/image files)
|
|
89
|
+
* Populate the path filterer with the client's include/exclude lists and the projects include lists
|
|
90
|
+
* @returns the instance of the path filterer
|
|
131
91
|
*/
|
|
132
|
-
private
|
|
92
|
+
private rebuildPathFilterer;
|
|
133
93
|
/**
|
|
134
|
-
*
|
|
135
|
-
* any file changes you receive with no unexpected side-effects
|
|
94
|
+
* Ask the client for the list of `files.exclude` patterns. Useful when determining if we should process a file
|
|
136
95
|
*/
|
|
137
|
-
|
|
138
|
-
type: FileChangeType;
|
|
139
|
-
srcPath: string;
|
|
140
|
-
}[]): Promise<void>;
|
|
96
|
+
private getWorkspaceExcludeGlobs;
|
|
141
97
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
98
|
+
* Ask the project manager to sync all projects found within the list of workspaces
|
|
99
|
+
* @param forceReload if true, all projects are discarded and recreated from scratch
|
|
144
100
|
*/
|
|
145
|
-
private
|
|
146
|
-
private onHover;
|
|
147
|
-
private onDocumentClose;
|
|
148
|
-
private validateTextDocument;
|
|
149
|
-
private validateAll;
|
|
150
|
-
onWorkspaceSymbol(params: WorkspaceSymbolParams): Promise<SymbolInformation[]>;
|
|
151
|
-
onDocumentSymbol(params: DocumentSymbolParams): Promise<import("vscode-languageserver-types").DocumentSymbol[]>;
|
|
152
|
-
private onDefinition;
|
|
153
|
-
private onSignatureHelp;
|
|
154
|
-
private onReferences;
|
|
155
|
-
private onValidateSettled;
|
|
156
|
-
private onFullSemanticTokens;
|
|
157
|
-
private diagnosticCollection;
|
|
158
|
-
private sendDiagnostics;
|
|
159
|
-
onExecuteCommand(params: ExecuteCommandParams): Promise<import("./Program").FileTranspileResult>;
|
|
160
|
-
private transpileFile;
|
|
161
|
-
dispose(): void;
|
|
162
|
-
}
|
|
163
|
-
export interface Project {
|
|
101
|
+
private syncProjects;
|
|
164
102
|
/**
|
|
165
|
-
*
|
|
103
|
+
* Given a workspaceFolder path, get the specified configuration from the client (if applicable).
|
|
104
|
+
* Be sure to use optional chaining to traverse the result in case that configuration doesn't exist or the client doesn't support `getConfiguration`
|
|
105
|
+
* @param workspaceFolder the folder for the workspace in the client
|
|
166
106
|
*/
|
|
167
|
-
|
|
168
|
-
firstRunPromise: Promise<any>;
|
|
169
|
-
builder: ProgramBuilder;
|
|
107
|
+
private getClientConfiguration;
|
|
170
108
|
/**
|
|
171
|
-
*
|
|
109
|
+
* Send a critical failure notification to the client, which should show a notification of some kind
|
|
172
110
|
*/
|
|
173
|
-
|
|
111
|
+
private sendCriticalFailure;
|
|
174
112
|
/**
|
|
175
|
-
*
|
|
113
|
+
* Send diagnostics to the client
|
|
176
114
|
*/
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
configFilePath?: string;
|
|
181
|
-
isStandaloneFileProject: boolean;
|
|
115
|
+
private sendDiagnostics;
|
|
116
|
+
private diagnosticCollection;
|
|
117
|
+
protected dispose(): void;
|
|
182
118
|
}
|
|
183
119
|
export declare enum CustomCommands {
|
|
184
120
|
TranspileFile = "TranspileFile"
|
|
@@ -186,3 +122,17 @@ export declare enum CustomCommands {
|
|
|
186
122
|
export declare enum NotificationName {
|
|
187
123
|
busyStatus = "busyStatus"
|
|
188
124
|
}
|
|
125
|
+
declare type Handler<T> = {
|
|
126
|
+
[K in keyof T as K extends `on${string}` ? K : never]: T[K] extends (arg: infer U) => void ? (arg: U) => void : never;
|
|
127
|
+
};
|
|
128
|
+
export declare type OnHandler<T> = {
|
|
129
|
+
[K in keyof Handler<T>]: Handler<T>[K] extends (arg: infer U) => void ? U : never;
|
|
130
|
+
};
|
|
131
|
+
export declare type WorkspaceConfigWithExtras = WorkspaceConfig & {
|
|
132
|
+
bsconfigPath: string;
|
|
133
|
+
languageServer: {
|
|
134
|
+
enableThreading: boolean;
|
|
135
|
+
logLevel: LogLevel | string | undefined;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export {};
|