@lvce-editor/api 8.58.0 → 8.59.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/index.d.ts +5 -1
- package/dist/index.js +2 -1
- package/dist/parts/CommandMap/CommandMap.d.ts +3 -0
- package/dist/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.d.ts +3 -0
- package/dist/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.js +5 -1
- package/dist/parts/ExtensionApiWorkerCommandMap/ExtensionApiWorkerCommandMap.d.ts +3 -0
- package/dist/parts/FileSystemProvider/FileSystemProvider.d.ts +4 -0
- package/dist/parts/FileSystemProvider/FileSystemProvider.js +1 -0
- package/dist/parts/FileSystemProviderRegistry/FileSystemProviderRegistry.d.ts +7 -0
- package/dist/parts/FileSystemProviderRegistry/FileSystemProviderRegistry.js +50 -0
- package/dist/parts/FileSystemProviderRegistrySnapshot/FileSystemProviderRegistrySnapshot.d.ts +5 -0
- package/dist/parts/FileSystemProviderRegistrySnapshot/FileSystemProviderRegistrySnapshot.js +1 -0
- package/dist/parts/RegisteredFileSystemProvider/RegisteredFileSystemProvider.d.ts +4 -0
- package/dist/parts/RegisteredFileSystemProvider/RegisteredFileSystemProvider.js +1 -0
- package/dist/parts/RegisteredSourceControlProvider/RegisteredSourceControlProvider.d.ts +1 -0
- package/dist/parts/SourceControl/SourceControl.d.ts +1 -1
- package/dist/parts/SourceControl/SourceControl.js +1 -1
- package/dist/parts/SourceControlProvider/SourceControlProvider.d.ts +1 -0
- package/dist/parts/SourceControlProviderRegistry/SourceControlProviderRegistry.d.ts +1 -0
- package/dist/parts/SourceControlProviderRegistry/SourceControlProviderRegistry.js +18 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export { executeCompletionProvider, executeResolveCompletionItemProvider, getCom
|
|
|
9
9
|
export { executeDiagnosticProvider, getDiagnosticProviderRegistrySnapshot, registerDiagnosticProvider, resetDiagnosticProviderRegistry, } from './parts/Diagnostic/Diagnostic.ts';
|
|
10
10
|
export { executeFormattingProvider, getFormattingProviderRegistrySnapshot, registerFormattingProvider, resetFormattingProviderRegistry, } from './parts/Formatting/Formatting.ts';
|
|
11
11
|
export { exists, mkdir, readDirWithFileTypes, readFile, remove, stat, writeFile } from './parts/FileSystem/FileSystem.ts';
|
|
12
|
+
export { executeFileSystemProviderReadFile, getFileSystemProviderRegistrySnapshot, registerFileSystemProvider, resetFileSystemProviderRegistry, } from './parts/FileSystemProviderRegistry/FileSystemProviderRegistry.ts';
|
|
12
13
|
export { confirm, getWorkspaceFolder, getWorkspaceUri, handleWorkspaceRefresh, openUri } from './parts/Host/Host.ts';
|
|
13
14
|
export { executeHoverProvider, getHoverProviderRegistrySnapshot, registerHoverProvider, resetHoverProviderRegistry } from './parts/Hover/Hover.ts';
|
|
14
15
|
export { getPlatform, type Platform } from './parts/Platform/Platform.ts';
|
|
15
16
|
export { getLanguageServerRegistrySnapshot, registerLanguageServer, resetLanguageServerRegistry } from './parts/LanguageServer/LanguageServer.ts';
|
|
16
17
|
export { registerBraceCompletionProvider, registerClosingTagProvider, registerCodeActionsProvider, registerCommentProvider, registerDefinitionProvider, registerImplementationProvider, registerReferenceProvider, registerRenameProvider, registerSelectionProvider, registerTabCompletionProvider, registerTypeDefinitionProvider, resetLanguageProviderRegistry, } from './parts/LanguageProvider/LanguageProvider.ts';
|
|
17
18
|
export type { LanguageProvider } from './parts/LanguageProvider/LanguageProvider.ts';
|
|
18
|
-
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from './parts/SourceControl/SourceControl.ts';
|
|
19
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from './parts/SourceControl/SourceControl.ts';
|
|
19
20
|
export { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewRegistrySnapshot, renderViewInstance, registerView, resetViewRegistry, saveViewInstanceState, } from './parts/ViewRegistry/ViewRegistry.ts';
|
|
20
21
|
export { createOutputChannel, getOutputChannelRegistrySnapshot, resetOutputChannelRegistry } from './parts/OutputChannel/OutputChannel.ts';
|
|
21
22
|
export { getStatusBarItemProviderRegistrySnapshot, registerStatusBarItemProvider, resetStatusBarItemProviderRegistry, } from './parts/StatusBar/StatusBar.ts';
|
|
@@ -31,6 +32,9 @@ export type { Disposable } from './parts/Disposable/Disposable.ts';
|
|
|
31
32
|
export type { CreateElectronWebContentsViewOptions, ElectronWebContentsView, ElectronWebContentsViewStats, } from './parts/ElectronWebContentsView/ElectronWebContentsView.ts';
|
|
32
33
|
export type { FormattingEdit, FormattingProvider, FormattingProviderRegistrySnapshot, RegisteredFormattingProvider, } from './parts/Formatting/Formatting.ts';
|
|
33
34
|
export type { FileSystemDirent } from './parts/FileSystem/FileSystem.ts';
|
|
35
|
+
export type { FileSystemProvider } from './parts/FileSystemProvider/FileSystemProvider.ts';
|
|
36
|
+
export type { FileSystemProviderRegistrySnapshot } from './parts/FileSystemProviderRegistrySnapshot/FileSystemProviderRegistrySnapshot.ts';
|
|
37
|
+
export type { RegisteredFileSystemProvider } from './parts/RegisteredFileSystemProvider/RegisteredFileSystemProvider.ts';
|
|
34
38
|
export type { HandleExtensionManagementMessagePortOptions } from './parts/HandleExtensionManagementMessagePort/HandleExtensionManagementMessagePort.ts';
|
|
35
39
|
export type { HoverProvider, HoverProviderRegistrySnapshot, HoverResult, RegisteredHoverProvider } from './parts/Hover/Hover.ts';
|
|
36
40
|
export type { LanguageServerOptions, LanguageServerRegistrySnapshot } from './parts/LanguageServer/LanguageServer.ts';
|
package/dist/index.js
CHANGED
|
@@ -9,12 +9,13 @@ export { executeCompletionProvider, executeResolveCompletionItemProvider, getCom
|
|
|
9
9
|
export { executeDiagnosticProvider, getDiagnosticProviderRegistrySnapshot, registerDiagnosticProvider, resetDiagnosticProviderRegistry, } from "./parts/Diagnostic/Diagnostic.js";
|
|
10
10
|
export { executeFormattingProvider, getFormattingProviderRegistrySnapshot, registerFormattingProvider, resetFormattingProviderRegistry, } from "./parts/Formatting/Formatting.js";
|
|
11
11
|
export { exists, mkdir, readDirWithFileTypes, readFile, remove, stat, writeFile } from "./parts/FileSystem/FileSystem.js";
|
|
12
|
+
export { executeFileSystemProviderReadFile, getFileSystemProviderRegistrySnapshot, registerFileSystemProvider, resetFileSystemProviderRegistry, } from "./parts/FileSystemProviderRegistry/FileSystemProviderRegistry.js";
|
|
12
13
|
export { confirm, getWorkspaceFolder, getWorkspaceUri, handleWorkspaceRefresh, openUri } from "./parts/Host/Host.js";
|
|
13
14
|
export { executeHoverProvider, getHoverProviderRegistrySnapshot, registerHoverProvider, resetHoverProviderRegistry } from "./parts/Hover/Hover.js";
|
|
14
15
|
export { getPlatform } from "./parts/Platform/Platform.js";
|
|
15
16
|
export { getLanguageServerRegistrySnapshot, registerLanguageServer, resetLanguageServerRegistry } from "./parts/LanguageServer/LanguageServer.js";
|
|
16
17
|
export { registerBraceCompletionProvider, registerClosingTagProvider, registerCodeActionsProvider, registerCommentProvider, registerDefinitionProvider, registerImplementationProvider, registerReferenceProvider, registerRenameProvider, registerSelectionProvider, registerTabCompletionProvider, registerTypeDefinitionProvider, resetLanguageProviderRegistry, } from "./parts/LanguageProvider/LanguageProvider.js";
|
|
17
|
-
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "./parts/SourceControl/SourceControl.js";
|
|
18
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "./parts/SourceControl/SourceControl.js";
|
|
18
19
|
export { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewRegistrySnapshot, renderViewInstance, registerView, resetViewRegistry, saveViewInstanceState, } from "./parts/ViewRegistry/ViewRegistry.js";
|
|
19
20
|
export { createOutputChannel, getOutputChannelRegistrySnapshot, resetOutputChannelRegistry } from "./parts/OutputChannel/OutputChannel.js";
|
|
20
21
|
export { getStatusBarItemProviderRegistrySnapshot, registerStatusBarItemProvider, resetStatusBarItemProviderRegistry, } from "./parts/StatusBar/StatusBar.js";
|
|
@@ -6,6 +6,7 @@ export declare const commandMap: {
|
|
|
6
6
|
'ExtensionApi.executeCommand': (id: string, ...args: readonly unknown[]) => Promise<unknown>;
|
|
7
7
|
'ExtensionApi.executeCompletionProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<readonly import("../CompletionItem/CompletionItem.ts").CompletionItem[]>;
|
|
8
8
|
'ExtensionApi.executeDiagnosticProvider': (textDocument: import("../DiagnosticTextDocument/DiagnosticTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../DiagnosticResult/DiagnosticResult.ts").Diagnostic[]>;
|
|
9
|
+
'ExtensionApi.executeFileSystemProviderReadFile': (id: string, uri: string) => Promise<string>;
|
|
9
10
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
10
11
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
11
12
|
'ExtensionApi.executeLanguageProvider': (kind: string, methodName: string, textDocument: {
|
|
@@ -23,6 +24,7 @@ export declare const commandMap: {
|
|
|
23
24
|
'ExtensionApi.executeSourceControlGetChangedFiles': (id: string) => Promise<readonly unknown[]>;
|
|
24
25
|
'ExtensionApi.executeSourceControlGetFeatures': (id: string) => Promise<unknown>;
|
|
25
26
|
'ExtensionApi.executeSourceControlGetFileBefore': (id: string, uri: string) => Promise<unknown>;
|
|
27
|
+
'ExtensionApi.executeSourceControlGetFileBeforeUri': (id: string, uri: string) => Promise<string>;
|
|
26
28
|
'ExtensionApi.executeSourceControlGetFileDecorations': (id: string, uris: readonly string[]) => Promise<unknown>;
|
|
27
29
|
'ExtensionApi.executeSourceControlGetGroups': (id: string, cwd: string) => Promise<unknown>;
|
|
28
30
|
'ExtensionApi.executeSourceControlIsActive': (id: string, scheme: string, root: string) => Promise<boolean>;
|
|
@@ -30,6 +32,7 @@ export declare const commandMap: {
|
|
|
30
32
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
31
33
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
32
34
|
'ExtensionApi.getDiagnosticProviderRegistrySnapshot': () => import("../DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.ts").DiagnosticProviderRegistrySnapshot;
|
|
35
|
+
'ExtensionApi.getFileSystemProviderRegistrySnapshot': () => import("../FileSystemProviderRegistrySnapshot/FileSystemProviderRegistrySnapshot.ts").FileSystemProviderRegistrySnapshot;
|
|
33
36
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
34
37
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
35
38
|
'ExtensionApi.getLanguageServerRegistrySnapshot': () => import("../LanguageServerRegistrySnapshot/LanguageServerRegistrySnapshot.ts").LanguageServerRegistrySnapshot;
|
|
@@ -5,6 +5,7 @@ export declare const commandMap: {
|
|
|
5
5
|
'ExtensionApi.executeCommand': (id: string, ...args: readonly unknown[]) => Promise<unknown>;
|
|
6
6
|
'ExtensionApi.executeCompletionProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<readonly import("../CompletionItem/CompletionItem.ts").CompletionItem[]>;
|
|
7
7
|
'ExtensionApi.executeDiagnosticProvider': (textDocument: import("../DiagnosticTextDocument/DiagnosticTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../DiagnosticResult/DiagnosticResult.ts").Diagnostic[]>;
|
|
8
|
+
'ExtensionApi.executeFileSystemProviderReadFile': (id: string, uri: string) => Promise<string>;
|
|
8
9
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
9
10
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
10
11
|
'ExtensionApi.executeLanguageProvider': (kind: string, methodName: string, textDocument: {
|
|
@@ -22,6 +23,7 @@ export declare const commandMap: {
|
|
|
22
23
|
'ExtensionApi.executeSourceControlGetChangedFiles': (id: string) => Promise<readonly unknown[]>;
|
|
23
24
|
'ExtensionApi.executeSourceControlGetFeatures': (id: string) => Promise<unknown>;
|
|
24
25
|
'ExtensionApi.executeSourceControlGetFileBefore': (id: string, uri: string) => Promise<unknown>;
|
|
26
|
+
'ExtensionApi.executeSourceControlGetFileBeforeUri': (id: string, uri: string) => Promise<string>;
|
|
25
27
|
'ExtensionApi.executeSourceControlGetFileDecorations': (id: string, uris: readonly string[]) => Promise<unknown>;
|
|
26
28
|
'ExtensionApi.executeSourceControlGetGroups': (id: string, cwd: string) => Promise<unknown>;
|
|
27
29
|
'ExtensionApi.executeSourceControlIsActive': (id: string, scheme: string, root: string) => Promise<boolean>;
|
|
@@ -29,6 +31,7 @@ export declare const commandMap: {
|
|
|
29
31
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
30
32
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
31
33
|
'ExtensionApi.getDiagnosticProviderRegistrySnapshot': () => import("../DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.ts").DiagnosticProviderRegistrySnapshot;
|
|
34
|
+
'ExtensionApi.getFileSystemProviderRegistrySnapshot': () => import("../FileSystemProviderRegistrySnapshot/FileSystemProviderRegistrySnapshot.ts").FileSystemProviderRegistrySnapshot;
|
|
32
35
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
33
36
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
34
37
|
'ExtensionApi.getLanguageServerRegistrySnapshot': () => import("../LanguageServerRegistrySnapshot/LanguageServerRegistrySnapshot.ts").LanguageServerRegistrySnapshot;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { executeCommand, getCommandRegistrySnapshot } from "../CommandRegistry/CommandRegistry.js";
|
|
2
2
|
import { executeCompletionProvider, executeResolveCompletionItemProvider, getCompletionProviderRegistrySnapshot } from "../Completion/Completion.js";
|
|
3
3
|
import { executeDiagnosticProvider, getDiagnosticProviderRegistrySnapshot } from "../Diagnostic/Diagnostic.js";
|
|
4
|
+
import { executeFileSystemProviderReadFile, getFileSystemProviderRegistrySnapshot } from "../FileSystemProviderRegistry/FileSystemProviderRegistry.js";
|
|
4
5
|
import { executeFormattingProvider, getFormattingProviderRegistrySnapshot } from "../Formatting/Formatting.js";
|
|
5
6
|
import { getStatusBarItems } from "../GetStatusBarItems/GetStatusBarItems.js";
|
|
6
7
|
import { executeHoverProvider, getHoverProviderRegistrySnapshot } from "../Hover/Hover.js";
|
|
7
8
|
import { executeLanguageProvider, executeOrganizeImportsProvider } from "../LanguageProvider/LanguageProvider.js";
|
|
8
9
|
import { getLanguageServerRegistrySnapshot } from "../LanguageServer/LanguageServer.js";
|
|
9
10
|
import { getOutputChannelRegistrySnapshot } from "../OutputChannel/OutputChannel.js";
|
|
10
|
-
import { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, } from "../SourceControl/SourceControl.js";
|
|
11
|
+
import { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, } from "../SourceControl/SourceControl.js";
|
|
11
12
|
import { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewActions, getViewActionsDom, getViewMenuEntries, getViewRegistrySnapshot, renderViewInstance, saveViewInstanceState, } from "../ViewRegistry/ViewRegistry.js";
|
|
12
13
|
export const commandMap = {
|
|
13
14
|
'ExtensionApi.createViewInstance': createViewInstance,
|
|
@@ -16,6 +17,7 @@ export const commandMap = {
|
|
|
16
17
|
'ExtensionApi.executeCommand': executeCommand,
|
|
17
18
|
'ExtensionApi.executeCompletionProvider': executeCompletionProvider,
|
|
18
19
|
'ExtensionApi.executeDiagnosticProvider': executeDiagnosticProvider,
|
|
20
|
+
'ExtensionApi.executeFileSystemProviderReadFile': executeFileSystemProviderReadFile,
|
|
19
21
|
'ExtensionApi.executeFormattingProvider': executeFormattingProvider,
|
|
20
22
|
'ExtensionApi.executeHoverProvider': executeHoverProvider,
|
|
21
23
|
'ExtensionApi.executeLanguageProvider': executeLanguageProvider,
|
|
@@ -29,6 +31,7 @@ export const commandMap = {
|
|
|
29
31
|
'ExtensionApi.executeSourceControlGetChangedFiles': executeSourceControlGetChangedFiles,
|
|
30
32
|
'ExtensionApi.executeSourceControlGetFeatures': executeSourceControlGetFeatures,
|
|
31
33
|
'ExtensionApi.executeSourceControlGetFileBefore': executeSourceControlGetFileBefore,
|
|
34
|
+
'ExtensionApi.executeSourceControlGetFileBeforeUri': executeSourceControlGetFileBeforeUri,
|
|
32
35
|
'ExtensionApi.executeSourceControlGetFileDecorations': executeSourceControlGetFileDecorations,
|
|
33
36
|
'ExtensionApi.executeSourceControlGetGroups': executeSourceControlGetGroups,
|
|
34
37
|
'ExtensionApi.executeSourceControlIsActive': executeSourceControlIsActive,
|
|
@@ -36,6 +39,7 @@ export const commandMap = {
|
|
|
36
39
|
'ExtensionApi.getCommandRegistrySnapshot': getCommandRegistrySnapshot,
|
|
37
40
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': getCompletionProviderRegistrySnapshot,
|
|
38
41
|
'ExtensionApi.getDiagnosticProviderRegistrySnapshot': getDiagnosticProviderRegistrySnapshot,
|
|
42
|
+
'ExtensionApi.getFileSystemProviderRegistrySnapshot': getFileSystemProviderRegistrySnapshot,
|
|
39
43
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': getFormattingProviderRegistrySnapshot,
|
|
40
44
|
'ExtensionApi.getHoverProviderRegistrySnapshot': getHoverProviderRegistrySnapshot,
|
|
41
45
|
'ExtensionApi.getLanguageServerRegistrySnapshot': getLanguageServerRegistrySnapshot,
|
|
@@ -7,6 +7,7 @@ export declare const commandMap: {
|
|
|
7
7
|
'ExtensionApi.executeCommand': (id: string, ...args: readonly unknown[]) => Promise<unknown>;
|
|
8
8
|
'ExtensionApi.executeCompletionProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<readonly import("../CompletionItem/CompletionItem.ts").CompletionItem[]>;
|
|
9
9
|
'ExtensionApi.executeDiagnosticProvider': (textDocument: import("../DiagnosticTextDocument/DiagnosticTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../DiagnosticResult/DiagnosticResult.ts").Diagnostic[]>;
|
|
10
|
+
'ExtensionApi.executeFileSystemProviderReadFile': (id: string, uri: string) => Promise<string>;
|
|
10
11
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
11
12
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
12
13
|
'ExtensionApi.executeLanguageProvider': (kind: string, methodName: string, textDocument: {
|
|
@@ -24,6 +25,7 @@ export declare const commandMap: {
|
|
|
24
25
|
'ExtensionApi.executeSourceControlGetChangedFiles': (id: string) => Promise<readonly unknown[]>;
|
|
25
26
|
'ExtensionApi.executeSourceControlGetFeatures': (id: string) => Promise<unknown>;
|
|
26
27
|
'ExtensionApi.executeSourceControlGetFileBefore': (id: string, uri: string) => Promise<unknown>;
|
|
28
|
+
'ExtensionApi.executeSourceControlGetFileBeforeUri': (id: string, uri: string) => Promise<string>;
|
|
27
29
|
'ExtensionApi.executeSourceControlGetFileDecorations': (id: string, uris: readonly string[]) => Promise<unknown>;
|
|
28
30
|
'ExtensionApi.executeSourceControlGetGroups': (id: string, cwd: string) => Promise<unknown>;
|
|
29
31
|
'ExtensionApi.executeSourceControlIsActive': (id: string, scheme: string, root: string) => Promise<boolean>;
|
|
@@ -31,6 +33,7 @@ export declare const commandMap: {
|
|
|
31
33
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
32
34
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
33
35
|
'ExtensionApi.getDiagnosticProviderRegistrySnapshot': () => import("../DiagnosticProviderRegistrySnapshot/DiagnosticProviderRegistrySnapshot.ts").DiagnosticProviderRegistrySnapshot;
|
|
36
|
+
'ExtensionApi.getFileSystemProviderRegistrySnapshot': () => import("../FileSystemProviderRegistrySnapshot/FileSystemProviderRegistrySnapshot.ts").FileSystemProviderRegistrySnapshot;
|
|
34
37
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
35
38
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
36
39
|
'ExtensionApi.getLanguageServerRegistrySnapshot': () => import("../LanguageServerRegistrySnapshot/LanguageServerRegistrySnapshot.ts").LanguageServerRegistrySnapshot;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Disposable } from '../Disposable/Disposable.ts';
|
|
2
|
+
import type { FileSystemProvider } from '../FileSystemProvider/FileSystemProvider.ts';
|
|
3
|
+
import type { FileSystemProviderRegistrySnapshot } from '../FileSystemProviderRegistrySnapshot/FileSystemProviderRegistrySnapshot.ts';
|
|
4
|
+
export declare const executeFileSystemProviderReadFile: (id: string, uri: string) => Promise<string>;
|
|
5
|
+
export declare const getFileSystemProviderRegistrySnapshot: () => FileSystemProviderRegistrySnapshot;
|
|
6
|
+
export declare const registerFileSystemProvider: (provider: FileSystemProvider) => Disposable;
|
|
7
|
+
export declare const resetFileSystemProviderRegistry: () => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ExtensionApiError } from "../ExtensionApiError/ExtensionApiError.js";
|
|
2
|
+
const providers = Object.create(null);
|
|
3
|
+
const assertFileSystemProvider = (provider) => {
|
|
4
|
+
if (!provider) {
|
|
5
|
+
throw new ExtensionApiError('file system provider is not defined');
|
|
6
|
+
}
|
|
7
|
+
if (typeof provider.id !== 'string' || provider.id.length === 0) {
|
|
8
|
+
throw new ExtensionApiError('file system provider is missing id');
|
|
9
|
+
}
|
|
10
|
+
if (typeof provider.readFile !== 'function') {
|
|
11
|
+
throw new ExtensionApiError(`file system provider ${provider.id} is missing readFile function`);
|
|
12
|
+
}
|
|
13
|
+
if (provider.id in providers) {
|
|
14
|
+
throw new ExtensionApiError(`file system provider ${provider.id} is already registered`);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const getProvider = (id) => {
|
|
18
|
+
const provider = providers[id];
|
|
19
|
+
if (!provider) {
|
|
20
|
+
throw new ExtensionApiError(`file system provider ${id} not found`);
|
|
21
|
+
}
|
|
22
|
+
return provider;
|
|
23
|
+
};
|
|
24
|
+
export const executeFileSystemProviderReadFile = async (id, uri) => {
|
|
25
|
+
return getProvider(id).readFile(uri);
|
|
26
|
+
};
|
|
27
|
+
export const getFileSystemProviderRegistrySnapshot = () => {
|
|
28
|
+
return {
|
|
29
|
+
providers: Object.values(providers).map((provider) => ({
|
|
30
|
+
id: provider.id,
|
|
31
|
+
})),
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export const registerFileSystemProvider = (provider) => {
|
|
35
|
+
assertFileSystemProvider(provider);
|
|
36
|
+
providers[provider.id] = {
|
|
37
|
+
id: provider.id,
|
|
38
|
+
readFile: (uri) => provider.readFile(uri),
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
dispose() {
|
|
42
|
+
delete providers[provider.id];
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export const resetFileSystemProviderRegistry = () => {
|
|
47
|
+
for (const id of Object.keys(providers)) {
|
|
48
|
+
delete providers[id];
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export interface RegisteredSourceControlProvider {
|
|
|
7
7
|
readonly getChangedFiles: () => readonly unknown[] | Promise<readonly unknown[]>;
|
|
8
8
|
readonly getFeatures?: () => unknown | Promise<unknown>;
|
|
9
9
|
readonly getFileBefore?: (uri: string) => unknown | Promise<unknown>;
|
|
10
|
+
readonly getFileBeforeUri?: (uri: string) => string | Promise<string>;
|
|
10
11
|
readonly getFileDecorations?: (uris: readonly string[]) => unknown | Promise<unknown>;
|
|
11
12
|
readonly getGroups?: (cwd: string) => unknown | Promise<unknown>;
|
|
12
13
|
readonly id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from '../SourceControlProviderRegistry/SourceControlProviderRegistry.ts';
|
|
1
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from '../SourceControlProviderRegistry/SourceControlProviderRegistry.ts';
|
|
2
2
|
export type { RegisteredSourceControlProvider } from '../RegisteredSourceControlProvider/RegisteredSourceControlProvider.ts';
|
|
3
3
|
export type { SourceControlProvider } from '../SourceControlProvider/SourceControlProvider.ts';
|
|
4
4
|
export type { SourceControlProviderRegistrySnapshot } from '../SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "../SourceControlProviderRegistry/SourceControlProviderRegistry.js";
|
|
1
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "../SourceControlProviderRegistry/SourceControlProviderRegistry.js";
|
|
@@ -7,6 +7,7 @@ export interface SourceControlProvider {
|
|
|
7
7
|
readonly getChangedFiles: () => readonly unknown[] | Promise<readonly unknown[]>;
|
|
8
8
|
readonly getFeatures?: () => unknown | Promise<unknown>;
|
|
9
9
|
readonly getFileBefore?: (uri: string) => unknown | Promise<unknown>;
|
|
10
|
+
readonly getFileBeforeUri?: (uri: string) => string | Promise<string>;
|
|
10
11
|
readonly getFileDecorations?: (uris: readonly string[]) => unknown | Promise<unknown>;
|
|
11
12
|
readonly getGroups?: (cwd: string) => unknown | Promise<unknown>;
|
|
12
13
|
readonly id: string;
|
|
@@ -10,6 +10,7 @@ export declare const executeSourceControlGetChangedFiles: (id: string) => Promis
|
|
|
10
10
|
export declare const executeSourceControlGetBadgeCount: (id: string) => Promise<number>;
|
|
11
11
|
export declare const executeSourceControlGetFeatures: (id: string) => Promise<unknown>;
|
|
12
12
|
export declare const executeSourceControlGetFileBefore: (id: string, uri: string) => Promise<unknown>;
|
|
13
|
+
export declare const executeSourceControlGetFileBeforeUri: (id: string, uri: string) => Promise<string>;
|
|
13
14
|
export declare const executeSourceControlGetFileDecorations: (id: string, uris: readonly string[]) => Promise<unknown>;
|
|
14
15
|
export declare const executeSourceControlGetGroups: (id: string, cwd: string) => Promise<unknown>;
|
|
15
16
|
export declare const executeSourceControlIsActive: (id: string, scheme: string, root: string) => Promise<boolean>;
|
|
@@ -8,6 +8,7 @@ const optionalMethods = [
|
|
|
8
8
|
'getBadgeCount',
|
|
9
9
|
'getFeatures',
|
|
10
10
|
'getFileBefore',
|
|
11
|
+
'getFileBeforeUri',
|
|
11
12
|
'getFileDecorations',
|
|
12
13
|
'getGroups',
|
|
13
14
|
'isActive',
|
|
@@ -69,6 +70,9 @@ const mapSourceControlProvider = (provider) => {
|
|
|
69
70
|
if (provider.getFileBefore) {
|
|
70
71
|
registeredProvider.getFileBefore = (uri) => provider.getFileBefore(uri);
|
|
71
72
|
}
|
|
73
|
+
if (provider.getFileBeforeUri) {
|
|
74
|
+
registeredProvider.getFileBeforeUri = (uri) => provider.getFileBeforeUri(uri);
|
|
75
|
+
}
|
|
72
76
|
if (provider.getFileDecorations) {
|
|
73
77
|
registeredProvider.getFileDecorations = (uris) => provider.getFileDecorations(uris);
|
|
74
78
|
}
|
|
@@ -118,6 +122,20 @@ export const executeSourceControlGetFeatures = async (id) => {
|
|
|
118
122
|
export const executeSourceControlGetFileBefore = async (id, uri) => {
|
|
119
123
|
return getProvider(id).getFileBefore?.(uri);
|
|
120
124
|
};
|
|
125
|
+
export const executeSourceControlGetFileBeforeUri = async (id, uri) => {
|
|
126
|
+
const provider = getProvider(id);
|
|
127
|
+
if (provider.getFileBeforeUri) {
|
|
128
|
+
return provider.getFileBeforeUri(uri);
|
|
129
|
+
}
|
|
130
|
+
const content = await provider.getFileBefore?.(uri);
|
|
131
|
+
if (content === undefined) {
|
|
132
|
+
return 'data://';
|
|
133
|
+
}
|
|
134
|
+
if (typeof content !== 'string') {
|
|
135
|
+
throw new ExtensionApiError(`source control provider ${id} returned an invalid getFileBefore result`);
|
|
136
|
+
}
|
|
137
|
+
return `data://${content}`;
|
|
138
|
+
};
|
|
121
139
|
export const executeSourceControlGetFileDecorations = async (id, uris) => {
|
|
122
140
|
return getProvider(id).getFileDecorations?.(uris) ?? [];
|
|
123
141
|
};
|