mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
@@ -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' });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user