Fixes #182559

This scopes the fix from #175603 to just the suggest widget and reverts the change to `mainThreadCommands`
This commit is contained in:
Matt Bierner
2023-05-17 00:17:08 -07:00
committed by GitHub
parent 9e85ba4f4a
commit 19abbd1fda
2 changed files with 10 additions and 5 deletions
@@ -7,7 +7,7 @@ import { alert } from 'vs/base/browser/ui/aria/aria';
import { isNonEmptyArray } from 'vs/base/common/arrays';
import { IdleValue } from 'vs/base/common/async';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { onUnexpectedError } from 'vs/base/common/errors';
import { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors';
import { Event } from 'vs/base/common/event';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { KeyCodeChord } from 'vs/base/common/keybindings';
@@ -432,7 +432,13 @@ export class SuggestController implements IEditorContribution {
this.model.trigger({ auto: true, retrigger: true });
} else {
// exec command, done
tasks.push(this._commandService.executeCommand(item.completion.command.id, ...(item.completion.command.arguments ? [...item.completion.command.arguments] : [])).catch(onUnexpectedError));
tasks.push(this._commandService.executeCommand(item.completion.command.id, ...(item.completion.command.arguments ? [...item.completion.command.arguments] : [])).catch(e => {
if (item.completion.extensionId) {
onUnexpectedExternalError(e);
} else {
onUnexpectedError(e);
}
}));
}
}
@@ -6,11 +6,10 @@
import { DisposableMap, IDisposable } from 'vs/base/common/lifecycle';
import { revive } from 'vs/base/common/marshalling';
import { CommandsRegistry, ICommandHandlerDescription, ICommandService } from 'vs/platform/commands/common/commands';
import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers';
import { Dto, SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { ExtHostCommandsShape, ExtHostContext, MainContext, MainThreadCommandsShape } from '../common/extHost.protocol';
import { onUnexpectedExternalError } from 'vs/base/common/errors';
@extHostNamedCustomer(MainContext.MainThreadCommands)
@@ -60,7 +59,7 @@ export class MainThreadCommands implements MainThreadCommandsShape {
CommandsRegistry.registerCommand(id, (accessor, ...args) => {
return this._proxy.$executeContributedCommand(id, ...args).then(result => {
return revive(result);
}, onUnexpectedExternalError);
});
})
);
}