@lvce-editor/api 9.33.0 → 9.33.2
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/parts/FileSystemProvider/FileSystemProvider.d.ts +1 -0
- package/dist/parts/FileSystemProviderRegistry/FileSystemProviderRegistry.d.ts +1 -0
- package/dist/parts/FileSystemProviderRegistry/FileSystemProviderRegistry.js +9 -0
- package/dist/parts/RegisteredFileSystemProvider/RegisteredFileSystemProvider.d.ts +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 +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export { openDebugConsole, openOutputView, openProblemsView, type OpenDebugConso
|
|
|
26
26
|
export { getLanguageServerRegistrySnapshot, registerLanguageServer, resetLanguageServerRegistry } from './parts/LanguageServer/LanguageServer.ts';
|
|
27
27
|
export { registerBraceCompletionProvider, registerClosingTagProvider, registerCodeActionsProvider, registerCommentProvider, registerDefinitionProvider, registerDocumentSymbolProvider, registerImplementationProvider, registerReferenceProvider, registerRenameProvider, registerSelectionProvider, registerTabCompletionProvider, registerTypeDefinitionProvider, resetLanguageProviderRegistry, } from './parts/LanguageProvider/LanguageProvider.ts';
|
|
28
28
|
export type { DocumentSymbol, DocumentSymbolProvider, DocumentSymbolTextDocument, LanguageProvider, } from './parts/LanguageProvider/LanguageProvider.ts';
|
|
29
|
-
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from './parts/SourceControl/SourceControl.ts';
|
|
29
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetCurrentBranch, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from './parts/SourceControl/SourceControl.ts';
|
|
30
30
|
export { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewInstanceState, getViewRegistrySnapshot, renderViewInstance, registerView, resetViewRegistry, saveViewInstanceState, setViewInstanceState, setViewInstanceActive, } from './parts/ViewRegistry/ViewRegistry.ts';
|
|
31
31
|
export * as ViewletStates from './parts/PublicViewletStates/PublicViewletStates.ts';
|
|
32
32
|
export { createOutputChannel, getOutputChannelLogs, getOutputChannelRegistrySnapshot, resetOutputChannelRegistry, } from './parts/OutputChannel/OutputChannel.ts';
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export { openProcessExplorer } from "./parts/ProcessExplorer/ProcessExplorer.js"
|
|
|
25
25
|
export { openDebugConsole, openOutputView, openProblemsView, } from "./parts/Panel/Panel.js";
|
|
26
26
|
export { getLanguageServerRegistrySnapshot, registerLanguageServer, resetLanguageServerRegistry } from "./parts/LanguageServer/LanguageServer.js";
|
|
27
27
|
export { registerBraceCompletionProvider, registerClosingTagProvider, registerCodeActionsProvider, registerCommentProvider, registerDefinitionProvider, registerDocumentSymbolProvider, registerImplementationProvider, registerReferenceProvider, registerRenameProvider, registerSelectionProvider, registerTabCompletionProvider, registerTypeDefinitionProvider, resetLanguageProviderRegistry, } from "./parts/LanguageProvider/LanguageProvider.js";
|
|
28
|
-
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "./parts/SourceControl/SourceControl.js";
|
|
28
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetCurrentBranch, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "./parts/SourceControl/SourceControl.js";
|
|
29
29
|
export { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewInstanceState, getViewRegistrySnapshot, renderViewInstance, registerView, resetViewRegistry, saveViewInstanceState, setViewInstanceState, setViewInstanceActive, } from "./parts/ViewRegistry/ViewRegistry.js";
|
|
30
30
|
export * as ViewletStates from "./parts/PublicViewletStates/PublicViewletStates.js";
|
|
31
31
|
export { createOutputChannel, getOutputChannelLogs, getOutputChannelRegistrySnapshot, resetOutputChannelRegistry, } from "./parts/OutputChannel/OutputChannel.js";
|
|
@@ -7,5 +7,6 @@ export interface FileSystemProvider {
|
|
|
7
7
|
readonly readFile: (uri: string) => Blob | Promise<Blob | string> | string;
|
|
8
8
|
readonly remove?: (uri: string) => void | Promise<void>;
|
|
9
9
|
readonly rename?: (oldUri: string, newUri: string) => void | Promise<void>;
|
|
10
|
+
readonly stat?: (uri: string) => number | Promise<number>;
|
|
10
11
|
readonly writeFile?: (uri: string, content: string) => void | Promise<void>;
|
|
11
12
|
}
|
|
@@ -8,6 +8,7 @@ export declare const executeFileSystemProviderRemove: (id: string, uri: string)
|
|
|
8
8
|
export declare const executeFileSystemProviderRename: (id: string, oldUri: string, newUri: string) => Promise<void>;
|
|
9
9
|
export declare const executeFileSystemProviderWriteFile: (id: string, uri: string, content: string) => Promise<void>;
|
|
10
10
|
export declare const executeFileSystemProviderReadDirWithFileTypes: (id: string, uri: string) => Promise<readonly FileSystemDirent[]>;
|
|
11
|
+
export declare const executeFileSystemProviderStat: (id: string, uri: string) => Promise<number>;
|
|
11
12
|
export declare const executeFileSystemProviderIsReadonly: (id: string) => Promise<boolean>;
|
|
12
13
|
export declare const getFileSystemProviderRegistrySnapshot: () => FileSystemProviderRegistrySnapshot;
|
|
13
14
|
export declare const registerFileSystemProvider: (provider: FileSystemProvider) => Disposable;
|
|
@@ -71,6 +71,13 @@ export const executeFileSystemProviderReadDirWithFileTypes = async (id, uri) =>
|
|
|
71
71
|
}
|
|
72
72
|
return provider.readDirWithFileTypes(uri);
|
|
73
73
|
};
|
|
74
|
+
export const executeFileSystemProviderStat = async (id, uri) => {
|
|
75
|
+
const provider = getProvider(id);
|
|
76
|
+
if (!provider.stat) {
|
|
77
|
+
throw new ExtensionApiError(`file system provider ${id} is missing stat function`);
|
|
78
|
+
}
|
|
79
|
+
return provider.stat(uri);
|
|
80
|
+
};
|
|
74
81
|
export const executeFileSystemProviderIsReadonly = async (id) => {
|
|
75
82
|
const provider = getProvider(id);
|
|
76
83
|
return provider.isReadonly ? provider.isReadonly() : false;
|
|
@@ -92,6 +99,7 @@ export const registerFileSystemProvider = (provider) => {
|
|
|
92
99
|
readFile: (uri) => provider.readFile(uri),
|
|
93
100
|
remove: provider.remove,
|
|
94
101
|
rename: provider.rename,
|
|
102
|
+
stat: provider.stat,
|
|
95
103
|
writeFile: provider.writeFile,
|
|
96
104
|
};
|
|
97
105
|
ExtensionApiCommandRegistry.registerCommandMap(commandMap);
|
|
@@ -108,6 +116,7 @@ const commandMap = {
|
|
|
108
116
|
'ExtensionApi.executeFileSystemProviderReadFile': executeFileSystemProviderReadFile,
|
|
109
117
|
'ExtensionApi.executeFileSystemProviderRemove': executeFileSystemProviderRemove,
|
|
110
118
|
'ExtensionApi.executeFileSystemProviderRename': executeFileSystemProviderRename,
|
|
119
|
+
'ExtensionApi.executeFileSystemProviderStat': executeFileSystemProviderStat,
|
|
111
120
|
'ExtensionApi.executeFileSystemProviderWriteFile': executeFileSystemProviderWriteFile,
|
|
112
121
|
'ExtensionApi.getFileSystemProviderRegistrySnapshot': getFileSystemProviderRegistrySnapshot,
|
|
113
122
|
};
|
|
@@ -7,5 +7,6 @@ export interface RegisteredFileSystemProvider {
|
|
|
7
7
|
readonly readFile: (uri: string) => Blob | Promise<Blob | string> | string;
|
|
8
8
|
readonly remove?: (uri: string) => void | Promise<void>;
|
|
9
9
|
readonly rename?: (oldUri: string, newUri: string) => void | Promise<void>;
|
|
10
|
+
readonly stat?: (uri: string) => number | Promise<number>;
|
|
10
11
|
readonly writeFile?: (uri: string, content: string) => void | Promise<void>;
|
|
11
12
|
}
|
|
@@ -5,6 +5,7 @@ export interface RegisteredSourceControlProvider {
|
|
|
5
5
|
readonly generateCommitMessage?: () => unknown | Promise<unknown>;
|
|
6
6
|
readonly getBadgeCount?: () => number | Promise<number>;
|
|
7
7
|
readonly getChangedFiles: () => readonly unknown[] | Promise<readonly unknown[]>;
|
|
8
|
+
readonly getCurrentBranch?: (cwd: string) => string | Promise<string>;
|
|
8
9
|
readonly getFeatures?: () => unknown | Promise<unknown>;
|
|
9
10
|
readonly getFileBefore?: (uri: string) => unknown | Promise<unknown>;
|
|
10
11
|
readonly getFileBeforeUri?: (uri: string) => string | Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from '../SourceControlProviderRegistry/SourceControlProviderRegistry.ts';
|
|
1
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetCurrentBranch, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, 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, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "../SourceControlProviderRegistry/SourceControlProviderRegistry.js";
|
|
1
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetBadgeCount, executeSourceControlGetChangedFiles, executeSourceControlGetCurrentBranch, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileBeforeUri, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlGetProgress, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "../SourceControlProviderRegistry/SourceControlProviderRegistry.js";
|
|
@@ -5,6 +5,7 @@ export interface SourceControlProvider {
|
|
|
5
5
|
readonly generateCommitMessage?: () => unknown | Promise<unknown>;
|
|
6
6
|
readonly getBadgeCount?: () => number | Promise<number>;
|
|
7
7
|
readonly getChangedFiles: () => readonly unknown[] | Promise<readonly unknown[]>;
|
|
8
|
+
readonly getCurrentBranch?: (cwd: string) => string | Promise<string>;
|
|
8
9
|
readonly getFeatures?: () => unknown | Promise<unknown>;
|
|
9
10
|
readonly getFileBefore?: (uri: string) => unknown | Promise<unknown>;
|
|
10
11
|
readonly getFileBeforeUri?: (uri: string) => string | Promise<string>;
|
|
@@ -7,6 +7,7 @@ export declare const executeSourceControlAdd: (id: string, path: string) => Prom
|
|
|
7
7
|
export declare const executeSourceControlDiscard: (id: string, path: string) => Promise<unknown>;
|
|
8
8
|
export declare const executeSourceControlGenerateCommitMessage: (id: string) => Promise<unknown>;
|
|
9
9
|
export declare const executeSourceControlGetChangedFiles: (id: string) => Promise<readonly unknown[]>;
|
|
10
|
+
export declare const executeSourceControlGetCurrentBranch: (id: string, cwd: string) => Promise<string | undefined>;
|
|
10
11
|
export declare const executeSourceControlGetBadgeCount: (id: string) => Promise<number>;
|
|
11
12
|
export declare const executeSourceControlGetFeatures: (id: string) => Promise<unknown>;
|
|
12
13
|
export declare const executeSourceControlGetFileBefore: (id: string, uri: string) => Promise<unknown>;
|
|
@@ -7,6 +7,7 @@ const optionalMethods = [
|
|
|
7
7
|
'discard',
|
|
8
8
|
'generateCommitMessage',
|
|
9
9
|
'getBadgeCount',
|
|
10
|
+
'getCurrentBranch',
|
|
10
11
|
'getFeatures',
|
|
11
12
|
'getFileBefore',
|
|
12
13
|
'getFileBeforeUri',
|
|
@@ -66,6 +67,9 @@ const mapSourceControlProvider = (provider) => {
|
|
|
66
67
|
if (provider.getBadgeCount) {
|
|
67
68
|
registeredProvider.getBadgeCount = () => provider.getBadgeCount();
|
|
68
69
|
}
|
|
70
|
+
if (provider.getCurrentBranch) {
|
|
71
|
+
registeredProvider.getCurrentBranch = (cwd) => provider.getCurrentBranch(cwd);
|
|
72
|
+
}
|
|
69
73
|
if (provider.getFeatures) {
|
|
70
74
|
registeredProvider.getFeatures = () => provider.getFeatures();
|
|
71
75
|
}
|
|
@@ -114,6 +118,9 @@ export const executeSourceControlGenerateCommitMessage = async (id) => {
|
|
|
114
118
|
export const executeSourceControlGetChangedFiles = async (id) => {
|
|
115
119
|
return getProvider(id).getChangedFiles();
|
|
116
120
|
};
|
|
121
|
+
export const executeSourceControlGetCurrentBranch = async (id, cwd) => {
|
|
122
|
+
return getProvider(id).getCurrentBranch?.(cwd);
|
|
123
|
+
};
|
|
117
124
|
export const executeSourceControlGetBadgeCount = async (id) => {
|
|
118
125
|
const provider = getProvider(id);
|
|
119
126
|
if (provider.getBadgeCount) {
|
|
@@ -178,6 +185,7 @@ const commandMap = {
|
|
|
178
185
|
'ExtensionApi.executeSourceControlGenerateCommitMessage': executeSourceControlGenerateCommitMessage,
|
|
179
186
|
'ExtensionApi.executeSourceControlGetBadgeCount': executeSourceControlGetBadgeCount,
|
|
180
187
|
'ExtensionApi.executeSourceControlGetChangedFiles': executeSourceControlGetChangedFiles,
|
|
188
|
+
'ExtensionApi.executeSourceControlGetCurrentBranch': executeSourceControlGetCurrentBranch,
|
|
181
189
|
'ExtensionApi.executeSourceControlGetFeatures': executeSourceControlGetFeatures,
|
|
182
190
|
'ExtensionApi.executeSourceControlGetFileBefore': executeSourceControlGetFileBefore,
|
|
183
191
|
'ExtensionApi.executeSourceControlGetFileBeforeUri': executeSourceControlGetFileBeforeUri,
|