|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 |
| -import { localize } from 'vs/nls'; |
7 | 6 | import { URI } from 'vs/base/common/uri';
|
8 |
| -import { IFileEditorInput, Verbosity, GroupIdentifier, IMoveResult, isTextEditorPane } from 'vs/workbench/common/editor'; |
| 7 | +import { IFileEditorInput, Verbosity, GroupIdentifier, IMoveResult, isTextEditorPane, decorateFileEditorLabel } from 'vs/workbench/common/editor'; |
9 | 8 | import { AbstractTextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput';
|
10 | 9 | import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
|
11 | 10 | import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files';
|
@@ -188,6 +187,7 @@ export class FileEditorInput extends AbstractTextResourceEditorInput implements
|
188 | 187 | private decorateLabel(label: string): string {
|
189 | 188 | const orphaned = this.model?.hasState(TextFileEditorModelState.ORPHAN);
|
190 | 189 | const readonly = this.isReadonly();
|
| 190 | + |
191 | 191 | return decorateFileEditorLabel(label, { orphaned: !!orphaned, readonly });
|
192 | 192 | }
|
193 | 193 |
|
@@ -394,19 +394,3 @@ export class FileEditorInput extends AbstractTextResourceEditorInput implements
|
394 | 394 | this.cachedTextFileModelReference = undefined;
|
395 | 395 | }
|
396 | 396 | }
|
397 |
| - |
398 |
| -export function decorateFileEditorLabel(label: string, state: { orphaned: boolean, readonly: boolean }): string { |
399 |
| - if (state.orphaned && state.readonly) { |
400 |
| - return localize('orphanedReadonlyFile', "{0} (deleted, read-only)", label); |
401 |
| - } |
402 |
| - |
403 |
| - if (state.orphaned) { |
404 |
| - return localize('orphanedFile', "{0} (deleted)", label); |
405 |
| - } |
406 |
| - |
407 |
| - if (state.readonly) { |
408 |
| - return localize('readonlyFile', "{0} (read-only)", label); |
409 |
| - } |
410 |
| - |
411 |
| - return label; |
412 |
| -} |
0 commit comments