mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
add some override https://github.com/microsoft/vscode/issues/120675
This commit is contained in:
parent
50fe76ba29
commit
d8e1c802f7
|
@ -117,7 +117,7 @@ export class MenuEntryActionViewItem extends ActionViewItem {
|
|||
private readonly _altKey: ModifierKeyEmitter;
|
||||
|
||||
constructor(
|
||||
readonly _action: MenuItemAction,
|
||||
_action: MenuItemAction,
|
||||
@IKeybindingService protected readonly _keybindingService: IKeybindingService,
|
||||
@INotificationService protected _notificationService: INotificationService
|
||||
) {
|
||||
|
@ -125,8 +125,12 @@ export class MenuEntryActionViewItem extends ActionViewItem {
|
|||
this._altKey = ModifierKeyEmitter.getInstance();
|
||||
}
|
||||
|
||||
protected get _menuItemAction(): MenuItemAction {
|
||||
return <MenuItemAction>this._action;
|
||||
}
|
||||
|
||||
protected get _commandAction(): MenuItemAction {
|
||||
return this._wantsAltCommand && (<MenuItemAction>this._action).alt || this._action;
|
||||
return this._wantsAltCommand && this._menuItemAction.alt || this._menuItemAction;
|
||||
}
|
||||
|
||||
override onClick(event: MouseEvent): void {
|
||||
|
@ -142,7 +146,7 @@ export class MenuEntryActionViewItem extends ActionViewItem {
|
|||
super.render(container);
|
||||
container.classList.add('menu-entry');
|
||||
|
||||
this._updateItemClass(this._action.item);
|
||||
this._updateItemClass(this._menuItemAction.item);
|
||||
|
||||
let mouseOver = false;
|
||||
|
||||
|
@ -158,7 +162,7 @@ export class MenuEntryActionViewItem extends ActionViewItem {
|
|||
}
|
||||
};
|
||||
|
||||
if (this._action.alt) {
|
||||
if (this._menuItemAction.alt) {
|
||||
this._register(this._altKey.event(value => {
|
||||
alternativeKeyDown = value.altKey || ((isWindows || isLinux) && value.shiftKey);
|
||||
updateAltState();
|
||||
|
@ -191,9 +195,9 @@ export class MenuEntryActionViewItem extends ActionViewItem {
|
|||
let title = keybindingLabel
|
||||
? localize('titleAndKb', "{0} ({1})", tooltip, keybindingLabel)
|
||||
: tooltip;
|
||||
if (!this._wantsAltCommand && this._action.alt) {
|
||||
const altTooltip = this._action.alt.tooltip || this._action.alt.label;
|
||||
const altKeybinding = this._keybindingService.lookupKeybinding(this._action.alt.id);
|
||||
if (!this._wantsAltCommand && this._menuItemAction.alt) {
|
||||
const altTooltip = this._menuItemAction.alt.tooltip || this._menuItemAction.alt.label;
|
||||
const altKeybinding = this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id);
|
||||
const altKeybindingLabel = altKeybinding && altKeybinding.getLabel();
|
||||
const altTitleSection = altKeybindingLabel
|
||||
? localize('titleAndKb', "{0} ({1})", altTooltip, altKeybindingLabel)
|
||||
|
@ -206,12 +210,12 @@ export class MenuEntryActionViewItem extends ActionViewItem {
|
|||
|
||||
override updateClass(): void {
|
||||
if (this.options.icon) {
|
||||
if (this._commandAction !== this._action) {
|
||||
if (this._action.alt) {
|
||||
this._updateItemClass(this._action.alt.item);
|
||||
if (this._commandAction !== this._menuItemAction) {
|
||||
if (this._menuItemAction.alt) {
|
||||
this._updateItemClass(this._menuItemAction.alt.item);
|
||||
}
|
||||
} else if ((<MenuItemAction>this._action).alt) {
|
||||
this._updateItemClass(this._action.item);
|
||||
} else if (this._menuItemAction.alt) {
|
||||
this._updateItemClass(this._menuItemAction.item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ const newCommands: ApiCommand[] = [
|
|||
range!: vscode.Range;
|
||||
selectionRange!: vscode.Range;
|
||||
children!: vscode.DocumentSymbol[];
|
||||
containerName!: string;
|
||||
override containerName!: string;
|
||||
}
|
||||
return value.map(MergedInfo.to);
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ export class BreadcrumbsFilePicker extends BreadcrumbsPicker {
|
|||
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
protected resource: URI,
|
||||
resource: URI,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IConfigurationService configService: IConfigurationService,
|
||||
|
|
|
@ -20,7 +20,7 @@ export class ResourceNotebookCellEdit extends ResourceEdit {
|
|||
readonly resource: URI,
|
||||
readonly cellEdit: ICellEditOperation,
|
||||
readonly versionId?: number,
|
||||
readonly metadata?: WorkspaceEditMetadata
|
||||
metadata?: WorkspaceEditMetadata
|
||||
) {
|
||||
super(metadata);
|
||||
}
|
||||
|
|
|
@ -289,7 +289,7 @@ export class NotebookTextModel extends Disposable implements INotebookTextModel
|
|||
this._cells.splice(0, 0, ...mainCells);
|
||||
}
|
||||
|
||||
dispose() {
|
||||
override dispose() {
|
||||
this._onWillDispose.fire();
|
||||
dispose(this._cellListeners.values());
|
||||
dispose(this._cells);
|
||||
|
|
Loading…
Reference in a new issue