@lvce-editor/extension-host-worker 5.5.0 → 5.7.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.
@@ -30,6 +30,21 @@ const getJson$1 = async url => {
30
30
  throw new DepecratedError(`vscode.getJson is deprecated, use createNodeRpc instead`);
31
31
  };
32
32
 
33
+ class NonError extends Error {
34
+ name = 'NonError';
35
+ constructor(message) {
36
+ super(message);
37
+ }
38
+ }
39
+
40
+ // ensureError based on https://github.com/sindresorhus/ensure-error/blob/main/index.ts (License MIT)
41
+ const ensureError = input => {
42
+ if (!(input instanceof Error)) {
43
+ return new NonError(input);
44
+ }
45
+ return input;
46
+ };
47
+
33
48
  class AssertionError extends Error {
34
49
  constructor(message) {
35
50
  super(message);
@@ -510,20 +525,6 @@ const improveValidationError = (name, validationError) => {
510
525
  const post = improveValidationErrorPostMessage(validationError, camelCaseName);
511
526
  return pre + ': ' + post;
512
527
  };
513
- class NonError extends Error {
514
- name = 'NonError';
515
- constructor(message) {
516
- super(message);
517
- }
518
- }
519
-
520
- // ensureError based on https://github.com/sindresorhus/ensure-error/blob/main/index.ts (License MIT)
521
- const ensureError = input => {
522
- if (!(input instanceof Error)) {
523
- return new NonError(input);
524
- }
525
- return input;
526
- };
527
528
  const registerMethod = ({
528
529
  context,
529
530
  providers,
@@ -550,7 +551,6 @@ const registerMethod = ({
550
551
  const error = validate(result, resultShape);
551
552
  if (error) {
552
553
  const improvedError = improveValidationError(name, error);
553
- // @ts-ignore
554
554
  throw new VError(improvedError);
555
555
  }
556
556
  return result;
@@ -560,11 +560,9 @@ const registerMethod = ({
560
560
  if (actualError && actualError.message) {
561
561
  if (actualError.message === 'provider[methodName] is not a function') {
562
562
  const camelCaseName = toCamelCase(name);
563
- // @ts-ignore
564
563
  throw new VError(`Failed to execute ${spacedOutName} provider: VError: ${camelCaseName}Provider.${methodName} is not a function`);
565
564
  }
566
- const message = actualError.name === 'Error' ? actualError.message : `${actualError.name}: ${actualError.message}`;
567
- actualError.message = `Failed to execute ${spacedOutName} provider: ${message}`;
565
+ throw new VError(actualError, `Failed to execute ${spacedOutName} provider`);
568
566
  }
569
567
  throw actualError;
570
568
  }
@@ -756,7 +754,7 @@ const setConfigurations = preferences => {
756
754
  };
757
755
 
758
756
  const rpcs$2 = Object.create(null);
759
- const set$5$1 = (id, rpc) => {
757
+ const set$a = (id, rpc) => {
760
758
  rpcs$2[id] = rpc;
761
759
  };
762
760
  const get$a = id => {
@@ -1006,6 +1004,14 @@ const readDirWithFileTypesExternal = async path => {
1006
1004
  const content = await invoke$2('FileSystem.readDirWithFileTypes', path);
1007
1005
  return content;
1008
1006
  };
1007
+ const rename$1 = async (protocol, oldUri, newUri) => {
1008
+ try {
1009
+ const provider = get$9(protocol);
1010
+ return await provider.rename(oldUri, newUri);
1011
+ } catch (error) {
1012
+ throw new VError(error, 'Failed to execute file system provider');
1013
+ }
1014
+ };
1009
1015
  const writeFile$2 = async (protocol, uri, content) => {
1010
1016
  try {
1011
1017
  const provider = get$9(protocol);
@@ -3997,12 +4003,14 @@ const ClosingTagExecuteClosingTagProvider = 'ExtensionHostClosingTag.executeClos
3997
4003
  const CommandExecute = 'ExtensionHostCommand.executeCommand';
3998
4004
  const CompletionExecute = 'ExtensionHostCompletion.execute';
3999
4005
  const CompletionResolveExecute = 'ExtensionHostCompletion.executeResolve';
4006
+ const ConfigurationSetConfiguration = 'ExtensionHostConfiguration.setConfiguration';
4000
4007
  const DefinitionExecuteDefinitionProvider = 'ExtensionHostDefinition.executeDefinitionProvider';
4001
4008
  const DiagnosticExecuteDiagnosticProvider = 'ExtensionHost.executeDiagnosticProvider';
4002
4009
  const ExtensionActivate = 'ExtensionHostExtension.activate';
4003
4010
  const FileSystemGetPathSeparator = 'ExtensionHostFileSystem.getPathSeparator';
4004
4011
  const FileSystemReadDirWithFileTypes = 'ExtensionHostFileSystem.readDirWithFileTypes';
4005
4012
  const FileSystemReadFile = 'ExtensionHostFileSystem.readFile';
4013
+ const FileSystemRename = 'ExtensionHostFileSystem.rename';
4006
4014
  const FileSystemWriteFile = 'ExtensionHostFileSystem.writeFile';
4007
4015
  const FormattingExecuteFormmattingProvider = 'ExtensionHostFormatting.executeFormattingProvider';
4008
4016
  const HoverExecute = 'ExtensionHostHover.execute';
@@ -4012,6 +4020,7 @@ const MockRpc = 'ExtensionHostMockRpc.mockRpc';
4012
4020
  const OrganizeImportsExecute = 'ExtensionHostOrganizeImports.execute';
4013
4021
  const ReferenceExecuteFileReferenceProvider = 'ExtensionHostReference.executeFileReferenceProvider';
4014
4022
  const ReferenceExecuteReferenceProvider = 'ExtensionHostReference.executeReferenceProvider';
4023
+ const SelectionExecuteSelectionProvider = 'ExtensionHostSelection.executeSelectionProvider';
4015
4024
  const SourceControlAcceptInput = 'ExtensionHostSourceControl.acceptInput';
4016
4025
  const SourceControlAdd = 'ExtensionHostSourceControl.add';
4017
4026
  const SourceControlDiscard = 'ExtensionHostSourceControl.discard';
@@ -4028,8 +4037,6 @@ const TextDocumentSyncIncremental = 'ExtensionHostTextDocument.syncIncremental';
4028
4037
  const TextSearchExecuteTextSearchProvider = 'ExtensionHostTextSearch.executeTextSearchProvider';
4029
4038
  const TypeDefinitionExecuteTypeDefinitionProvider = 'ExtensionHostTypeDefinition.executeTypeDefinitionProvider';
4030
4039
  const WorkspaceSetPath = 'Workspace.setWorkspacePath';
4031
- const SelectionExecuteSelectionProvider = 'ExtensionHostSelection.executeSelectionProvider';
4032
- const ConfigurationSetConfiguration = 'ExtensionHostConfiguration.setConfiguration';
4033
4040
 
4034
4041
  const create = () => {
4035
4042
  return {
@@ -4993,7 +5000,7 @@ const handleMessagePort2 = async (port, rpcId) => {
4993
5000
  commandMap: {}
4994
5001
  });
4995
5002
  if (rpcId) {
4996
- set$5$1(rpcId, rpc);
5003
+ set$a(rpcId, rpc);
4997
5004
  }
4998
5005
  };
4999
5006
 
@@ -5003,7 +5010,7 @@ const handleMessagePort = async (port, rpcId) => {
5003
5010
  commandMap: {}
5004
5011
  });
5005
5012
  if (rpcId) {
5006
- set$5$1(rpcId, rpc);
5013
+ set$a(rpcId, rpc);
5007
5014
  }
5008
5015
  };
5009
5016
 
@@ -5646,6 +5653,7 @@ const commandMap = {
5646
5653
  [FileSystemGetPathSeparator]: getPathSeparator,
5647
5654
  [FileSystemReadDirWithFileTypes]: readDirWithFileTypes$2,
5648
5655
  [FileSystemReadFile]: readFile$2,
5656
+ [FileSystemRename]: rename$1,
5649
5657
  [FileSystemWriteFile]: writeFile$2,
5650
5658
  [FormattingExecuteFormmattingProvider]: executeFormattingProvider,
5651
5659
  [HoverExecute]: executeHoverProvider,
@@ -5678,7 +5686,7 @@ const listen = async () => {
5678
5686
  const rpc = await WebWorkerRpcClient.create({
5679
5687
  commandMap: commandMap
5680
5688
  });
5681
- set$5$1(RendererWorker, rpc);
5689
+ set$a(RendererWorker, rpc);
5682
5690
  };
5683
5691
 
5684
5692
  const main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "5.5.0",
3
+ "version": "5.7.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"