mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
Make getResource return undefined
This commit is contained in:
@@ -140,8 +140,8 @@ export class QuickOpenEntry {
|
||||
* A resource for this entry. Resource URIs can be used to compare different kinds of entries and group
|
||||
* them together.
|
||||
*/
|
||||
getResource(): URI | null {
|
||||
return null;
|
||||
getResource(): URI | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,7 +245,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry {
|
||||
return this.entry ? this.entry.getDetail() : super.getDetail();
|
||||
}
|
||||
|
||||
getResource(): URI | null {
|
||||
getResource(): URI | undefined {
|
||||
return this.entry ? this.entry.getResource() : super.getResource();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { EditorInput, toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { compareItemsByScore, scoreItem, ScorerCache, prepareQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
|
||||
export class EditorPickerEntry extends QuickOpenEntryGroup {
|
||||
|
||||
@@ -32,7 +33,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
|
||||
|
||||
getLabelOptions(): IIconLabelValueOptions {
|
||||
return {
|
||||
extraClasses: getIconClasses(this.modelService, this.modeService, this.getResource() || undefined),
|
||||
extraClasses: getIconClasses(this.modelService, this.modeService, this.getResource()),
|
||||
italic: !this._group.isPinned(this.editor)
|
||||
};
|
||||
}
|
||||
@@ -50,7 +51,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
|
||||
}
|
||||
|
||||
getResource() {
|
||||
return toResource(this.editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
return withNullAsUndefined(toResource(this.editor, { supportSideBySide: SideBySideEditor.MASTER }));
|
||||
}
|
||||
|
||||
getAriaLabel(): string {
|
||||
|
||||
@@ -782,8 +782,8 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
getResource(): URI | null {
|
||||
return types.withUndefinedAsNull(this.resource);
|
||||
getResource(): URI | undefined {
|
||||
return this.resource;
|
||||
}
|
||||
|
||||
getInput(): IEditorInput | IResourceInput {
|
||||
@@ -848,7 +848,7 @@ export class RemoveFromEditorHistoryAction extends Action {
|
||||
|
||||
return <IHistoryPickEntry>{
|
||||
input: h,
|
||||
iconClasses: getIconClasses(this.modelService, this.modeService, types.withNullAsUndefined(entry.getResource())),
|
||||
iconClasses: getIconClasses(this.modelService, this.modeService, entry.getResource()),
|
||||
label: entry.getLabel(),
|
||||
description: entry.getDescription()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user