@lvce-editor/extension-host-worker 8.19.0 → 8.24.0
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/dist/extension-api/index.js +470 -52
- package/dist/extension-api/parts/Activation/Activation.js +4 -2
- package/dist/extension-api/parts/Diagnostic/Diagnostic.js +10 -0
- package/dist/extension-api/parts/DiagnosticProvider/DiagnosticProvider.js +0 -0
- package/dist/extension-api/parts/DiagnosticProviderRegistry/DiagnosticProviderRegistry.js +66 -0
- package/dist/extension-api/parts/DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.js +0 -0
- package/dist/extension-api/parts/DiagnosticResult/DiagnosticResult.js +0 -0
- package/dist/extension-api/parts/DiagnosticTextDocument/DiagnosticTextDocument.js +0 -0
- package/dist/extension-api/parts/ExecuteCommand/ExecuteCommand.js +2 -2
- package/dist/extension-api/parts/ExecuteDiagnosticProvider/ExecuteDiagnosticProvider.js +4 -0
- package/dist/extension-api/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.js +9 -1
- package/dist/extension-api/parts/GetDiagnosticProviderRegistrySnapshot/GetDiagnosticProviderRegistrySnapshot.js +4 -0
- package/dist/extension-api/parts/NotifyStatusBarChange/NotifyStatusBarChange.js +2 -2
- package/dist/extension-api/parts/OutputChannel/OutputChannel.js +71 -0
- package/dist/extension-api/parts/OutputChannelHandle/OutputChannelHandle.js +0 -0
- package/dist/extension-api/parts/OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.js +0 -0
- package/dist/extension-api/parts/QuickPick/QuickPick.js +2 -2
- package/dist/extension-api/parts/RegisterDiagnosticProvider/RegisterDiagnosticProvider.js +4 -0
- package/dist/extension-api/parts/RegisteredDiagnosticProvider/RegisteredDiagnosticProvider.js +0 -0
- package/dist/extension-api/parts/RegisteredOutputChannel/RegisteredOutputChannel.js +0 -0
- package/dist/extension-api/parts/ResetDiagnosticProviderRegistry/ResetDiagnosticProviderRegistry.js +4 -0
- package/dist/extension-api/parts/View/View.js +0 -0
- package/dist/extension-api/parts/ViewRegistry/ViewRegistry.js +55 -0
- package/dist/extensionHostWorkerMain.js +142 -45
- package/extension-api/dist/index.d.ts +8 -0
- package/extension-api/dist/index.js +3 -0
- package/extension-api/dist/parts/Activation/Activation.js +4 -2
- package/extension-api/dist/parts/CommandMap/CommandMap.d.ts +5 -0
- package/extension-api/dist/parts/Diagnostic/Diagnostic.d.ts +9 -0
- package/extension-api/dist/parts/Diagnostic/Diagnostic.js +4 -0
- package/extension-api/dist/parts/DiagnosticProvider/DiagnosticProvider.d.ts +7 -0
- package/extension-api/dist/parts/DiagnosticProvider/DiagnosticProvider.js +1 -0
- package/extension-api/dist/parts/DiagnosticProviderRegistry/DiagnosticProviderRegistry.d.ts +12 -0
- package/extension-api/dist/parts/DiagnosticProviderRegistry/DiagnosticProviderRegistry.js +58 -0
- package/extension-api/dist/parts/DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.d.ts +4 -0
- package/extension-api/dist/parts/DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.js +1 -0
- package/extension-api/dist/parts/DiagnosticResult/DiagnosticResult.d.ts +11 -0
- package/extension-api/dist/parts/DiagnosticResult/DiagnosticResult.js +1 -0
- package/extension-api/dist/parts/DiagnosticTextDocument/DiagnosticTextDocument.d.ts +6 -0
- package/extension-api/dist/parts/DiagnosticTextDocument/DiagnosticTextDocument.js +1 -0
- package/extension-api/dist/parts/ExecuteCommand/ExecuteCommand.js +2 -2
- package/extension-api/dist/parts/ExecuteDiagnosticProvider/ExecuteDiagnosticProvider.d.ts +1 -0
- package/extension-api/dist/parts/ExecuteDiagnosticProvider/ExecuteDiagnosticProvider.js +1 -0
- package/extension-api/dist/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.d.ts +5 -0
- package/extension-api/dist/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.js +8 -0
- package/extension-api/dist/parts/ExtensionApiWorkerCommandMap/ExtensionApiWorkerCommandMap.d.ts +5 -0
- package/extension-api/dist/parts/GetDiagnosticProviderRegistrySnapshot/GetDiagnosticProviderRegistrySnapshot.d.ts +1 -0
- package/extension-api/dist/parts/GetDiagnosticProviderRegistrySnapshot/GetDiagnosticProviderRegistrySnapshot.js +1 -0
- package/extension-api/dist/parts/NotifyStatusBarChange/NotifyStatusBarChange.js +2 -2
- package/extension-api/dist/parts/OutputChannel/OutputChannel.d.ts +9 -0
- package/extension-api/dist/parts/OutputChannel/OutputChannel.js +64 -0
- package/extension-api/dist/parts/OutputChannelHandle/OutputChannelHandle.d.ts +6 -0
- package/extension-api/dist/parts/OutputChannelHandle/OutputChannelHandle.js +1 -0
- package/extension-api/dist/parts/OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.d.ts +4 -0
- package/extension-api/dist/parts/OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.js +1 -0
- package/extension-api/dist/parts/QuickPick/QuickPick.js +2 -2
- package/extension-api/dist/parts/RegisterDiagnosticProvider/RegisterDiagnosticProvider.d.ts +1 -0
- package/extension-api/dist/parts/RegisterDiagnosticProvider/RegisterDiagnosticProvider.js +1 -0
- package/extension-api/dist/parts/RegisteredDiagnosticProvider/RegisteredDiagnosticProvider.d.ts +7 -0
- package/extension-api/dist/parts/RegisteredDiagnosticProvider/RegisteredDiagnosticProvider.js +1 -0
- package/extension-api/dist/parts/RegisteredOutputChannel/RegisteredOutputChannel.d.ts +3 -0
- package/extension-api/dist/parts/RegisteredOutputChannel/RegisteredOutputChannel.js +1 -0
- package/extension-api/dist/parts/ResetDiagnosticProviderRegistry/ResetDiagnosticProviderRegistry.d.ts +1 -0
- package/extension-api/dist/parts/ResetDiagnosticProviderRegistry/ResetDiagnosticProviderRegistry.js +1 -0
- package/extension-api/dist/parts/View/View.d.ts +14 -0
- package/extension-api/dist/parts/View/View.js +1 -0
- package/extension-api/dist/parts/ViewRegistry/ViewRegistry.d.ts +6 -0
- package/extension-api/dist/parts/ViewRegistry/ViewRegistry.js +49 -0
- package/extension-api/package.json +3 -2
- package/extension-api/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/extension-api/parts/Rpc/Rpc.js +0 -14
- package/extension-api/dist/parts/Rpc/Rpc.d.ts +0 -3
- package/extension-api/dist/parts/Rpc/Rpc.js +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ExtensionManagementWorker } from '@lvce-editor/rpc-registry';
|
|
2
2
|
export const executeCommand = async (id, ...args) => {
|
|
3
|
-
return
|
|
3
|
+
return ExtensionManagementWorker.invoke('Extensions.executeCommand', id, ...args);
|
|
4
4
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { executeDiagnosticProvider } from '../DiagnosticProviderRegistry/DiagnosticProviderRegistry.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { executeDiagnosticProvider } from "../DiagnosticProviderRegistry/DiagnosticProviderRegistry.js";
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
export declare const commandMap: {
|
|
2
2
|
'ExtensionApi.executeCommand': (id: string, ...args: readonly unknown[]) => Promise<unknown>;
|
|
3
3
|
'ExtensionApi.executeCompletionProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<readonly import("../CompletionItem/CompletionItem.ts").CompletionItem[]>;
|
|
4
|
+
'ExtensionApi.executeDiagnosticProvider': (textDocument: import("../DiagnosticTextDocument/DiagnosticTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../DiagnosticResult/DiagnosticResult.ts").Diagnostic[]>;
|
|
4
5
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
5
6
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
6
7
|
'ExtensionApi.executeResolveCompletionItemProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, name: string, completionItem: import("../CompletionItem/CompletionItem.ts").CompletionItem, ...args: readonly unknown[]) => Promise<import("../CompletionItem/CompletionItem.ts").CompletionItem | undefined>;
|
|
8
|
+
'ExtensionApi.executeViewProvider': (id: string) => unknown;
|
|
7
9
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
8
10
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
11
|
+
'ExtensionApi.getDiagnosticProviderRegistrySnapshot': () => import("../DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.ts").DiagnosticProviderRegistrySnapshot;
|
|
9
12
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
10
13
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
14
|
+
'ExtensionApi.getOutputChannelRegistrySnapshot': () => import("../OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts").OutputChannelRegistrySnapshot;
|
|
11
15
|
'ExtensionApi.getStatusBarItems': () => readonly import("../StatusBarItem/StatusBarItem.ts").StatusBarItem[];
|
|
16
|
+
'ExtensionApi.getViewRegistrySnapshot': () => import("../View/View.ts").ViewRegistrySnapshot;
|
|
12
17
|
};
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { executeCommand, getCommandRegistrySnapshot } from "../CommandRegistry/CommandRegistry.js";
|
|
2
2
|
import { executeCompletionProvider, executeResolveCompletionItemProvider, getCompletionProviderRegistrySnapshot } from "../Completion/Completion.js";
|
|
3
|
+
import { executeDiagnosticProvider, getDiagnosticProviderRegistrySnapshot } from "../Diagnostic/Diagnostic.js";
|
|
3
4
|
import { executeFormattingProvider, getFormattingProviderRegistrySnapshot } from "../Formatting/Formatting.js";
|
|
4
5
|
import { getStatusBarItems } from "../GetStatusBarItems/GetStatusBarItems.js";
|
|
5
6
|
import { executeHoverProvider, getHoverProviderRegistrySnapshot } from "../Hover/Hover.js";
|
|
7
|
+
import { getOutputChannelRegistrySnapshot } from "../OutputChannel/OutputChannel.js";
|
|
8
|
+
import { executeViewProvider, getViewRegistrySnapshot } from "../ViewRegistry/ViewRegistry.js";
|
|
6
9
|
export const commandMap = {
|
|
7
10
|
'ExtensionApi.executeCommand': executeCommand,
|
|
8
11
|
'ExtensionApi.executeCompletionProvider': executeCompletionProvider,
|
|
12
|
+
'ExtensionApi.executeDiagnosticProvider': executeDiagnosticProvider,
|
|
9
13
|
'ExtensionApi.executeFormattingProvider': executeFormattingProvider,
|
|
10
14
|
'ExtensionApi.executeHoverProvider': executeHoverProvider,
|
|
11
15
|
'ExtensionApi.executeResolveCompletionItemProvider': executeResolveCompletionItemProvider,
|
|
16
|
+
'ExtensionApi.executeViewProvider': executeViewProvider,
|
|
12
17
|
'ExtensionApi.getCommandRegistrySnapshot': getCommandRegistrySnapshot,
|
|
13
18
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': getCompletionProviderRegistrySnapshot,
|
|
19
|
+
'ExtensionApi.getDiagnosticProviderRegistrySnapshot': getDiagnosticProviderRegistrySnapshot,
|
|
14
20
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': getFormattingProviderRegistrySnapshot,
|
|
15
21
|
'ExtensionApi.getHoverProviderRegistrySnapshot': getHoverProviderRegistrySnapshot,
|
|
22
|
+
'ExtensionApi.getOutputChannelRegistrySnapshot': getOutputChannelRegistrySnapshot,
|
|
16
23
|
'ExtensionApi.getStatusBarItems': getStatusBarItems,
|
|
24
|
+
'ExtensionApi.getViewRegistrySnapshot': getViewRegistrySnapshot,
|
|
17
25
|
};
|
package/extension-api/dist/parts/ExtensionApiWorkerCommandMap/ExtensionApiWorkerCommandMap.d.ts
CHANGED
|
@@ -3,12 +3,17 @@ export declare const commandMap: {
|
|
|
3
3
|
initialize(type: string, port: MessagePort): Promise<void>;
|
|
4
4
|
'ExtensionApi.executeCommand': (id: string, ...args: readonly unknown[]) => Promise<unknown>;
|
|
5
5
|
'ExtensionApi.executeCompletionProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<readonly import("../CompletionItem/CompletionItem.ts").CompletionItem[]>;
|
|
6
|
+
'ExtensionApi.executeDiagnosticProvider': (textDocument: import("../DiagnosticTextDocument/DiagnosticTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../DiagnosticResult/DiagnosticResult.ts").Diagnostic[]>;
|
|
6
7
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
7
8
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
8
9
|
'ExtensionApi.executeResolveCompletionItemProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, name: string, completionItem: import("../CompletionItem/CompletionItem.ts").CompletionItem, ...args: readonly unknown[]) => Promise<import("../CompletionItem/CompletionItem.ts").CompletionItem | undefined>;
|
|
10
|
+
'ExtensionApi.executeViewProvider': (id: string) => unknown;
|
|
9
11
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
10
12
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
13
|
+
'ExtensionApi.getDiagnosticProviderRegistrySnapshot': () => import("../DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.ts").DiagnosticProviderRegistrySnapshot;
|
|
11
14
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
12
15
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
16
|
+
'ExtensionApi.getOutputChannelRegistrySnapshot': () => import("../OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts").OutputChannelRegistrySnapshot;
|
|
13
17
|
'ExtensionApi.getStatusBarItems': () => readonly import("../StatusBarItem/StatusBarItem.ts").StatusBarItem[];
|
|
18
|
+
'ExtensionApi.getViewRegistrySnapshot': () => import("../View/View.ts").ViewRegistrySnapshot;
|
|
14
19
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDiagnosticProviderRegistrySnapshot } from '../DiagnosticProviderRegistry/DiagnosticProviderRegistry.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDiagnosticProviderRegistrySnapshot } from "../DiagnosticProviderRegistry/DiagnosticProviderRegistry.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ExtensionManagementWorker } from '@lvce-editor/rpc-registry';
|
|
2
2
|
export const notifyStatusBarChange = async (id) => {
|
|
3
|
-
await
|
|
3
|
+
await ExtensionManagementWorker.invoke('StatusBar.handleChange', id);
|
|
4
4
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OutputChannel } from '../OutputChannelHandle/OutputChannelHandle.ts';
|
|
2
|
+
import type { OutputChannelRegistrySnapshot } from '../OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts';
|
|
3
|
+
export declare const activateOutputChannels: () => void;
|
|
4
|
+
export declare const createOutputChannel: (id: string) => OutputChannel;
|
|
5
|
+
export declare const getOutputChannelRegistrySnapshot: () => OutputChannelRegistrySnapshot;
|
|
6
|
+
export declare const resetOutputChannelRegistry: () => void;
|
|
7
|
+
export type { OutputChannel } from '../OutputChannelHandle/OutputChannelHandle.ts';
|
|
8
|
+
export type { OutputChannelRegistrySnapshot } from '../OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts';
|
|
9
|
+
export type { RegisteredOutputChannel } from '../RegisteredOutputChannel/RegisteredOutputChannel.ts';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ExtensionManagementWorker } from '@lvce-editor/rpc-registry';
|
|
2
|
+
import { ExtensionApiError } from "../ExtensionApiError/ExtensionApiError.js";
|
|
3
|
+
const outputChannels = Object.create(null);
|
|
4
|
+
let isActivated = false;
|
|
5
|
+
const RE_DASH_CASE = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
6
|
+
const assertOutputChannelId = (id) => {
|
|
7
|
+
if (typeof id !== 'string' || id.length === 0) {
|
|
8
|
+
throw new ExtensionApiError('output channel id is required');
|
|
9
|
+
}
|
|
10
|
+
if (!RE_DASH_CASE.test(id)) {
|
|
11
|
+
throw new ExtensionApiError(`output channel id ${id} must be dash-case`);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const assertCanWrite = (id) => {
|
|
15
|
+
if (!isActivated) {
|
|
16
|
+
throw new ExtensionApiError(`output channel ${id} cannot be written before activate`);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
class ExtensionOutputChannel {
|
|
20
|
+
#id;
|
|
21
|
+
constructor(id) {
|
|
22
|
+
this.#id = id;
|
|
23
|
+
}
|
|
24
|
+
async append(text) {
|
|
25
|
+
assertCanWrite(this.#id);
|
|
26
|
+
await ExtensionManagementWorker.invoke('ExtensionApi.appendOutputChannel', this.#id, text);
|
|
27
|
+
}
|
|
28
|
+
async appendLine(text) {
|
|
29
|
+
assertCanWrite(this.#id);
|
|
30
|
+
await ExtensionManagementWorker.invoke('ExtensionApi.appendOutputChannel', this.#id, `${text}\n`);
|
|
31
|
+
}
|
|
32
|
+
async clear() {
|
|
33
|
+
assertCanWrite(this.#id);
|
|
34
|
+
await ExtensionManagementWorker.invoke('ExtensionApi.clearOutputChannel', this.#id);
|
|
35
|
+
}
|
|
36
|
+
async replace(text) {
|
|
37
|
+
assertCanWrite(this.#id);
|
|
38
|
+
await ExtensionManagementWorker.invoke('ExtensionApi.replaceOutputChannel', this.#id, text);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export const activateOutputChannels = () => {
|
|
42
|
+
isActivated = true;
|
|
43
|
+
};
|
|
44
|
+
export const createOutputChannel = (id) => {
|
|
45
|
+
assertOutputChannelId(id);
|
|
46
|
+
if (id in outputChannels) {
|
|
47
|
+
throw new ExtensionApiError(`output channel ${id} is already created`);
|
|
48
|
+
}
|
|
49
|
+
outputChannels[id] = {
|
|
50
|
+
id,
|
|
51
|
+
};
|
|
52
|
+
return new ExtensionOutputChannel(id);
|
|
53
|
+
};
|
|
54
|
+
export const getOutputChannelRegistrySnapshot = () => {
|
|
55
|
+
return {
|
|
56
|
+
outputChannels: Object.values(outputChannels),
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export const resetOutputChannelRegistry = () => {
|
|
60
|
+
for (const id of Object.keys(outputChannels)) {
|
|
61
|
+
delete outputChannels[id];
|
|
62
|
+
}
|
|
63
|
+
isActivated = false;
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/extension-api/dist/parts/OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ExtensionManagementWorker } from '@lvce-editor/rpc-registry';
|
|
2
2
|
export const showQuickPick = async (options) => {
|
|
3
|
-
return
|
|
3
|
+
return ExtensionManagementWorker.invoke('ExtensionHostQuickPick.showQuickPick', options);
|
|
4
4
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registerDiagnosticProvider } from '../DiagnosticProviderRegistry/DiagnosticProviderRegistry.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registerDiagnosticProvider } from "../DiagnosticProviderRegistry/DiagnosticProviderRegistry.js";
|
package/extension-api/dist/parts/RegisteredDiagnosticProvider/RegisteredDiagnosticProvider.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Diagnostic } from '../DiagnosticResult/DiagnosticResult.ts';
|
|
2
|
+
import type { TextDocument } from '../DiagnosticTextDocument/DiagnosticTextDocument.ts';
|
|
3
|
+
export interface RegisteredDiagnosticProvider {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly languageId: string;
|
|
6
|
+
readonly provideDiagnostics: (textDocument: TextDocument, ...args: readonly unknown[]) => readonly Diagnostic[] | Promise<readonly Diagnostic[]>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resetDiagnosticProviderRegistry } from '../DiagnosticProviderRegistry/DiagnosticProviderRegistry.ts';
|
package/extension-api/dist/parts/ResetDiagnosticProviderRegistry/ResetDiagnosticProviderRegistry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resetDiagnosticProviderRegistry } from "../DiagnosticProviderRegistry/DiagnosticProviderRegistry.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface View {
|
|
2
|
+
readonly create: () => unknown;
|
|
3
|
+
readonly icon?: string;
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly title?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RegisteredView {
|
|
8
|
+
readonly icon?: string;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly title?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ViewRegistrySnapshot {
|
|
13
|
+
readonly views: readonly RegisteredView[];
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Disposable } from '../Disposable/Disposable.ts';
|
|
2
|
+
import type { View, ViewRegistrySnapshot } from '../View/View.ts';
|
|
3
|
+
export declare const registerView: (view: View) => Disposable;
|
|
4
|
+
export declare const executeViewProvider: (id: string) => unknown;
|
|
5
|
+
export declare const getViewRegistrySnapshot: () => ViewRegistrySnapshot;
|
|
6
|
+
export declare const resetViewRegistry: () => void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ExtensionApiError } from "../ExtensionApiError/ExtensionApiError.js";
|
|
2
|
+
const views = Object.create(null);
|
|
3
|
+
const assertView = (view) => {
|
|
4
|
+
if (!view) {
|
|
5
|
+
throw new ExtensionApiError('view is not defined');
|
|
6
|
+
}
|
|
7
|
+
if (typeof view.id !== 'string' || view.id.length === 0) {
|
|
8
|
+
throw new ExtensionApiError('view is missing id');
|
|
9
|
+
}
|
|
10
|
+
if (typeof view.create !== 'function') {
|
|
11
|
+
throw new ExtensionApiError(`view ${view.id} is missing create function`);
|
|
12
|
+
}
|
|
13
|
+
if (view.id in views) {
|
|
14
|
+
throw new ExtensionApiError(`view ${view.id} is already registered`);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const toRegisteredView = (view) => {
|
|
18
|
+
return {
|
|
19
|
+
icon: view.icon,
|
|
20
|
+
id: view.id,
|
|
21
|
+
title: view.title,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export const registerView = (view) => {
|
|
25
|
+
assertView(view);
|
|
26
|
+
views[view.id] = view;
|
|
27
|
+
return {
|
|
28
|
+
dispose() {
|
|
29
|
+
delete views[view.id];
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export const executeViewProvider = (id) => {
|
|
34
|
+
const view = views[id];
|
|
35
|
+
if (!view) {
|
|
36
|
+
throw new ExtensionApiError(`view ${id} not found`);
|
|
37
|
+
}
|
|
38
|
+
return view.create();
|
|
39
|
+
};
|
|
40
|
+
export const getViewRegistrySnapshot = () => {
|
|
41
|
+
return {
|
|
42
|
+
views: Object.values(views).map(toRegisteredView),
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export const resetViewRegistry = () => {
|
|
46
|
+
for (const id of Object.keys(views)) {
|
|
47
|
+
delete views[id];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/api",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.24.0",
|
|
4
4
|
"description": "Tree-shakeable extension API for Lvce Editor extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lvce-editor",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@lvce-editor/rpc": "^6.4.0"
|
|
30
|
+
"@lvce-editor/rpc": "^6.4.0",
|
|
31
|
+
"@lvce-editor/rpc-registry": "^9.24.0"
|
|
31
32
|
}
|
|
32
33
|
}
|