Skip to content

Commit 1c85620

Browse files
committed
Change Decription back to normal
1 parent e206af1 commit 1c85620

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

src/vs/workbench/common/editor/resourceEditorInput.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,10 @@ export abstract class AbstractResourceEditorInput extends EditorInput implements
9595
}
9696
}
9797

98-
private getCustomLabel(): string | undefined {
99-
return this.customEditorLabelService.getName(this._preferredResource);
100-
}
101-
10298
private _name: string | undefined = undefined;
10399
override getName(): string {
104100
if (typeof this._name !== 'string') {
105-
this._name = this.getCustomLabel() ?? this.labelService.getUriBasenameLabel(this._preferredResource);
101+
this._name = this.customEditorLabelService.getName(this._preferredResource) ?? this.labelService.getUriBasenameLabel(this._preferredResource);
106102
}
107103

108104
return this._name;
@@ -120,14 +116,10 @@ export abstract class AbstractResourceEditorInput extends EditorInput implements
120116
}
121117
}
122118

123-
private get descriptionResource(): URI {
124-
return !!this.getCustomLabel() ? this._preferredResource : dirname(this._preferredResource);
125-
}
126-
127119
private _shortDescription: string | undefined = undefined;
128120
private get shortDescription(): string {
129121
if (typeof this._shortDescription !== 'string') {
130-
this._shortDescription = this.labelService.getUriBasenameLabel(this.descriptionResource);
122+
this._shortDescription = this.labelService.getUriBasenameLabel(dirname(this._preferredResource));
131123
}
132124

133125
return this._shortDescription;
@@ -136,7 +128,7 @@ export abstract class AbstractResourceEditorInput extends EditorInput implements
136128
private _mediumDescription: string | undefined = undefined;
137129
private get mediumDescription(): string {
138130
if (typeof this._mediumDescription !== 'string') {
139-
this._mediumDescription = this.labelService.getUriLabel(this.descriptionResource, { relative: true });
131+
this._mediumDescription = this.labelService.getUriLabel(dirname(this._preferredResource), { relative: true });
140132
}
141133

142134
return this._mediumDescription;
@@ -145,7 +137,7 @@ export abstract class AbstractResourceEditorInput extends EditorInput implements
145137
private _longDescription: string | undefined = undefined;
146138
private get longDescription(): string {
147139
if (typeof this._longDescription !== 'string') {
148-
this._longDescription = this.labelService.getUriLabel(this.descriptionResource);
140+
this._longDescription = this.labelService.getUriLabel(dirname(this._preferredResource));
149141
}
150142

151143
return this._longDescription;

src/vs/workbench/contrib/customEditor/browser/customEditorInput.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,6 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
170170
return capabilities;
171171
}
172172

173-
private getCustomLabel(): string | undefined {
174-
return this.customEditorLabelService.getName(this.resource);
175-
}
176-
177173
private _editorName: string | undefined = undefined;
178174
override getName(): string {
179175
if (typeof this._editorName !== 'string') {
@@ -195,14 +191,10 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
195191
}
196192
}
197193

198-
private get descriptionResource(): URI {
199-
return !!this.getCustomLabel() ? this.resource : dirname(this.resource);
200-
}
201-
202194
private _shortDescription: string | undefined = undefined;
203195
private get shortDescription(): string {
204196
if (typeof this._shortDescription !== 'string') {
205-
this._shortDescription = this.labelService.getUriBasenameLabel(this.descriptionResource);
197+
this._shortDescription = this.labelService.getUriBasenameLabel(dirname(this.resource));
206198
}
207199

208200
return this._shortDescription;
@@ -211,7 +203,7 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
211203
private _mediumDescription: string | undefined = undefined;
212204
private get mediumDescription(): string {
213205
if (typeof this._mediumDescription !== 'string') {
214-
this._mediumDescription = this.labelService.getUriLabel(this.descriptionResource, { relative: true });
206+
this._mediumDescription = this.labelService.getUriLabel(dirname(this.resource), { relative: true });
215207
}
216208

217209
return this._mediumDescription;
@@ -220,7 +212,7 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
220212
private _longDescription: string | undefined = undefined;
221213
private get longDescription(): string {
222214
if (typeof this._longDescription !== 'string') {
223-
this._longDescription = this.labelService.getUriLabel(this.descriptionResource);
215+
this._longDescription = this.labelService.getUriLabel(dirname(this.resource));
224216
}
225217

226218
return this._longDescription;

0 commit comments

Comments
 (0)