提交 6d3ac521 编写于 作者: I isidor

IUriDisplayService -> IUriLabelService

fixes #55886
上级 9293ce9f
......@@ -63,7 +63,7 @@ import { serve as serveDriver } from 'vs/platform/driver/electron-main/driver';
import { IMenubarService } from 'vs/platform/menubar/common/menubar';
import { MenubarService } from 'vs/platform/menubar/electron-main/menubarService';
import { MenubarChannel } from 'vs/platform/menubar/common/menubarIpc';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { CodeMenu } from 'vs/code/electron-main/menus';
import { hasArgs } from 'vs/platform/environment/node/argv';
import { RunOnceScheduler } from 'vs/base/common/async';
......@@ -90,7 +90,7 @@ export class CodeApplication {
@IConfigurationService private configurationService: ConfigurationService,
@IStateService private stateService: IStateService,
@IHistoryMainService private historyMainService: IHistoryMainService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
this.toDispose = [mainIpcServer, configurationService];
......@@ -225,8 +225,8 @@ export class CodeApplication {
}
});
ipc.on('vscode:uriDisplayRegisterFormater', (event: any, { scheme, formater }) => {
this.uriDisplayService.registerFormater(scheme, formater);
ipc.on('vscode:uriLabelRegisterFormater', (event: any, { scheme, formater }) => {
this.uriLabelService.registerFormater(scheme, formater);
});
// Keyboard layout changes
......
......@@ -50,7 +50,7 @@ import { uploadLogs } from 'vs/code/electron-main/logUploader';
import { setUnexpectedErrorHandler } from 'vs/base/common/errors';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { CommandLineDialogService } from 'vs/platform/dialogs/node/dialogService';
import { IUriDisplayService, UriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService, UriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
function createServices(args: ParsedArgs, bufferLogService: BufferLogService): IInstantiationService {
const services = new ServiceCollection();
......@@ -58,7 +58,7 @@ function createServices(args: ParsedArgs, bufferLogService: BufferLogService): I
const environmentService = new EnvironmentService(args, process.execPath);
const consoleLogService = new ConsoleLogMainService(getLogLevel(environmentService));
const logService = new MultiplexLogService([consoleLogService, bufferLogService]);
const uriDisplayService = new UriDisplayService(environmentService, undefined);
const uriLabelService = new UriLabelService(environmentService, undefined);
process.once('exit', () => logService.dispose());
......@@ -66,7 +66,7 @@ function createServices(args: ParsedArgs, bufferLogService: BufferLogService): I
setTimeout(() => cleanupOlderLogs(environmentService).then(null, err => console.error(err)), 10000);
services.set(IEnvironmentService, environmentService);
services.set(IUriDisplayService, uriDisplayService);
services.set(IUriLabelService, uriLabelService);
services.set(ILogService, logService);
services.set(IWorkspacesMainService, new SyncDescriptor(WorkspacesMainService));
services.set(IHistoryMainService, new SyncDescriptor(HistoryMainService));
......
......@@ -22,7 +22,7 @@ import { IHistoryMainService } from 'vs/platform/history/common/history';
import { IWorkspaceIdentifier, getWorkspaceLabel, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
import { IMenubarData, IMenubarKeybinding, MenubarMenuItem, isMenubarMenuItemSeparator, isMenubarMenuItemSubmenu, isMenubarMenuItemAction } from 'vs/platform/menubar/common/menubar';
import URI from 'vs/base/common/uri';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
const telemetryFrom = 'menu';
......@@ -49,7 +49,7 @@ export class Menubar {
@IEnvironmentService private environmentService: IEnvironmentService,
@ITelemetryService private telemetryService: ITelemetryService,
@IHistoryMainService private historyMainService: IHistoryMainService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
this.menuUpdater = new RunOnceScheduler(() => this.doUpdateMenu(), 0);
......@@ -563,13 +563,13 @@ export class Menubar {
let label: string;
let uri: URI;
if (isSingleFolderWorkspaceIdentifier(workspaceOrFile) && !isFile) {
label = unmnemonicLabel(getWorkspaceLabel(workspaceOrFile, this.environmentService, this.uriDisplayService, { verbose: true }));
label = unmnemonicLabel(getWorkspaceLabel(workspaceOrFile, this.environmentService, this.uriLabelService, { verbose: true }));
uri = workspaceOrFile;
} else if (isWorkspaceIdentifier(workspaceOrFile)) {
label = getWorkspaceLabel(workspaceOrFile, this.environmentService, this.uriDisplayService, { verbose: true });
label = getWorkspaceLabel(workspaceOrFile, this.environmentService, this.uriLabelService, { verbose: true });
uri = URI.file(workspaceOrFile.configPath);
} else {
label = unmnemonicLabel(this.uriDisplayService.getLabel(workspaceOrFile));
label = unmnemonicLabel(this.uriLabelService.getLabel(workspaceOrFile));
uri = workspaceOrFile;
}
......
......@@ -24,7 +24,7 @@ import { IWindowsMainService, IWindowsCountChangedEvent } from 'vs/platform/wind
import { IHistoryMainService } from 'vs/platform/history/common/history';
import { IWorkspaceIdentifier, getWorkspaceLabel, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
import URI from 'vs/base/common/uri';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
interface IMenuItemClickHandler {
inDevTools: (contents: Electron.WebContents) => void;
......@@ -68,7 +68,7 @@ export class CodeMenu {
@IEnvironmentService private environmentService: IEnvironmentService,
@ITelemetryService private telemetryService: ITelemetryService,
@IHistoryMainService private historyMainService: IHistoryMainService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
this.nativeTabMenuItems = [];
......@@ -496,14 +496,14 @@ export class CodeMenu {
let label: string;
let uri: URI;
if (isSingleFolderWorkspaceIdentifier(workspace)) {
label = unmnemonicLabel(getWorkspaceLabel(workspace, this.environmentService, this.uriDisplayService, { verbose: true }));
label = unmnemonicLabel(getWorkspaceLabel(workspace, this.environmentService, this.uriLabelService, { verbose: true }));
uri = workspace;
} else if (isWorkspaceIdentifier(workspace)) {
label = getWorkspaceLabel(workspace, this.environmentService, this.uriDisplayService, { verbose: true });
label = getWorkspaceLabel(workspace, this.environmentService, this.uriLabelService, { verbose: true });
uri = URI.file(workspace.configPath);
} else {
uri = URI.file(workspace);
label = unmnemonicLabel(this.uriDisplayService.getLabel(uri));
label = unmnemonicLabel(this.uriLabelService.getLabel(uri));
}
return new MenuItem(this.likeAction(commandId, {
......@@ -1319,4 +1319,4 @@ export class CodeMenu {
function __separator__(): Electron.MenuItem {
return new MenuItem({ type: 'separator' });
}
\ No newline at end of file
}
......@@ -40,7 +40,7 @@ import { WorkbenchTree, WorkbenchTreeController } from 'vs/platform/list/browser
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { Location } from 'vs/editor/common/modes';
import { ClickBehavior } from 'vs/base/parts/tree/browser/treeDefaults';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { dirname, basenameOrAuthority } from 'vs/base/common/resources';
import { getBaseLabel } from 'vs/base/common/labels';
......@@ -300,7 +300,7 @@ class FileReferencesTemplate {
constructor(
container: HTMLElement,
@IUriDisplayService private readonly _uriDisplay: IUriDisplayService,
@IUriLabelService private readonly _uriLabel: IUriLabelService,
@IThemeService themeService: IThemeService,
) {
const parent = document.createElement('div');
......@@ -319,7 +319,7 @@ class FileReferencesTemplate {
set(element: FileReferences) {
let parent = dirname(element.uri);
this.file.setValue(getBaseLabel(element.uri), parent ? this._uriDisplay.getLabel(parent, true) : undefined, { title: this._uriDisplay.getLabel(element.uri) });
this.file.setValue(getBaseLabel(element.uri), parent ? this._uriLabel.getLabel(parent, true) : undefined, { title: this._uriLabel.getLabel(element.uri) });
const len = element.children.length;
this.badge.setCount(len);
if (element.failure) {
......@@ -368,7 +368,7 @@ class Renderer implements tree.IRenderer {
constructor(
@IThemeService private readonly _themeService: IThemeService,
@IUriDisplayService private readonly _uriDisplay: IUriDisplayService,
@IUriLabelService private readonly _uriLabel: IUriLabelService,
) {
//
}
......@@ -388,7 +388,7 @@ class Renderer implements tree.IRenderer {
renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement) {
if (templateId === Renderer._ids.FileReferences) {
return new FileReferencesTemplate(container, this._uriDisplay, this._themeService);
return new FileReferencesTemplate(container, this._uriLabel, this._themeService);
} else if (templateId === Renderer._ids.OneReference) {
return new OneReferenceTemplate(container);
}
......@@ -532,7 +532,7 @@ export class ReferenceWidget extends PeekViewWidget {
@IThemeService themeService: IThemeService,
@ITextModelService private _textModelResolverService: ITextModelService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IUriDisplayService private _uriDisplay: IUriDisplayService
@IUriLabelService private _uriLabel: IUriLabelService
) {
super(editor, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true });
......@@ -778,7 +778,7 @@ export class ReferenceWidget extends PeekViewWidget {
// Update widget header
if (reference.uri.scheme !== Schemas.inMemory) {
this.setTitle(basenameOrAuthority(reference.uri), this._uriDisplay.getLabel(dirname(reference.uri), false));
this.setTitle(basenameOrAuthority(reference.uri), this._uriLabel.getLabel(dirname(reference.uri), false));
} else {
this.setTitle(nls.localize('peekView.alternateTitle', "References"));
}
......
......@@ -45,7 +45,7 @@ import { WorkspaceEdit, isResourceTextEdit, TextEdit } from 'vs/editor/common/mo
import { IModelService } from 'vs/editor/common/services/modelService';
import { EditOperation } from 'vs/editor/common/core/editOperation';
import { localize } from 'vs/nls';
import { IUriDisplayService, UriDisplayRules } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService, UriLabelRules } from 'vs/platform/uriLabel/common/uriLabel';
export class SimpleModel implements ITextEditorModel {
......@@ -592,11 +592,11 @@ export class SimpleBulkEditService implements IBulkEditService {
}
}
export class SimpleUriDisplayService implements IUriDisplayService {
export class SimpleUriLabelService implements IUriLabelService {
_serviceBrand: any;
private readonly _onDidRegisterFormater: Emitter<{ scheme: string, formater: UriDisplayRules }> = new Emitter<{ scheme: string, formater: UriDisplayRules }>();
public readonly onDidRegisterFormater: Event<{ scheme: string, formater: UriDisplayRules }> = this._onDidRegisterFormater.event;
private readonly _onDidRegisterFormater: Emitter<{ scheme: string, formater: UriLabelRules }> = new Emitter<{ scheme: string, formater: UriLabelRules }>();
public readonly onDidRegisterFormater: Event<{ scheme: string, formater: UriLabelRules }> = this._onDidRegisterFormater.event;
public getLabel(resource: URI, relative?: boolean): string {
if (resource.scheme === 'file') {
......@@ -605,7 +605,7 @@ export class SimpleUriDisplayService implements IUriDisplayService {
return resource.path;
}
public registerFormater(schema: string, formater: UriDisplayRules): IDisposable {
public registerFormater(schema: string, formater: UriLabelRules): IDisposable {
throw new Error('Not implemented');
}
}
......@@ -33,7 +33,7 @@ import { StandaloneCodeEditorServiceImpl } from 'vs/editor/standalone/browser/st
import {
SimpleConfigurationService, SimpleResourceConfigurationService, SimpleMenuService,
SimpleProgressService, StandaloneCommandService, StandaloneKeybindingService, SimpleNotificationService,
StandaloneTelemetryService, SimpleWorkspaceContextService, SimpleDialogService, SimpleBulkEditService, SimpleUriDisplayService
StandaloneTelemetryService, SimpleWorkspaceContextService, SimpleDialogService, SimpleBulkEditService, SimpleUriLabelService
} from 'vs/editor/standalone/browser/simpleServices';
import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService';
import { IMenuService } from 'vs/platform/actions/common/actions';
......@@ -44,7 +44,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { IListService, ListService } from 'vs/platform/list/browser/listService';
import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
export interface IEditorOverrideServices {
[index: string]: any;
......@@ -122,7 +122,7 @@ export module StaticServices {
export const contextService = define(IWorkspaceContextService, () => new SimpleWorkspaceContextService());
export const uriDisplayService = define(IUriDisplayService, () => new SimpleUriDisplayService());
export const uriLabelService = define(IUriLabelService, () => new SimpleUriLabelService());
export const telemetryService = define(ITelemetryService, () => new StandaloneTelemetryService());
......
......@@ -22,7 +22,7 @@ import { RunOnceScheduler } from 'vs/base/common/async';
import { getComparisonKey, isEqual as areResourcesEqual, hasToIgnoreCase, dirname } from 'vs/base/common/resources';
import URI, { UriComponents } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
interface ISerializedRecentlyOpened {
workspaces2: (IWorkspaceIdentifier | string)[]; // IWorkspaceIdentifier or URI.toString()
......@@ -53,7 +53,7 @@ export class HistoryMainService implements IHistoryMainService {
@ILogService private logService: ILogService,
@IWorkspacesMainService private workspacesMainService: IWorkspacesMainService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
this.macOSRecentDocumentsUpdater = new RunOnceScheduler(() => this.updateMacOSRecentDocuments(), 800);
......@@ -368,11 +368,11 @@ export class HistoryMainService implements IHistoryMainService {
type: 'custom',
name: nls.localize('recentFolders', "Recent Workspaces"),
items: this.getRecentlyOpened().workspaces.slice(0, 7 /* limit number of entries here */).map(workspace => {
const title = getWorkspaceLabel(workspace, this.environmentService, this.uriDisplayService);
const title = getWorkspaceLabel(workspace, this.environmentService, this.uriLabelService);
let description;
let args;
if (isSingleFolderWorkspaceIdentifier(workspace)) {
description = nls.localize('folderDesc', "{0} {1}", getBaseLabel(workspace), this.uriDisplayService.getLabel(dirname(workspace)));
description = nls.localize('folderDesc', "{0} {1}", getBaseLabel(workspace), this.uriLabelService.getLabel(dirname(workspace)));
args = `--folder-uri "${workspace.toString()}"`;
} else {
description = nls.localize('codeWorkspace', "Code Workspace");
......
......@@ -14,21 +14,21 @@ import { isLinux, isWindows } from 'vs/base/common/platform';
import { tildify, getPathLabel } from 'vs/base/common/labels';
import { ltrim } from 'vs/base/common/strings';
export interface IUriDisplayService {
export interface IUriLabelService {
_serviceBrand: any;
getLabel(resource: URI, relative?: boolean): string;
registerFormater(schema: string, formater: UriDisplayRules): IDisposable;
onDidRegisterFormater: Event<{ scheme: string, formater: UriDisplayRules }>;
registerFormater(schema: string, formater: UriLabelRules): IDisposable;
onDidRegisterFormater: Event<{ scheme: string, formater: UriLabelRules }>;
}
export interface UriDisplayRules {
export interface UriLabelRules {
label: string; // myLabel:/${path}
separator: '/' | '\\' | '';
tildify?: boolean;
normalizeDriveLetter?: boolean;
}
const URI_DISPLAY_SERVICE_ID = 'uriDisplay';
const URI_LABEL_SERVICE_ID = 'uriLabel';
const sepRegexp = /\//g;
const labelMatchingRegexp = /\$\{scheme\}|\$\{authority\}|\$\{path\}/g;
......@@ -36,11 +36,11 @@ function hasDriveLetter(path: string): boolean {
return isWindows && path && path[2] === ':';
}
export class UriDisplayService implements IUriDisplayService {
export class UriLabelService implements IUriLabelService {
_serviceBrand: any;
private readonly formaters = new Map<string, UriDisplayRules>();
private readonly _onDidRegisterFormater = new Emitter<{ scheme: string, formater: UriDisplayRules }>();
private readonly formaters = new Map<string, UriLabelRules>();
private readonly _onDidRegisterFormater = new Emitter<{ scheme: string, formater: UriLabelRules }>();
constructor(
@IEnvironmentService private environmentService: IEnvironmentService,
......@@ -48,7 +48,7 @@ export class UriDisplayService implements IUriDisplayService {
) { }
get onDidRegisterFormater(): Event<{ scheme: string, formater: UriDisplayRules }> {
get onDidRegisterFormater(): Event<{ scheme: string, formater: UriLabelRules }> {
return this._onDidRegisterFormater.event;
}
......@@ -85,7 +85,7 @@ export class UriDisplayService implements IUriDisplayService {
return this.formatUri(resource, formater);
}
registerFormater(scheme: string, formater: UriDisplayRules): IDisposable {
registerFormater(scheme: string, formater: UriLabelRules): IDisposable {
this.formaters.set(scheme, formater);
this._onDidRegisterFormater.fire({ scheme, formater });
......@@ -94,7 +94,7 @@ export class UriDisplayService implements IUriDisplayService {
};
}
private formatUri(resource: URI, formater: UriDisplayRules): string {
private formatUri(resource: URI, formater: UriLabelRules): string {
let label = formater.label.replace(labelMatchingRegexp, match => {
switch (match) {
case '${scheme}': return resource.scheme;
......@@ -117,4 +117,4 @@ export class UriDisplayService implements IUriDisplayService {
}
}
export const IUriDisplayService = createDecorator<IUriDisplayService>(URI_DISPLAY_SERVICE_ID);
export const IUriLabelService = createDecorator<IUriLabelService>(URI_LABEL_SERVICE_ID);
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { ipcRenderer as ipc } from 'electron';
import { Registry } from 'vs/platform/registry/common/platform';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
......@@ -13,13 +13,13 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
* Uri display registration needs to be shared from renderer to main.
* Since there will be another instance of the uri display service running on main.
*/
class UriDisplayRegistrationContribution implements IWorkbenchContribution {
class UriLabelRegistrationContribution implements IWorkbenchContribution {
constructor(@IUriDisplayService uriDisplayService: IUriDisplayService) {
uriDisplayService.onDidRegisterFormater(data => {
ipc.send('vscode:uriDisplayRegisterFormater', data);
constructor(@IUriLabelService uriLabelService: IUriLabelService) {
uriLabelService.onDidRegisterFormater(data => {
ipc.send('vscode:uriLabelRegisterFormater', data);
});
}
}
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(UriDisplayRegistrationContribution, LifecyclePhase.Starting);
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(UriLabelRegistrationContribution, LifecyclePhase.Starting);
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { IUriDisplayService, UriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService, UriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { TestEnvironmentService, TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { Schemas } from 'vs/base/common/network';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
......@@ -12,16 +12,16 @@ import URI from 'vs/base/common/uri';
import { nativeSep } from 'vs/base/common/paths';
import { isWindows } from 'vs/base/common/platform';
suite('URI Display', () => {
suite('URI Label', () => {
let uriDisplayService: IUriDisplayService;
let uriLabelService: IUriLabelService;
setup(() => {
uriDisplayService = new UriDisplayService(TestEnvironmentService, new TestContextService());
uriLabelService = new UriLabelService(TestEnvironmentService, new TestContextService());
});
test('file scheme', function () {
uriDisplayService.registerFormater(Schemas.file, {
uriLabelService.registerFormater(Schemas.file, {
label: '${path}',
separator: nativeSep,
tildify: !isWindows,
......@@ -29,15 +29,15 @@ suite('URI Display', () => {
});
const uri1 = TestWorkspace.folders[0].uri.with({ path: TestWorkspace.folders[0].uri.path.concat('/a/b/c/d') });
assert.equal(uriDisplayService.getLabel(uri1, true), isWindows ? 'a\\b\\c\\d' : 'a/b/c/d');
assert.equal(uriDisplayService.getLabel(uri1, false), isWindows ? 'C:\\testWorkspace\\a\\b\\c\\d' : '/testWorkspace/a/b/c/d');
assert.equal(uriLabelService.getLabel(uri1, true), isWindows ? 'a\\b\\c\\d' : 'a/b/c/d');
assert.equal(uriLabelService.getLabel(uri1, false), isWindows ? 'C:\\testWorkspace\\a\\b\\c\\d' : '/testWorkspace/a/b/c/d');
const uri2 = URI.file('c:\\1/2/3');
assert.equal(uriDisplayService.getLabel(uri2, false), isWindows ? 'C:\\1\\2\\3' : '/c:\\1/2/3');
assert.equal(uriLabelService.getLabel(uri2, false), isWindows ? 'C:\\1\\2\\3' : '/c:\\1/2/3');
});
test('custom scheme', function () {
uriDisplayService.registerFormater(Schemas.vscode, {
uriLabelService.registerFormater(Schemas.vscode, {
label: 'LABEL/${path}/${authority}/END',
separator: '/',
tildify: true,
......@@ -45,6 +45,6 @@ suite('URI Display', () => {
});
const uri1 = URI.parse('vscode://microsoft.com/1/2/3/4/5');
assert.equal(uriDisplayService.getLabel(uri1, false), 'LABEL//1/2/3/4/5/microsoft.com/END');
assert.equal(uriLabelService.getLabel(uri1, false), 'LABEL//1/2/3/4/5/microsoft.com/END');
});
});
......@@ -17,7 +17,7 @@ import { getBaseLabel } from 'vs/base/common/labels';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import URI from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
export const IWorkspacesMainService = createDecorator<IWorkspacesMainService>('workspacesMainService');
export const IWorkspacesService = createDecorator<IWorkspacesService>('workspacesService');
......@@ -113,17 +113,17 @@ export interface IWorkspacesService {
createWorkspace(folders?: IWorkspaceFolderCreationData[]): TPromise<IWorkspaceIdentifier>;
}
export function getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier), environmentService: IEnvironmentService, uriDisplayService: IUriDisplayService, options?: { verbose: boolean }): string {
export function getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier), environmentService: IEnvironmentService, uriLabelService: IUriLabelService, options?: { verbose: boolean }): string {
// Workspace: Single Folder
if (isSingleFolderWorkspaceIdentifier(workspace)) {
// Folder on disk
if (workspace.scheme === Schemas.file) {
return options && options.verbose ? uriDisplayService.getLabel(workspace) : getBaseLabel(workspace);
return options && options.verbose ? uriLabelService.getLabel(workspace) : getBaseLabel(workspace);
}
// Remote folder
return options && options.verbose ? uriDisplayService.getLabel(workspace) : `${getBaseLabel(workspace)} (${workspace.scheme})`;
return options && options.verbose ? uriLabelService.getLabel(workspace) : `${getBaseLabel(workspace)} (${workspace.scheme})`;
}
// Workspace: Untitled
......@@ -135,7 +135,7 @@ export function getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFold
const filename = basename(workspace.configPath);
const workspaceName = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
if (options && options.verbose) {
return localize('workspaceNameVerbose', "{0} (Workspace)", uriDisplayService.getLabel(URI.file(join(dirname(workspace.configPath), workspaceName))));
return localize('workspaceNameVerbose', "{0} (Workspace)", uriLabelService.getLabel(URI.file(join(dirname(workspace.configPath), workspaceName))));
}
return localize('workspaceName', "{0} (Workspace)", workspaceName);
......
......@@ -11,7 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import { FileWriteOptions, FileSystemProviderCapabilities, IFileChange, IFileService, IFileSystemProvider, IStat, IWatchOptions, FileType, FileOverwriteOptions, FileDeleteOptions } from 'vs/platform/files/common/files';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, ExtHostFileSystemShape, IExtHostContext, IFileChangeDto, MainContext, MainThreadFileSystemShape } from '../node/extHost.protocol';
import { UriDisplayRules, IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { UriLabelRules, IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
@extHostNamedCustomer(MainContext.MainThreadFileSystem)
export class MainThreadFileSystem implements MainThreadFileSystemShape {
......@@ -22,7 +22,7 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
constructor(
extHostContext: IExtHostContext,
@IFileService private readonly _fileService: IFileService,
@IUriDisplayService private readonly _uriDisplayService: IUriDisplayService
@IUriLabelService private readonly _uriLabelService: IUriLabelService
) {
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostFileSystem);
}
......@@ -41,8 +41,8 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
this._fileProvider.delete(handle);
}
$setUriFormatter(scheme: string, formatter: UriDisplayRules): void {
this._uriDisplayService.registerFormater(scheme, formatter);
$setUriFormatter(scheme: string, formatter: UriLabelRules): void {
this._uriLabelService.registerFormater(scheme, formatter);
}
$onFileSystemChange(handle: number, changes: IFileChangeDto[]): void {
......
......@@ -40,7 +40,7 @@ import { IExtensionDescription } from 'vs/workbench/services/extensions/common/e
import { createExtHostContextProxyIdentifier as createExtId, createMainContextProxyIdentifier as createMainId, IRPCProtocol, ProxyIdentifier } from 'vs/workbench/services/extensions/node/proxyIdentifier';
import { IProgressOptions, IProgressStep } from 'vs/workbench/services/progress/common/progress';
import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles';
import { UriDisplayRules } from 'vs/platform/uriDisplay/common/uriDisplay';
import { UriLabelRules } from 'vs/platform/uriLabel/common/uriLabel';
import * as vscode from 'vscode';
export interface IEnvironment {
......@@ -483,7 +483,7 @@ export interface IFileChangeDto {
export interface MainThreadFileSystemShape extends IDisposable {
$registerFileSystemProvider(handle: number, scheme: string, capabilities: FileSystemProviderCapabilities): void;
$unregisterProvider(handle: number): void;
$setUriFormatter(scheme: string, formatter: UriDisplayRules): void;
$setUriFormatter(scheme: string, formatter: UriLabelRules): void;
$onFileSystemChange(handle: number, resource: IFileChangeDto[]): void;
}
......
......@@ -15,7 +15,7 @@ import { values } from 'vs/base/common/map';
import { Range, FileChangeType } from 'vs/workbench/api/node/extHostTypes';
import { ExtHostLanguageFeatures } from 'vs/workbench/api/node/extHostLanguageFeatures';
import { Schemas } from 'vs/base/common/network';
import { UriDisplayRules } from 'vs/platform/uriDisplay/common/uriDisplay';
import { UriLabelRules } from 'vs/platform/uriLabel/common/uriLabel';
class FsLinkProvider implements vscode.DocumentLinkProvider {
......@@ -142,7 +142,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
});
}
setUriFormatter(scheme: string, formatter: UriDisplayRules): void {
setUriFormatter(scheme: string, formatter: UriLabelRules): void {
this._proxy.$setUriFormatter(scheme, formatter);
}
......
......@@ -22,7 +22,7 @@ import { FileKind, isParent } from 'vs/platform/files/common/files';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { isLinux } from 'vs/base/common/platform';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { IQuickInputService, IPickOptions, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
import { getIconClasses } from 'vs/workbench/browser/labels';
import { IModelService } from 'vs/editor/common/services/modelService';
......@@ -163,7 +163,7 @@ CommandsRegistry.registerCommand({
CommandsRegistry.registerCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, function (accessor, args?: [IPickOptions<IQuickPickItem>, CancellationToken]) {
const quickInputService = accessor.get(IQuickInputService);
const uriDisplayService = accessor.get(IUriDisplayService);
const uriLabelService = accessor.get(IUriLabelService);
const contextService = accessor.get(IWorkspaceContextService);
const modelService = accessor.get(IModelService);
const modeService = accessor.get(IModeService);
......@@ -176,7 +176,7 @@ CommandsRegistry.registerCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, function (acc
const folderPicks = folders.map(folder => {
return {
label: folder.name,
description: uriDisplayService.getLabel(resources.dirname(folder.uri), true),
description: uriLabelService.getLabel(resources.dirname(folder.uri), true),
folder,
iconClasses: getIconClasses(modelService, modeService, folder.uri, FileKind.ROOT_FOLDER)
} as IQuickPickItem;
......
......@@ -23,7 +23,7 @@ import { ITextModel } from 'vs/editor/common/model';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { Event, Emitter } from 'vs/base/common/event';
import { DataUri } from 'vs/workbench/common/resources';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
export interface IResourceLabel {
name: string;
......@@ -56,7 +56,7 @@ export class ResourceLabel extends IconLabel {
@IModelService private modelService: IModelService,
@IDecorationsService protected decorationsService: IDecorationsService,
@IThemeService private themeService: IThemeService,
@IUriDisplayService protected uriDisplayService: IUriDisplayService
@IUriLabelService protected uriLabelService: IUriLabelService
) {
super(container, options);
......@@ -191,7 +191,7 @@ export class ResourceLabel extends IconLabel {
iconLabelOptions.title = this.options.title;
} else if (resource && resource.scheme !== Schemas.data /* do not accidentally inline Data URIs */) {
if (!this.computedPathLabel) {
this.computedPathLabel = this.uriDisplayService.getLabel(resource);
this.computedPathLabel = this.uriLabelService.getLabel(resource);
}
iconLabelOptions.title = this.computedPathLabel;
......@@ -274,9 +274,9 @@ export class FileLabel extends ResourceLabel {
@IDecorationsService decorationsService: IDecorationsService,
@IThemeService themeService: IThemeService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
@IUriDisplayService uriDisplayService: IUriDisplayService
@IUriLabelService uriLabelService: IUriLabelService
) {
super(container, options, extensionService, configurationService, modeService, modelService, decorationsService, themeService, uriDisplayService);
super(container, options, extensionService, configurationService, modeService, modelService, decorationsService, themeService, uriLabelService);
}
setFile(resource: uri, options?: IFileLabelOptions): void {
......@@ -298,7 +298,7 @@ export class FileLabel extends ResourceLabel {
let description: string;
const hidePath = (options && options.hidePath) || (resource.scheme === Schemas.untitled && !this.untitledEditorService.hasAssociatedFilePath(resource));
if (!hidePath) {
description = this.uriDisplayService.getLabel(resources.dirname(resource), true);
description = this.uriLabelService.getLabel(resources.dirname(resource), true);
}
this.setLabel({ resource, name, description }, options);
......
......@@ -49,7 +49,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import { Dimension, addClass } from 'vs/base/browser/dom';
import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { timeout } from 'vs/base/common/async';
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
......@@ -684,7 +684,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
@IModelService private modelService: IModelService,
@ITextFileService private textFileService: ITextFileService,
@IConfigurationService private configurationService: IConfigurationService,
@IUriDisplayService uriDisplayService: IUriDisplayService,
@IUriLabelService uriLabelService: IUriLabelService,
@IFileService fileService: IFileService
) {
super(editorService);
......@@ -700,7 +700,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
const resourceInput = input as IResourceInput;
this.resource = resourceInput.resource;
this.label = resources.basenameOrAuthority(resourceInput.resource);
this.description = uriDisplayService.getLabel(resources.dirname(this.resource), true);
this.description = uriLabelService.getLabel(resources.dirname(this.resource), true);
this.dirty = this.resource && this.textFileService.isDirty(this.resource);
if (this.dirty && this.textFileService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
......
......@@ -30,7 +30,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import { RunOnceScheduler } from 'vs/base/common/async';
import { MENUBAR_SELECTION_FOREGROUND, MENUBAR_SELECTION_BACKGROUND, MENUBAR_SELECTION_BORDER, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_FOREGROUND, MENU_BACKGROUND, MENU_FOREGROUND, MENU_SELECTION_BACKGROUND, MENU_SELECTION_FOREGROUND, MENU_SELECTION_BORDER } from 'vs/workbench/common/theme';
import URI from 'vs/base/common/uri';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { foreground } from 'vs/platform/theme/common/colorRegistry';
import { IUpdateService, StateType } from 'vs/platform/update/common/update';
......@@ -121,7 +121,7 @@ export class MenubarControl extends Disposable {
@IKeybindingService private keybindingService: IKeybindingService,
@IConfigurationService private configurationService: IConfigurationService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IUriDisplayService private uriDisplayService: IUriDisplayService,
@IUriLabelService private uriLabelService: IUriLabelService,
@IUpdateService private updateService: IUpdateService
) {
......@@ -507,14 +507,14 @@ export class MenubarControl extends Disposable {
let uri: URI;
if (isSingleFolderWorkspaceIdentifier(workspace) && !isFile) {
label = getWorkspaceLabel(workspace, this.environmentService, this.uriDisplayService, { verbose: true });
label = getWorkspaceLabel(workspace, this.environmentService, this.uriLabelService, { verbose: true });
uri = workspace;
} else if (isWorkspaceIdentifier(workspace)) {
label = getWorkspaceLabel(workspace, this.environmentService, this.uriDisplayService, { verbose: true });
label = getWorkspaceLabel(workspace, this.environmentService, this.uriLabelService, { verbose: true });
uri = URI.file(workspace.configPath);
} else {
uri = workspace;
label = this.uriDisplayService.getLabel(uri);
label = this.uriLabelService.getLabel(uri);
}
return new Action(commandId, label, undefined, undefined, (event) => {
......
......@@ -34,7 +34,7 @@ import { addDisposableListener, EventType, EventHelper, Dimension } from 'vs/bas
import { MenubarControl } from 'vs/workbench/browser/parts/titlebar/menubarControl';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { template, getBaseLabel } from 'vs/base/common/labels';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { Event } from 'vs/base/common/event';
export class TitlebarPart extends Part implements ITitleService {
......@@ -84,7 +84,7 @@ export class TitlebarPart extends Part implements ITitleService {
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IInstantiationService private instantiationService: IInstantiationService,
@IThemeService themeService: IThemeService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
super(id, { hasTitle: false }, themeService);
......@@ -244,9 +244,9 @@ export class TitlebarPart extends Part implements ITitleService {
const activeEditorMedium = editor ? editor.getTitle(Verbosity.MEDIUM) : activeEditorShort;
const activeEditorLong = editor ? editor.getTitle(Verbosity.LONG) : activeEditorMedium;
const rootName = workspace.name;
const rootPath = root ? this.uriDisplayService.getLabel(root) : '';
const rootPath = root ? this.uriLabelService.getLabel(root) : '';
const folderName = folder ? folder.name : '';
const folderPath = folder ? this.uriDisplayService.getLabel(folder.uri) : '';
const folderPath = folder ? this.uriLabelService.getLabel(folder.uri) : '';
const dirty = editor && editor.isDirty() ? TitlebarPart.TITLE_DIRTY : '';
const appName = this.environmentService.appNameLong;
const separator = TitlebarPart.TITLE_SEPARATOR;
......
......@@ -18,7 +18,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUtils';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
/**
* An editor input to be used for untitled text buffers.
......@@ -46,7 +46,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
@IInstantiationService private instantiationService: IInstantiationService,
@ITextFileService private textFileService: ITextFileService,
@IHashService private hashService: IHashService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
super();
......@@ -79,17 +79,17 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
@memoize
private get shortDescription(): string {
return paths.basename(this.uriDisplayService.getLabel(resources.dirname(this.resource)));
return paths.basename(this.uriLabelService.getLabel(resources.dirname(this.resource)));
}
@memoize
private get mediumDescription(): string {
return this.uriDisplayService.getLabel(resources.dirname(this.resource), true);
return this.uriLabelService.getLabel(resources.dirname(this.resource), true);
}
@memoize
private get longDescription(): string {
return this.uriDisplayService.getLabel(resources.dirname(this.resource));
return this.uriLabelService.getLabel(resources.dirname(this.resource));
}
getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string {
......@@ -121,12 +121,12 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
@memoize
private get mediumTitle(): string {
return this.uriDisplayService.getLabel(this.resource, true);
return this.uriLabelService.getLabel(this.resource, true);
}
@memoize
private get longTitle(): string {
return this.uriDisplayService.getLabel(this.resource);
return this.uriLabelService.getLabel(this.resource);
}
getTitle(verbosity: Verbosity): string {
......
......@@ -46,7 +46,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { Context } from 'vs/platform/contextkey/browser/contextKeyService';
import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { dirname } from 'vs/base/common/resources';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IModeService } from 'vs/editor/common/services/modeService';
......@@ -700,7 +700,7 @@ export abstract class BaseOpenRecentAction extends Action {
private quickInputService: IQuickInputService,
private contextService: IWorkspaceContextService,
private environmentService: IEnvironmentService,
private uriDisplayService: IUriDisplayService,
private uriLabelService: IUriLabelService,
private keybindingService: IKeybindingService,
private modelService: IModelService,
private modeService: IModeService,
......@@ -717,22 +717,22 @@ export abstract class BaseOpenRecentAction extends Action {
private openRecent(recentWorkspaces: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier)[], recentFiles: URI[]): void {
const toPick = (workspace: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | URI, fileKind: FileKind, environmentService: IEnvironmentService, uriDisplayService: IUriDisplayService, buttons: IQuickInputButton[]) => {
const toPick = (workspace: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | URI, fileKind: FileKind, environmentService: IEnvironmentService, uriLabelService: IUriLabelService, buttons: IQuickInputButton[]) => {
let resource: URI;
let label: string;
let description: string;
if (isSingleFolderWorkspaceIdentifier(workspace) && fileKind !== FileKind.FILE) {
resource = workspace;
label = getWorkspaceLabel(workspace, environmentService, uriDisplayService);
description = uriDisplayService.getLabel(dirname(resource));
label = getWorkspaceLabel(workspace, environmentService, uriLabelService);
description = uriLabelService.getLabel(dirname(resource));
} else if (isWorkspaceIdentifier(workspace)) {
resource = URI.file(workspace.configPath);
label = getWorkspaceLabel(workspace, environmentService, uriDisplayService);
description = uriDisplayService.getLabel(dirname(resource));
label = getWorkspaceLabel(workspace, environmentService, uriLabelService);
description = uriLabelService.getLabel(dirname(resource));
} else {
resource = workspace;
label = getBaseLabel(workspace);
description = uriDisplayService.getLabel(dirname(resource));
description = uriLabelService.getLabel(dirname(resource));
}
return {
......@@ -751,8 +751,8 @@ export abstract class BaseOpenRecentAction extends Action {
return this.windowService.openWindow([resource], { forceNewWindow, forceOpenWorkspaceAsFile: isFile });
};
const workspacePicks = recentWorkspaces.map(workspace => toPick(workspace, isSingleFolderWorkspaceIdentifier(workspace) ? FileKind.FOLDER : FileKind.ROOT_FOLDER, this.environmentService, this.uriDisplayService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : void 0));
const filePicks = recentFiles.map(p => toPick(p, FileKind.FILE, this.environmentService, this.uriDisplayService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : void 0));
const workspacePicks = recentWorkspaces.map(workspace => toPick(workspace, isSingleFolderWorkspaceIdentifier(workspace) ? FileKind.FOLDER : FileKind.ROOT_FOLDER, this.environmentService, this.uriLabelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : void 0));
const filePicks = recentFiles.map(p => toPick(p, FileKind.FILE, this.environmentService, this.uriLabelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : void 0));
// focus second entry if the first recent workspace is the current workspace
let autoFocusSecondEntry: boolean = recentWorkspaces[0] && this.contextService.isCurrentWorkspace(recentWorkspaces[0]);
......@@ -800,9 +800,9 @@ export class OpenRecentAction extends BaseOpenRecentAction {
@IKeybindingService keybindingService: IKeybindingService,
@IModelService modelService: IModelService,
@IModeService modeService: IModeService,
@IUriDisplayService uriDisplayService: IUriDisplayService
@IUriLabelService uriLabelService: IUriLabelService
) {
super(id, label, windowService, windowsService, quickInputService, contextService, environmentService, uriDisplayService, keybindingService, modelService, modeService);
super(id, label, windowService, windowsService, quickInputService, contextService, environmentService, uriLabelService, keybindingService, modelService, modeService);
}
protected isQuickNavigate(): boolean {
......@@ -826,9 +826,9 @@ export class QuickOpenRecentAction extends BaseOpenRecentAction {
@IKeybindingService keybindingService: IKeybindingService,
@IModelService modelService: IModelService,
@IModeService modeService: IModeService,
@IUriDisplayService uriDisplayService: IUriDisplayService
@IUriLabelService uriLabelService: IUriLabelService
) {
super(id, label, windowService, windowsService, quickInputService, contextService, environmentService, uriDisplayService, keybindingService, modelService, modeService);
super(id, label, windowService, windowsService, quickInputService, contextService, environmentService, uriLabelService, keybindingService, modelService, modeService);
}
protected isQuickNavigate(): boolean {
......@@ -1721,4 +1721,4 @@ export class InspectContextKeysAction extends Action {
return TPromise.as(null);
}
}
\ No newline at end of file
}
......@@ -116,7 +116,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { WorkbenchThemeService } from 'vs/workbench/services/themes/electron-browser/workbenchThemeService';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IUriDisplayService, UriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService, UriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
interface WorkbenchParams {
configuration: IWindowConfiguration;
......@@ -337,9 +337,9 @@ export class Workbench extends Disposable implements IPartService {
serviceCollection.set(IClipboardService, new ClipboardService());
// Uri Display
const uriDisplayService = new UriDisplayService(this.environmentService, this.contextService);
serviceCollection.set(IUriDisplayService, uriDisplayService);
this.configurationService.acquireUriDisplayService(uriDisplayService);
const uriLabelService = new UriLabelService(this.environmentService, this.contextService);
serviceCollection.set(IUriLabelService, uriLabelService);
this.configurationService.acquireUriLabelService(uriLabelService);
// Status bar
this.statusbarPart = this.instantiationService.createInstance(StatusbarPart, Identifiers.STATUSBAR_PART);
......
......@@ -32,7 +32,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
const $ = dom.$;
......@@ -296,7 +296,7 @@ class BreakpointsRenderer implements IRenderer<IBreakpoint, IBreakpointTemplateD
constructor(
@IDebugService private debugService: IDebugService,
@IUriDisplayService private uriDisplayService: IUriDisplayService,
@IUriLabelService private uriLabelService: IUriLabelService,
@ITextFileService private textFileService: ITextFileService
) {
// noop
......@@ -340,7 +340,7 @@ class BreakpointsRenderer implements IRenderer<IBreakpoint, IBreakpointTemplateD
if (breakpoint.column) {
data.lineNumber.textContent += `:${breakpoint.column}`;
}
data.filePath.textContent = this.uriDisplayService.getLabel(resources.dirname(breakpoint.uri), true);
data.filePath.textContent = this.uriLabelService.getLabel(resources.dirname(breakpoint.uri), true);
data.checkbox.checked = breakpoint.enabled;
const { message, className } = getBreakpointMessageAndClassName(this.debugService, this.textFileService, breakpoint);
......
......@@ -27,7 +27,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
const $ = dom.$;
......@@ -398,7 +398,7 @@ class CallStackRenderer implements IRenderer {
constructor(
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
// noop
}
......@@ -517,7 +517,7 @@ class CallStackRenderer implements IRenderer {
dom.toggleClass(data.stackFrame, 'label', stackFrame.presentationHint === 'label');
dom.toggleClass(data.stackFrame, 'subtle', stackFrame.presentationHint === 'subtle');
data.file.title = stackFrame.source.inMemory ? stackFrame.source.name : this.uriDisplayService.getLabel(stackFrame.source.uri);
data.file.title = stackFrame.source.inMemory ? stackFrame.source.name : this.uriLabelService.getLabel(stackFrame.source.uri);
if (stackFrame.source.raw.origin) {
data.file.title += `\n${stackFrame.source.raw.origin}`;
}
......
......@@ -24,7 +24,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector';
import { handleANSIOutput } from 'vs/workbench/parts/debug/browser/debugANSIHandling';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
const $ = dom.$;
......@@ -97,7 +97,7 @@ export class ReplExpressionsRenderer implements IRenderer {
constructor(
@IEditorService private editorService: IEditorService,
@IInstantiationService private instantiationService: IInstantiationService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
this.linkDetector = this.instantiationService.createInstance(LinkDetector);
}
......@@ -260,7 +260,7 @@ export class ReplExpressionsRenderer implements IRenderer {
dom.addClass(templateData.value, (element.severity === severity.Warning) ? 'warn' : (element.severity === severity.Error) ? 'error' : (element.severity === severity.Ignore) ? 'ignore' : 'info');
templateData.source.textContent = element.sourceData ? `${element.sourceData.source.name}:${element.sourceData.lineNumber}` : '';
templateData.source.title = element.sourceData ? this.uriDisplayService.getLabel(element.sourceData.source.uri) : '';
templateData.source.title = element.sourceData ? this.uriLabelService.getLabel(element.sourceData.source.uri) : '';
templateData.getReplElementSource = () => element.sourceData;
}
......
......@@ -21,7 +21,7 @@ import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUt
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
import { FILE_EDITOR_INPUT_ID, TEXT_FILE_EDITOR_ID, BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
/**
* A file editor input is the input type for the file editor of file system resources.
......@@ -43,7 +43,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
@ITextFileService private textFileService: ITextFileService,
@ITextModelService private textModelResolverService: ITextModelService,
@IHashService private hashService: IHashService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
super();
......@@ -132,17 +132,17 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
@memoize
private get shortDescription(): string {
return paths.basename(this.uriDisplayService.getLabel(resources.dirname(this.resource)));
return paths.basename(this.uriLabelService.getLabel(resources.dirname(this.resource)));
}
@memoize
private get mediumDescription(): string {
return this.uriDisplayService.getLabel(resources.dirname(this.resource), true);
return this.uriLabelService.getLabel(resources.dirname(this.resource), true);
}
@memoize
private get longDescription(): string {
return this.uriDisplayService.getLabel(resources.dirname(this.resource), true);
return this.uriLabelService.getLabel(resources.dirname(this.resource), true);
}
getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string {
......@@ -170,12 +170,12 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
@memoize
private get mediumTitle(): string {
return this.uriDisplayService.getLabel(this.resource, true);
return this.uriLabelService.getLabel(this.resource, true);
}
@memoize
private get longTitle(): string {
return this.uriDisplayService.getLabel(this.resource, true);
return this.uriLabelService.getLabel(this.resource, true);
}
getTitle(verbosity: Verbosity): string {
......
......@@ -34,7 +34,7 @@ import { DataUriEditorInput } from 'vs/workbench/common/editor/dataUriEditorInpu
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { Schemas } from 'vs/base/common/network';
import { nativeSep } from 'vs/base/common/paths';
......@@ -53,10 +53,10 @@ export class OpenExplorerViewletAction extends ToggleViewletAction {
}
}
class FileUriDisplayContribution implements IWorkbenchContribution {
class FileUriLabelContribution implements IWorkbenchContribution {
constructor(@IUriDisplayService uriDisplayService: IUriDisplayService) {
uriDisplayService.registerFormater(Schemas.file, {
constructor(@IUriLabelService uriLabelService: IUriLabelService) {
uriLabelService.registerFormater(Schemas.file, {
label: '${path}',
separator: nativeSep,
tildify: !platform.isWindows,
......@@ -172,7 +172,7 @@ Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).regi
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DirtyFilesTracker, LifecyclePhase.Starting);
// Register uri display for file uris
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FileUriDisplayContribution, LifecyclePhase.Starting);
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FileUriLabelContribution, LifecyclePhase.Starting);
// Configuration
......
......@@ -13,7 +13,7 @@ import { join } from 'vs/base/common/paths';
import URI from 'vs/base/common/uri';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { language } from 'vs/base/common/platform';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
export class ConfigureLocaleAction extends Action {
public static readonly ID = 'workbench.action.configureLocale';
......@@ -32,7 +32,7 @@ export class ConfigureLocaleAction extends Action {
@IFileService private fileService: IFileService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IEditorService private editorService: IEditorService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
super(id, label);
}
......@@ -49,7 +49,7 @@ export class ConfigureLocaleAction extends Action {
resource: stat.resource
});
}, (error) => {
throw new Error(localize('fail.createSettings', "Unable to create '{0}' ({1}).", this.uriDisplayService.getLabel(file, true), error));
throw new Error(localize('fail.createSettings', "Unable to create '{0}' ({1}).", this.uriLabelService.getLabel(file, true), error));
});
}
}
......@@ -21,7 +21,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IDisposable } from 'vs/base/common/lifecycle';
import { ActionBar, IActionItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
import { QuickFixAction } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
interface IResourceMarkersTemplateData {
resourceLabel: ResourceLabel;
......@@ -99,7 +99,7 @@ export class Renderer implements IRenderer {
private actionItemProvider: IActionItemProvider,
@IInstantiationService private instantiationService: IInstantiationService,
@IThemeService private themeService: IThemeService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
}
......@@ -208,7 +208,7 @@ export class Renderer implements IRenderer {
if (templateData.resourceLabel instanceof FileLabel) {
templateData.resourceLabel.setFile(element.uri, { matches: element.uriMatches });
} else {
templateData.resourceLabel.setLabel({ name: element.name, description: this.uriDisplayService.getLabel(element.uri, true), resource: element.uri }, { matches: element.uriMatches });
templateData.resourceLabel.setLabel({ name: element.name, description: this.uriLabelService.getLabel(element.uri, true), resource: element.uri }, { matches: element.uriMatches });
}
(<IResourceMarkersTemplateData>templateData).count.setCount(element.filteredCount);
}
......@@ -235,7 +235,7 @@ export class Renderer implements IRenderer {
private renderRelatedInfoElement(tree: ITree, element: RelatedInformation, templateData: IRelatedInformationTemplateData) {
templateData.resourceLabel.set(paths.basename(element.raw.resource.fsPath), element.uriMatches);
templateData.resourceLabel.element.title = this.uriDisplayService.getLabel(element.raw.resource, true);
templateData.resourceLabel.element.title = this.uriLabelService.getLabel(element.raw.resource, true);
templateData.lnCol.textContent = Messages.MARKERS_PANEL_AT_LINE_COL_NUMBER(element.raw.startLineNumber, element.raw.startColumn);
templateData.description.set(element.raw.message, element.messageMatches);
templateData.description.element.title = element.raw.message;
......@@ -272,13 +272,13 @@ export class Renderer implements IRenderer {
export class MarkersTreeAccessibilityProvider implements IAccessibilityProvider {
constructor(
@IUriDisplayService private uriDisplayServie: IUriDisplayService
@IUriLabelService private uriLabelServie: IUriLabelService
) {
}
public getAriaLabel(tree: ITree, element: any): string {
if (element instanceof ResourceMarkers) {
const path = this.uriDisplayServie.getLabel(element.uri, true) || element.uri.fsPath;
const path = this.uriLabelServie.getLabel(element.uri, true) || element.uri.fsPath;
return Messages.MARKERS_TREE_ARIA_LABEL_RESOURCE(element.filteredCount, element.name, paths.dirname(path));
}
if (element instanceof Marker) {
......
......@@ -33,7 +33,7 @@ import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/comm
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { prepareQuery, IPreparedQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer';
import { IFileService } from 'vs/platform/files/common/files';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
import { untildify } from 'vs/base/common/labels';
export class FileQuickOpenModel extends QuickOpenModel {
......@@ -127,7 +127,7 @@ export class OpenFileHandler extends QuickOpenHandler {
@ISearchService private searchService: ISearchService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IFileService private fileService: IFileService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
super();
......@@ -173,7 +173,7 @@ export class OpenFileHandler extends QuickOpenHandler {
const fileMatch = complete.results[i];
const label = paths.basename(fileMatch.resource.fsPath);
const description = this.uriDisplayService.getLabel(resources.dirname(fileMatch.resource), true);
const description = this.uriLabelService.getLabel(resources.dirname(fileMatch.resource), true);
results.push(this.instantiationService.createInstance(FileEntry, fileMatch.resource, label, description, iconClass));
}
......
......@@ -23,7 +23,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { IWorkspaceSymbolProvider, getWorkspaceSymbols, IWorkspaceSymbol } from 'vs/workbench/parts/search/common/search';
import { basename } from 'vs/base/common/paths';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
class SymbolEntry extends EditorQuickOpenEntry {
......@@ -34,7 +34,7 @@ class SymbolEntry extends EditorQuickOpenEntry {
private _provider: IWorkspaceSymbolProvider,
@IConfigurationService private readonly _configurationService: IConfigurationService,
@IEditorService editorService: IEditorService,
@IUriDisplayService private _uriDisplayService: IUriDisplayService
@IUriLabelService private _uriLabelService: IUriLabelService
) {
super(editorService);
}
......@@ -53,7 +53,7 @@ class SymbolEntry extends EditorQuickOpenEntry {
if (containerName) {
return `${containerName}${basename(this._bearing.location.uri.fsPath)}`;
} else {
return this._uriDisplayService.getLabel(this._bearing.location.uri, true);
return this._uriLabelService.getLabel(this._bearing.location.uri, true);
}
}
return containerName;
......
......@@ -27,7 +27,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions';
import { WorkbenchTreeController, WorkbenchTree } from 'vs/platform/list/browser/listService';
import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuItemActionItem';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
export class SearchDataSource implements IDataSource {
......@@ -318,7 +318,7 @@ export class SearchRenderer extends Disposable implements IRenderer {
export class SearchAccessibilityProvider implements IAccessibilityProvider {
constructor(
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
}
......@@ -328,7 +328,7 @@ export class SearchAccessibilityProvider implements IAccessibilityProvider {
}
if (element instanceof FileMatch) {
const path = this.uriDisplayService.getLabel(element.resource(), true) || element.resource().fsPath;
const path = this.uriLabelService.getLabel(element.resource(), true) || element.resource().fsPath;
return nls.localize('fileMatchAriaLabel', "{0} matches in file {1} of folder {2}, Search result", element.count(), element.name(), paths.dirname(path));
}
......
......@@ -40,7 +40,7 @@ import { getIdAndVersionFromLocalExtensionId } from 'vs/platform/extensionManage
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { TimeoutTimer } from 'vs/base/common/async';
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
used();
......@@ -226,7 +226,7 @@ class WelcomePage {
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IConfigurationService private configurationService: IConfigurationService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IUriDisplayService private uriDisplayService: IUriDisplayService,
@IUriLabelService private uriLabelService: IUriLabelService,
@INotificationService private notificationService: INotificationService,
@IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService,
@IExtensionGalleryService private extensionGalleryService: IExtensionGalleryService,
......@@ -283,9 +283,9 @@ class WelcomePage {
let resource: URI;
if (isSingleFolderWorkspaceIdentifier(workspace)) {
resource = workspace;
label = getWorkspaceLabel(workspace, this.environmentService, this.uriDisplayService);
label = getWorkspaceLabel(workspace, this.environmentService, this.uriLabelService);
} else if (isWorkspaceIdentifier(workspace)) {
label = getWorkspaceLabel(workspace, this.environmentService, this.uriDisplayService);
label = getWorkspaceLabel(workspace, this.environmentService, this.uriLabelService);
resource = URI.file(workspace.configPath);
} else {
label = getBaseLabel(workspace);
......@@ -307,7 +307,7 @@ class WelcomePage {
}
parentFolderPath = tildify(parentFolder, this.environmentService.userHome);
} else {
parentFolderPath = this.uriDisplayService.getLabel(resource);
parentFolderPath = this.uriLabelService.getLabel(resource);
}
......
......@@ -24,7 +24,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import { emptyProgressRunner, IProgress, IProgressRunner } from 'vs/platform/progress/common/progress';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
abstract class Recording {
......@@ -233,7 +233,7 @@ export class BulkEdit {
@ITextModelService private readonly _textModelService: ITextModelService,
@IFileService private readonly _fileService: IFileService,
@ITextFileService private readonly _textFileService: ITextFileService,
@IUriDisplayService private readonly _uriDisplayServie: IUriDisplayService
@IUriLabelService private readonly _uriLabelServie: IUriLabelService
) {
this._editor = editor;
this._progress = progress || emptyProgressRunner;
......@@ -339,7 +339,7 @@ export class BulkEdit {
const conflicts = edits
.filter(edit => recording.hasChanged(edit.resource))
.map(edit => this._uriDisplayServie.getLabel(edit.resource, true));
.map(edit => this._uriLabelServie.getLabel(edit.resource, true));
recording.stop();
......@@ -369,7 +369,7 @@ export class BulkEditService implements IBulkEditService {
@ITextModelService private readonly _textModelService: ITextModelService,
@IFileService private readonly _fileService: IFileService,
@ITextFileService private readonly _textFileService: ITextFileService,
@IUriDisplayService private readonly _uriDisplayService: IUriDisplayService
@IUriLabelService private readonly _uriLabelService: IUriLabelService
) {
}
......@@ -400,7 +400,7 @@ export class BulkEditService implements IBulkEditService {
}
}
const bulkEdit = new BulkEdit(options.editor, options.progress, this._logService, this._textModelService, this._fileService, this._textFileService, this._uriDisplayService);
const bulkEdit = new BulkEdit(options.editor, options.progress, this._logService, this._textModelService, this._fileService, this._textFileService, this._uriLabelService);
bulkEdit.add(edits);
return TPromise.wrap(bulkEdit.perform().then(() => {
......
......@@ -41,7 +41,7 @@ import { UserConfiguration } from 'vs/platform/configuration/node/configuration'
import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';
import { localize } from 'vs/nls';
import { isEqual, hasToIgnoreCase } from 'vs/base/common/resources';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
export class WorkspaceService extends Disposable implements IWorkspaceConfigurationService, IWorkspaceContextService {
......@@ -69,7 +69,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
public readonly onDidChangeWorkbenchState: Event<WorkbenchState> = this._onDidChangeWorkbenchState.event;
private fileService: IFileService;
private uriDisplayService: IUriDisplayService;
private uriLabelService: IUriLabelService;
private configurationEditingService: ConfigurationEditingService;
private jsonEditingService: JSONEditingService;
......@@ -319,8 +319,8 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
});
}
acquireUriDisplayService(uriDisplayService: IUriDisplayService): void {
this.uriDisplayService = uriDisplayService;
acquireUriLabelService(uriLabelService: IUriLabelService): void {
this.uriLabelService = uriLabelService;
}
acquireInstantiationService(instantiationService: IInstantiationService): void {
......@@ -346,7 +346,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
.then(() => {
const workspaceFolders = toWorkspaceFolders(this.workspaceConfiguration.getFolders(), URI.file(dirname(workspaceConfigPath.fsPath)));
const workspaceId = workspaceIdentifier.id;
const workspaceName = getWorkspaceLabel({ id: workspaceId, configPath: workspaceConfigPath.fsPath }, this.environmentService, this.uriDisplayService);
const workspaceName = getWorkspaceLabel({ id: workspaceId, configPath: workspaceConfigPath.fsPath }, this.environmentService, this.uriLabelService);
return new Workspace(workspaceId, workspaceName, workspaceFolders, workspaceConfigPath);
});
}
......@@ -369,11 +369,11 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
}
const id = createHash('md5').update(folder.fsPath).update(ctime ? String(ctime) : '').digest('hex');
return new Workspace(id, getWorkspaceLabel(folder, this.environmentService, this.uriDisplayService), toWorkspaceFolders([{ path: folder.fsPath }]), null, ctime);
return new Workspace(id, getWorkspaceLabel(folder, this.environmentService, this.uriLabelService), toWorkspaceFolders([{ path: folder.fsPath }]), null, ctime);
});
} else {
const id = createHash('md5').update(folder.toString()).digest('hex');
return TPromise.as(new Workspace(id, getWorkspaceLabel(folder, this.environmentService, this.uriDisplayService), toWorkspaceFolders([{ uri: folder.toString() }]), null));
return TPromise.as(new Workspace(id, getWorkspaceLabel(folder, this.environmentService, this.uriLabelService), toWorkspaceFolders([{ uri: folder.toString() }]), null));
}
}
......
......@@ -28,7 +28,7 @@ import { Disposable, IDisposable, dispose, toDisposable } from 'vs/base/common/l
import { coalesce } from 'vs/base/common/arrays';
import { isCodeEditor, isDiffEditor, ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorGroupView, IEditorOpeningEvent, EditorGroupsServiceImpl, EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
type ICachedEditorInput = ResourceEditorInput | IFileEditorInput | DataUriEditorInput;
......@@ -64,7 +64,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
@IEditorGroupsService private editorGroupService: EditorGroupsServiceImpl,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
@IInstantiationService private instantiationService: IInstantiationService,
@IUriDisplayService private uriDisplayService: IUriDisplayService,
@IUriLabelService private uriLabelService: IUriLabelService,
@IFileService private fileService: IFileService,
@IConfigurationService private configurationService: IConfigurationService
) {
......@@ -563,7 +563,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
}
// Otherwise: for diff labels prefer to see the path as part of the label
return this.uriDisplayService.getLabel(res, true);
return this.uriLabelService.getLabel(res, true);
}
//#endregion
......@@ -584,7 +584,7 @@ export class DelegatingEditorService extends EditorService {
@IEditorGroupsService editorGroupService: EditorGroupsServiceImpl,
@IUntitledEditorService untitledEditorService: IUntitledEditorService,
@IInstantiationService instantiationService: IInstantiationService,
@IUriDisplayService uriDisplayService: IUriDisplayService,
@IUriLabelService uriLabelService: IUriLabelService,
@IFileService fileService: IFileService,
@IConfigurationService configurationService: IConfigurationService
) {
......@@ -592,7 +592,7 @@ export class DelegatingEditorService extends EditorService {
editorGroupService,
untitledEditorService,
instantiationService,
uriDisplayService,
uriLabelService,
fileService,
configurationService
);
......
......@@ -36,7 +36,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import { assign } from 'vs/base/common/objects';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroup, IEditorGroupsService, GroupDirection } from 'vs/workbench/services/group/common/editorGroupsService';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
const emptyEditableSettingsContent = '{\n}';
......@@ -70,7 +70,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
@IModelService private modelService: IModelService,
@IJSONEditingService private jsonEditingService: IJSONEditingService,
@IModeService private modeService: IModeService,
@IUriDisplayService private uriDisplayService: IUriDisplayService
@IUriLabelService private uriLabelService: IUriLabelService
) {
super();
// The default keybindings.json updates based on keyboard layouts, so here we make sure
......@@ -445,7 +445,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
return this.fileService.resolveContent(resource, { acceptTextOnly: true }).then(null, error => {
if ((<FileOperationError>error).fileOperationResult === FileOperationResult.FILE_NOT_FOUND) {
return this.fileService.updateContent(resource, contents).then(null, error => {
return TPromise.wrapError(new Error(nls.localize('fail.createSettings', "Unable to create '{0}' ({1}).", this.uriDisplayService.getLabel(resource, true), error)));
return TPromise.wrapError(new Error(nls.localize('fail.createSettings', "Unable to create '{0}' ({1}).", this.uriLabelService.getLabel(resource, true), error)));
});
}
......
......@@ -28,7 +28,7 @@ import { BulkEditService } from 'vs/workbench/services/bulkEdit/electron-browser
import { NullLogService } from 'vs/platform/log/common/log';
import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService';
import { IReference, ImmortalReference } from 'vs/base/common/lifecycle';
import { UriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { UriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
suite('MainThreadEditors', () => {
......@@ -83,7 +83,7 @@ suite('MainThreadEditors', () => {
}
};
const bulkEditService = new BulkEditService(new NullLogService(), modelService, new TestEditorService(), textModelService, new TestFileService(), textFileService, new UriDisplayService(TestEnvironmentService, new TestContextService()));
const bulkEditService = new BulkEditService(new NullLogService(), modelService, new TestEditorService(), textModelService, new TestFileService(), textFileService, new UriLabelService(TestEnvironmentService, new TestContextService()));
const rpcProtocol = new TestRPCProtocol();
rpcProtocol.set(ExtHostContext.ExtHostDocuments, new class extends mock<ExtHostDocumentsShape>() {
......
......@@ -75,7 +75,7 @@ import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon';
import { EditorGroup } from 'vs/workbench/common/editor/editorGroup';
import { Dimension } from 'vs/base/browser/dom';
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
import { IUriDisplayService, UriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { IUriLabelService, UriLabelService } from 'vs/platform/uriLabel/common/uriLabel';
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
return instantiationService.createInstance(FileEditorInput, resource, void 0);
......@@ -271,7 +271,7 @@ export function workbenchInstantiationService(): IInstantiationService {
instantiationService.stub(IHashService, new TestHashService());
instantiationService.stub(ILogService, new TestLogService());
instantiationService.stub(IEditorGroupsService, new TestEditorGroupsService([new TestEditorGroup(0)]));
instantiationService.stub(IUriDisplayService, new UriDisplayService(TestEnvironmentService, workspaceContextService));
instantiationService.stub(IUriLabelService, new UriLabelService(TestEnvironmentService, workspaceContextService));
const editorService = new TestEditorService();
instantiationService.stub(IEditorService, editorService);
instantiationService.stub(ICodeEditorService, new TestCodeEditorService());
......
......@@ -17,7 +17,7 @@ import 'vs/editor/editor.all';
// Platform
import 'vs/platform/widget/browser/contextScopedHistoryWidget';
import 'vs/platform/uriDisplay/electron-browser/uriDisplay.contribution';
import 'vs/platform/uriLabel/electron-browser/uriLabel.contribution';
// Menus/Actions
import 'vs/workbench/services/actions/electron-browser/menusExtensionPoint';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册