Skip to content

Commit 1a55878

Browse files
author
Benjamin Pasero
committed
Editor icon does not change when changing from plain text (fix microsoft#91205)
1 parent 3cf529d commit 1a55878

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/vs/workbench/browser/labels.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ import { dirname, isEqual, basenameOrAuthority } from 'vs/base/common/resources'
99
import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';
1010
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
1111
import { IModeService } from 'vs/editor/common/services/modeService';
12-
import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry';
1312
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
1413
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
1514
import { IModelService } from 'vs/editor/common/services/modelService';
1615
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
1716
import { IDecorationsService, IResourceDecorationChangeEvent } from 'vs/workbench/services/decorations/browser/decorations';
1817
import { Schemas } from 'vs/base/common/network';
19-
import { FileKind, FILES_ASSOCIATIONS_CONFIG, IFileService } from 'vs/platform/files/common/files';
18+
import { FileKind, FILES_ASSOCIATIONS_CONFIG } from 'vs/platform/files/common/files';
2019
import { ITextModel } from 'vs/editor/common/model';
2120
import { IThemeService } from 'vs/platform/theme/common/themeService';
2221
import { Event, Emitter } from 'vs/base/common/event';
@@ -89,7 +88,6 @@ export class ResourceLabels extends Disposable {
8988
@IModelService private readonly modelService: IModelService,
9089
@IDecorationsService private readonly decorationsService: IDecorationsService,
9190
@IThemeService private readonly themeService: IThemeService,
92-
@IFileService private readonly fileService: IFileService,
9391
@ILabelService private readonly labelService: ILabelService,
9492
@ITextFileService private readonly textFileService: ITextFileService
9593
) {
@@ -114,10 +112,6 @@ export class ResourceLabels extends Disposable {
114112
return; // we need the resource to compare
115113
}
116114

117-
if (this.fileService.canHandleResource(e.model.uri) && e.oldModeId === PLAINTEXT_MODE_ID) {
118-
return; // ignore transitions in files from no mode to specific mode because this happens each time a model is created
119-
}
120-
121115
this._widgets.forEach(widget => widget.notifyModelModeChanged(e.model));
122116
}));
123117

@@ -218,11 +212,10 @@ export class ResourceLabel extends ResourceLabels {
218212
@IModelService modelService: IModelService,
219213
@IDecorationsService decorationsService: IDecorationsService,
220214
@IThemeService themeService: IThemeService,
221-
@IFileService fileService: IFileService,
222215
@ILabelService labelService: ILabelService,
223216
@ITextFileService textFileService: ITextFileService
224217
) {
225-
super(DEFAULT_LABELS_CONTAINER, instantiationService, extensionService, configurationService, modelService, decorationsService, themeService, fileService, labelService, textFileService);
218+
super(DEFAULT_LABELS_CONTAINER, instantiationService, extensionService, configurationService, modelService, decorationsService, themeService, labelService, textFileService);
226219

227220
this._label = this._register(this.create(container, options));
228221
}

0 commit comments

Comments
 (0)