@lvce-editor/extension-management-worker 4.38.0 → 4.39.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.
|
@@ -2855,7 +2855,7 @@ const getProviderIds$1 = extension => {
|
|
|
2855
2855
|
const findExtension$1 = (extensions, providerId) => {
|
|
2856
2856
|
return extensions.find(extension => getProviderIds$1(extension).includes(providerId));
|
|
2857
2857
|
};
|
|
2858
|
-
const
|
|
2858
|
+
const executeFileSystemProviderMethod = async (extensionsState, method, providerId, ...args) => {
|
|
2859
2859
|
const {
|
|
2860
2860
|
assetDir,
|
|
2861
2861
|
platform
|
|
@@ -2868,12 +2868,24 @@ const executeFileSystemProviderReadFile = async (extensionsState, providerId, ur
|
|
|
2868
2868
|
};
|
|
2869
2869
|
}
|
|
2870
2870
|
const rpc = await getRpc$1(extension, assetDir, platform);
|
|
2871
|
-
const result = await rpc.invoke(
|
|
2871
|
+
const result = await rpc.invoke(method, providerId, ...args);
|
|
2872
2872
|
return {
|
|
2873
2873
|
found: true,
|
|
2874
2874
|
result
|
|
2875
2875
|
};
|
|
2876
2876
|
};
|
|
2877
|
+
const executeFileSystemProviderGetPathSeparator = (extensionsState, providerId) => {
|
|
2878
|
+
return executeFileSystemProviderMethod(extensionsState, 'ExtensionApi.executeFileSystemProviderGetPathSeparator', providerId);
|
|
2879
|
+
};
|
|
2880
|
+
const executeFileSystemProviderIsReadonly = (extensionsState, providerId) => {
|
|
2881
|
+
return executeFileSystemProviderMethod(extensionsState, 'ExtensionApi.executeFileSystemProviderIsReadonly', providerId);
|
|
2882
|
+
};
|
|
2883
|
+
const executeFileSystemProviderReadDirWithFileTypes = (extensionsState, providerId, uri) => {
|
|
2884
|
+
return executeFileSystemProviderMethod(extensionsState, 'ExtensionApi.executeFileSystemProviderReadDirWithFileTypes', providerId, uri);
|
|
2885
|
+
};
|
|
2886
|
+
const executeFileSystemProviderReadFile = (extensionsState, providerId, uri) => {
|
|
2887
|
+
return executeFileSystemProviderMethod(extensionsState, 'ExtensionApi.executeFileSystemProviderReadFile', providerId, uri);
|
|
2888
|
+
};
|
|
2877
2889
|
|
|
2878
2890
|
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
2879
2891
|
|
|
@@ -3066,6 +3078,9 @@ const serializeError = error => {
|
|
|
3066
3078
|
name: 'Error'
|
|
3067
3079
|
};
|
|
3068
3080
|
};
|
|
3081
|
+
const isViewActionsDomCommandNotFoundError = error => {
|
|
3082
|
+
return error instanceof Error && error.name === 'CommandNotFoundError' && error.message.includes('ExtensionApi.getViewActionsDom');
|
|
3083
|
+
};
|
|
3069
3084
|
const hasView = (extension, viewId) => {
|
|
3070
3085
|
return Array.isArray(extension.views) && extension.views.some(view => view.id === viewId);
|
|
3071
3086
|
};
|
|
@@ -3155,7 +3170,14 @@ const getViewActionsDom = async (viewId, uid, assetDir, platform) => {
|
|
|
3155
3170
|
if (!instance || instance.status === 'error') {
|
|
3156
3171
|
return undefined;
|
|
3157
3172
|
}
|
|
3158
|
-
|
|
3173
|
+
try {
|
|
3174
|
+
return await instance.rpc.invoke('ExtensionApi.getViewActionsDom', uid);
|
|
3175
|
+
} catch (error) {
|
|
3176
|
+
if (isViewActionsDomCommandNotFoundError(error)) {
|
|
3177
|
+
return undefined;
|
|
3178
|
+
}
|
|
3179
|
+
throw error;
|
|
3180
|
+
}
|
|
3159
3181
|
};
|
|
3160
3182
|
const requestViewRerender = async uid => {
|
|
3161
3183
|
await invoke$2('Viewlet.executeViewletCommand', uid, 'rerender');
|
|
@@ -3885,6 +3907,9 @@ const commandMap = {
|
|
|
3885
3907
|
'Extensions.executeCompletionProvider': wrapCommand(executeCompletionProvider),
|
|
3886
3908
|
'Extensions.executeDiagnosticProvider': wrapCommand(executeDiagnosticProvider),
|
|
3887
3909
|
'Extensions.executeExtensionCommand': wrapCommand(executeExtensionCommand),
|
|
3910
|
+
'Extensions.executeFileSystemProviderGetPathSeparator': wrapCommand(executeFileSystemProviderGetPathSeparator),
|
|
3911
|
+
'Extensions.executeFileSystemProviderIsReadonly': wrapCommand(executeFileSystemProviderIsReadonly),
|
|
3912
|
+
'Extensions.executeFileSystemProviderReadDirWithFileTypes': wrapCommand(executeFileSystemProviderReadDirWithFileTypes),
|
|
3888
3913
|
'Extensions.executeFileSystemProviderReadFile': wrapCommand(executeFileSystemProviderReadFile),
|
|
3889
3914
|
'Extensions.executeFormattingProvider': wrapCommand(executeFormattingProvider),
|
|
3890
3915
|
'Extensions.executeHoverProvider': wrapCommand(executeHoverProvider),
|