mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 (#6516)
* Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 * fix tests
This commit is contained in:
@@ -234,7 +234,9 @@ export class StandaloneCommandService implements ICommandService {
|
||||
private readonly _dynamicCommands: { [id: string]: ICommand; };
|
||||
|
||||
private readonly _onWillExecuteCommand = new Emitter<ICommandEvent>();
|
||||
private readonly _onDidExecuteCommand = new Emitter<ICommandEvent>();
|
||||
public readonly onWillExecuteCommand: Event<ICommandEvent> = this._onWillExecuteCommand.event;
|
||||
public readonly onDidExecuteCommand: Event<ICommandEvent> = this._onDidExecuteCommand.event;
|
||||
|
||||
constructor(instantiationService: IInstantiationService) {
|
||||
this._instantiationService = instantiationService;
|
||||
@@ -256,8 +258,10 @@ export class StandaloneCommandService implements ICommandService {
|
||||
}
|
||||
|
||||
try {
|
||||
this._onWillExecuteCommand.fire({ commandId: id });
|
||||
this._onWillExecuteCommand.fire({ commandId: id, args });
|
||||
const result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler, ...args]) as T;
|
||||
|
||||
this._onDidExecuteCommand.fire({ commandId: id, args });
|
||||
return Promise.resolve(result);
|
||||
} catch (err) {
|
||||
return Promise.reject(err);
|
||||
@@ -352,7 +356,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
|
||||
private _toNormalizedKeybindingItems(items: IKeybindingItem[], isDefault: boolean): ResolvedKeybindingItem[] {
|
||||
let result: ResolvedKeybindingItem[] = [], resultLen = 0;
|
||||
for (const item of items) {
|
||||
const when = (item.when ? item.when.normalize() : undefined);
|
||||
const when = item.when || undefined;
|
||||
const keybinding = item.keybinding;
|
||||
|
||||
if (!keybinding) {
|
||||
|
||||
@@ -140,8 +140,6 @@ export module StaticServices {
|
||||
|
||||
export const notificationService = define(INotificationService, () => new SimpleNotificationService());
|
||||
|
||||
export const accessibilityService = define(IAccessibilityService, () => new BrowserAccessibilityService());
|
||||
|
||||
export const markerService = define(IMarkerService, () => new MarkerService());
|
||||
|
||||
export const modeService = define(IModeService, (o) => new ModeServiceImpl());
|
||||
@@ -194,6 +192,8 @@ export class DynamicStandaloneServices extends Disposable {
|
||||
|
||||
let contextKeyService = ensure(IContextKeyService, () => this._register(new ContextKeyService(configurationService)));
|
||||
|
||||
ensure(IAccessibilityService, () => new BrowserAccessibilityService(contextKeyService, configurationService));
|
||||
|
||||
ensure(IListService, () => new ListService(contextKeyService));
|
||||
|
||||
let commandService = ensure(ICommandService, () => new StandaloneCommandService(this._instantiationService));
|
||||
|
||||
Reference in New Issue
Block a user