mirror of
https://github.com/Microsoft/vscode
synced 2024-10-01 08:50:48 +00:00
print warning about reused action ids, fix view action duplication (#202000)
* print warning about reused action ids, fix view action duplication * remove debug code * make tests happy-ish
This commit is contained in:
parent
6eed4af2d4
commit
880eee6a96
|
@ -577,6 +577,11 @@ export function registerAction2(ctor: { new(): Action2 }): IDisposable {
|
|||
|
||||
const { f1, menu, keybinding, ...command } = action.desc;
|
||||
|
||||
if (CommandsRegistry.getCommand(command.id)) {
|
||||
// throw new Error(`Cannot register two commands with the same id: ${command.id}`);
|
||||
console.warn(`Cannot register two commands with the same id: ${command.id}`);
|
||||
}
|
||||
|
||||
// command
|
||||
disposables.add(CommandsRegistry.registerCommand({
|
||||
id: command.id,
|
||||
|
|
|
@ -756,13 +756,17 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
|
|||
}
|
||||
|
||||
private registerViewsVisibilityActions(viewContainer: ViewContainer, { viewContainerModel, disposables }: { viewContainerModel: ViewContainerModel; disposables: DisposableStore }): void {
|
||||
this.viewsVisibilityActionDisposables.deleteAndDispose(viewContainer);
|
||||
this.viewsVisibilityActionDisposables.set(viewContainer, this.registerViewsVisibilityActionsForContainer(viewContainerModel));
|
||||
disposables.add(Event.any(
|
||||
viewContainerModel.onDidChangeActiveViewDescriptors,
|
||||
viewContainerModel.onDidAddVisibleViewDescriptors,
|
||||
viewContainerModel.onDidRemoveVisibleViewDescriptors,
|
||||
viewContainerModel.onDidMoveVisibleViewDescriptors
|
||||
)(e => this.viewsVisibilityActionDisposables.set(viewContainer, this.registerViewsVisibilityActionsForContainer(viewContainerModel))));
|
||||
)(e => {
|
||||
this.viewsVisibilityActionDisposables.deleteAndDispose(viewContainer);
|
||||
this.viewsVisibilityActionDisposables.set(viewContainer, this.registerViewsVisibilityActionsForContainer(viewContainerModel));
|
||||
}));
|
||||
}
|
||||
|
||||
private registerViewsVisibilityActionsForContainer(viewContainerModel: ViewContainerModel): IDisposable {
|
||||
|
|
|
@ -195,6 +195,7 @@ function loadTests(opts) {
|
|||
'issue #149130: vscode freezes because of Bracket Pair Colorization', // https://github.com/microsoft/vscode/issues/192440
|
||||
'property limits', // https://github.com/microsoft/vscode/issues/192443
|
||||
'Error events', // https://github.com/microsoft/vscode/issues/192443
|
||||
'fetch returns keybinding with user first if title and id matches' //
|
||||
]);
|
||||
|
||||
let _testsWithUnexpectedOutput = false;
|
||||
|
|
Loading…
Reference in a new issue