mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
debt - merge workspaces and history into one
This commit is contained in:
@@ -12,9 +12,7 @@ import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
|
||||
import { EditorGroupLayout } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IOpenInWindowOptions, IWindowOpenable } from 'vs/platform/windows/common/windows';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { IWorkspacesService, hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IRecent } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
import { IWorkspacesService, hasWorkspaceFileExtension, IRecent } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
@@ -133,8 +131,8 @@ export class OpenAPICommand {
|
||||
CommandsRegistry.registerCommand(OpenAPICommand.ID, adjustHandler(OpenAPICommand.execute));
|
||||
|
||||
CommandsRegistry.registerCommand('_workbench.removeFromRecentlyOpened', function (accessor: ServicesAccessor, uri: URI) {
|
||||
const workspacesHistoryService = accessor.get(IWorkspacesHistoryService);
|
||||
return workspacesHistoryService.removeFromRecentlyOpened([uri]);
|
||||
const workspacesService = accessor.get(IWorkspacesService);
|
||||
return workspacesService.removeFromRecentlyOpened([uri]);
|
||||
});
|
||||
|
||||
export class RemoveFromRecentlyOpenedAPICommand {
|
||||
@@ -164,7 +162,6 @@ interface RecentEntry {
|
||||
}
|
||||
|
||||
CommandsRegistry.registerCommand('_workbench.addToRecentlyOpened', async function (accessor: ServicesAccessor, recentEntry: RecentEntry) {
|
||||
const workspacesHistoryService = accessor.get(IWorkspacesHistoryService);
|
||||
const workspacesService = accessor.get(IWorkspacesService);
|
||||
let recent: IRecent | undefined = undefined;
|
||||
const uri = recentEntry.uri;
|
||||
@@ -177,12 +174,12 @@ CommandsRegistry.registerCommand('_workbench.addToRecentlyOpened', async functio
|
||||
} else {
|
||||
recent = { fileUri: uri, label };
|
||||
}
|
||||
return workspacesHistoryService.addRecentlyOpened([recent]);
|
||||
return workspacesService.addRecentlyOpened([recent]);
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand('_workbench.getRecentlyOpened', async function (accessor: ServicesAccessor) {
|
||||
const workspacesHistoryService = accessor.get(IWorkspacesHistoryService);
|
||||
return workspacesHistoryService.getRecentlyOpened();
|
||||
const workspacesService = accessor.get(IWorkspacesService);
|
||||
return workspacesService.getRecentlyOpened();
|
||||
});
|
||||
|
||||
export class SetEditorLayoutAPICommand {
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'vs/css!./media/actions';
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IWindowOpenable } from 'vs/platform/windows/common/windows';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -22,7 +21,7 @@ import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IRecentWorkspace, IRecentFolder, IRecentFile, IRecent, isRecentFolder, isRecentWorkspace } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
import { IRecentWorkspace, IRecentFolder, IRecentFile, IRecent, isRecentFolder, isRecentWorkspace, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
@@ -45,7 +44,7 @@ abstract class BaseOpenRecentAction extends Action {
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
private workspacesHistoryService: IWorkspacesHistoryService,
|
||||
private workspacesService: IWorkspacesService,
|
||||
private quickInputService: IQuickInputService,
|
||||
private contextService: IWorkspaceContextService,
|
||||
private labelService: ILabelService,
|
||||
@@ -60,7 +59,7 @@ abstract class BaseOpenRecentAction extends Action {
|
||||
protected abstract isQuickNavigate(): boolean;
|
||||
|
||||
async run(): Promise<void> {
|
||||
const { workspaces, files } = await this.workspacesHistoryService.getRecentlyOpened();
|
||||
const { workspaces, files } = await this.workspacesService.getRecentlyOpened();
|
||||
|
||||
this.openRecent(workspaces, files);
|
||||
}
|
||||
@@ -130,7 +129,7 @@ abstract class BaseOpenRecentAction extends Action {
|
||||
onKeyMods: mods => keyMods = mods,
|
||||
quickNavigate: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : undefined,
|
||||
onDidTriggerItemButton: async context => {
|
||||
await this.workspacesHistoryService.removeFromRecentlyOpened([context.item.resource]);
|
||||
await this.workspacesService.removeFromRecentlyOpened([context.item.resource]);
|
||||
context.removeItem();
|
||||
}
|
||||
});
|
||||
@@ -149,7 +148,7 @@ export class OpenRecentAction extends BaseOpenRecentAction {
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IWorkspacesHistoryService workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService workspacesService: IWorkspacesService,
|
||||
@IQuickInputService quickInputService: IQuickInputService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@@ -158,7 +157,7 @@ export class OpenRecentAction extends BaseOpenRecentAction {
|
||||
@ILabelService labelService: ILabelService,
|
||||
@IHostService hostService: IHostService
|
||||
) {
|
||||
super(id, label, workspacesHistoryService, quickInputService, contextService, labelService, keybindingService, modelService, modeService, hostService);
|
||||
super(id, label, workspacesService, quickInputService, contextService, labelService, keybindingService, modelService, modeService, hostService);
|
||||
}
|
||||
|
||||
protected isQuickNavigate(): boolean {
|
||||
@@ -174,7 +173,7 @@ class QuickOpenRecentAction extends BaseOpenRecentAction {
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IWorkspacesHistoryService workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService workspacesService: IWorkspacesService,
|
||||
@IQuickInputService quickInputService: IQuickInputService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@@ -183,7 +182,7 @@ class QuickOpenRecentAction extends BaseOpenRecentAction {
|
||||
@ILabelService labelService: ILabelService,
|
||||
@IHostService hostService: IHostService
|
||||
) {
|
||||
super(id, label, workspacesHistoryService, quickInputService, contextService, labelService, keybindingService, modelService, modeService, hostService);
|
||||
super(id, label, workspacesService, quickInputService, contextService, labelService, keybindingService, modelService, modeService, hostService);
|
||||
}
|
||||
|
||||
protected isQuickNavigate(): boolean {
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { hasWorkspaceFileExtension, IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { hasWorkspaceFileExtension, IWorkspaceFolderCreationData, IRecentFile, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { normalize } from 'vs/base/common/path';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IWindowOpenable } from 'vs/platform/windows/common/windows';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
|
||||
@@ -29,7 +28,6 @@ import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/co
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IRecentFile } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
@@ -162,7 +160,7 @@ export class ResourcesDropHandler {
|
||||
constructor(
|
||||
private options: IResourcesDropHandlerOptions,
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@IWorkspacesHistoryService private readonly workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService private readonly workspacesService: IWorkspacesService,
|
||||
@ITextFileService private readonly textFileService: ITextFileService,
|
||||
@IBackupFileService private readonly backupFileService: IBackupFileService,
|
||||
@IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService,
|
||||
@@ -192,7 +190,7 @@ export class ResourcesDropHandler {
|
||||
// Add external ones to recently open list unless dropped resource is a workspace
|
||||
const recentFiles: IRecentFile[] = untitledOrFileResources.filter(d => d.isExternal && d.resource.scheme === Schemas.file).map(d => ({ fileUri: d.resource }));
|
||||
if (recentFiles.length) {
|
||||
this.workspacesHistoryService.addRecentlyOpened(recentFiles);
|
||||
this.workspacesService.addRecentlyOpened(recentFiles);
|
||||
}
|
||||
|
||||
const editors: IResourceEditor[] = untitledOrFileResources.map(untitledOrFileResource => ({
|
||||
|
||||
@@ -16,12 +16,12 @@ import { IHistoryService } from 'vs/workbench/services/history/common/history';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { CLOSE_EDITOR_COMMAND_ID, NAVIGATE_ALL_EDITORS_GROUP_PREFIX, MOVE_ACTIVE_EDITOR_COMMAND_ID, NAVIGATE_IN_ACTIVE_GROUP_PREFIX, ActiveEditorMoveArguments, SPLIT_EDITOR_LEFT, SPLIT_EDITOR_RIGHT, SPLIT_EDITOR_UP, SPLIT_EDITOR_DOWN, splitEditor, LAYOUT_EDITOR_GROUPS_COMMAND_ID, mergeAllGroups } from 'vs/workbench/browser/parts/editor/editorCommands';
|
||||
import { IEditorGroupsService, IEditorGroup, GroupsArrangement, EditorsOrder, GroupLocation, GroupDirection, preferredSideBySideGroupDirection, IFindGroupScope, GroupOrientation, EditorGroupLayout, GroupsOrder } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
|
||||
export class ExecuteCommandAction extends Action {
|
||||
|
||||
@@ -1218,7 +1218,7 @@ export class ClearRecentFilesAction extends Action {
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IWorkspacesHistoryService private readonly workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService private readonly workspacesService: IWorkspacesService,
|
||||
@IHistoryService private readonly historyService: IHistoryService
|
||||
) {
|
||||
super(id, label);
|
||||
@@ -1227,7 +1227,7 @@ export class ClearRecentFilesAction extends Action {
|
||||
run(): Promise<any> {
|
||||
|
||||
// Clear global recently opened
|
||||
this.workspacesHistoryService.clearRecentlyOpened();
|
||||
this.workspacesService.clearRecentlyOpened();
|
||||
|
||||
// Clear workspace specific recently opened
|
||||
this.historyService.clearRecentlyOpened();
|
||||
|
||||
@@ -7,7 +7,6 @@ import * as nls from 'vs/nls';
|
||||
import { IMenuService, MenuId, IMenu, SubmenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { MenuBarVisibility, getTitleBarStyle, IWindowOpenable } from 'vs/platform/windows/common/windows';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IAction, Action } from 'vs/base/common/actions';
|
||||
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
@@ -17,7 +16,7 @@ import { isMacintosh, isWeb } from 'vs/base/common/platform';
|
||||
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IRecentlyOpened, isRecentFolder, IRecent, isRecentWorkspace } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
import { IRecentlyOpened, isRecentFolder, IRecent, isRecentWorkspace, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
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, ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_INACTIVE_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -86,7 +85,7 @@ export abstract class MenubarControl extends Disposable {
|
||||
|
||||
constructor(
|
||||
protected readonly menuService: IMenuService,
|
||||
protected readonly workspacesHistoryService: IWorkspacesHistoryService,
|
||||
protected readonly workspacesService: IWorkspacesService,
|
||||
protected readonly contextKeyService: IContextKeyService,
|
||||
protected readonly keybindingService: IKeybindingService,
|
||||
protected readonly configurationService: IConfigurationService,
|
||||
@@ -128,7 +127,7 @@ export abstract class MenubarControl extends Disposable {
|
||||
this.updateService.onStateChange(() => this.updateMenubar());
|
||||
|
||||
// Listen for changes in recently opened menu
|
||||
this._register(this.workspacesHistoryService.onRecentlyOpenedChange(() => { this.onRecentlyOpenedChange(); }));
|
||||
this._register(this.workspacesService.onRecentlyOpenedChange(() => { this.onRecentlyOpenedChange(); }));
|
||||
|
||||
// Listen to keybindings change
|
||||
this._register(this.keybindingService.onDidUpdateKeybindings(() => this.updateMenubar()));
|
||||
@@ -190,7 +189,7 @@ export abstract class MenubarControl extends Disposable {
|
||||
}
|
||||
|
||||
private onRecentlyOpenedChange(): void {
|
||||
this.workspacesHistoryService.getRecentlyOpened().then(recentlyOpened => {
|
||||
this.workspacesService.getRecentlyOpened().then(recentlyOpened => {
|
||||
this.recentlyOpened = recentlyOpened;
|
||||
this.updateMenubar();
|
||||
});
|
||||
@@ -270,7 +269,7 @@ export class CustomMenubarControl extends MenubarControl {
|
||||
|
||||
constructor(
|
||||
@IMenuService menuService: IMenuService,
|
||||
@IWorkspacesHistoryService workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService workspacesService: IWorkspacesService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@@ -290,7 +289,7 @@ export class CustomMenubarControl extends MenubarControl {
|
||||
|
||||
super(
|
||||
menuService,
|
||||
workspacesHistoryService,
|
||||
workspacesService,
|
||||
contextKeyService,
|
||||
keybindingService,
|
||||
configurationService,
|
||||
@@ -307,7 +306,7 @@ export class CustomMenubarControl extends MenubarControl {
|
||||
this._onVisibilityChange = this._register(new Emitter<boolean>());
|
||||
this._onFocusStateChange = this._register(new Emitter<boolean>());
|
||||
|
||||
this.workspacesHistoryService.getRecentlyOpened().then((recentlyOpened) => {
|
||||
this.workspacesService.getRecentlyOpened().then((recentlyOpened) => {
|
||||
this.recentlyOpened = recentlyOpened;
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { onUnexpectedError, isPromiseCanceledError } from 'vs/base/common/errors';
|
||||
import { IWindowOpenable } from 'vs/platform/windows/common/windows';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -41,7 +40,7 @@ import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { ExtensionType } from 'vs/platform/extensions/common/extensions';
|
||||
import { joinPath } from 'vs/base/common/resources';
|
||||
import { IRecentlyOpened, isRecentWorkspace, IRecentWorkspace, IRecentFolder, isRecentFolder } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
import { IRecentlyOpened, isRecentWorkspace, IRecentWorkspace, IRecentFolder, isRecentFolder, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
|
||||
@@ -253,7 +252,7 @@ class WelcomePage extends Disposable {
|
||||
constructor(
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IWorkspacesHistoryService private readonly workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService private readonly workspacesService: IWorkspacesService,
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
@@ -270,7 +269,7 @@ class WelcomePage extends Disposable {
|
||||
super();
|
||||
this._register(lifecycleService.onShutdown(() => this.dispose()));
|
||||
|
||||
const recentlyOpened = this.workspacesHistoryService.getRecentlyOpened();
|
||||
const recentlyOpened = this.workspacesService.getRecentlyOpened();
|
||||
const installedExtensions = this.instantiationService.invokeFunction(getInstalledExtensions);
|
||||
const resource = URI.parse(require.toUrl('./vs_code_welcome_page'))
|
||||
.with({
|
||||
|
||||
@@ -30,7 +30,7 @@ import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/men
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { LifecyclePhase, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IWorkspaceFolderCreationData, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IIntegrityService } from 'vs/workbench/services/integrity/common/integrity';
|
||||
import { isRootUser, isWindows, isMacintosh, isLinux } from 'vs/base/common/platform';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
@@ -61,7 +61,6 @@ import { ITunnelService, extractLocalHostUriMetaDataForPortMapping } from 'vs/pl
|
||||
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
|
||||
const TextInputActions: IAction[] = [
|
||||
new Action('undo', nls.localize('undo', "Undo"), undefined, true, () => Promise.resolve(document.execCommand('undo'))),
|
||||
@@ -681,7 +680,7 @@ export class ElectronWindow extends Disposable {
|
||||
class NativeMenubarControl extends MenubarControl {
|
||||
constructor(
|
||||
@IMenuService menuService: IMenuService,
|
||||
@IWorkspacesHistoryService workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService workspacesService: IWorkspacesService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@@ -698,7 +697,7 @@ class NativeMenubarControl extends MenubarControl {
|
||||
) {
|
||||
super(
|
||||
menuService,
|
||||
workspacesHistoryService,
|
||||
workspacesService,
|
||||
contextKeyService,
|
||||
keybindingService,
|
||||
configurationService,
|
||||
@@ -725,7 +724,7 @@ class NativeMenubarControl extends MenubarControl {
|
||||
}
|
||||
|
||||
(async () => {
|
||||
this.recentlyOpened = await this.workspacesHistoryService.getRecentlyOpened();
|
||||
this.recentlyOpened = await this.workspacesService.getRecentlyOpened();
|
||||
|
||||
this.doUpdateMenubar(true);
|
||||
})();
|
||||
|
||||
@@ -19,7 +19,6 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
|
||||
import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { getCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { getExcludes, ISearchConfiguration } from 'vs/workbench/services/search/common/search';
|
||||
import { IExpression } from 'vs/base/common/glob';
|
||||
@@ -33,6 +32,7 @@ import { coalesce } from 'vs/base/common/arrays';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { addDisposableListener, EventType, EventHelper } from 'vs/base/browser/dom';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
|
||||
/**
|
||||
* Stores the selection & view state of an editor and allows to compare it to other selection states.
|
||||
@@ -138,7 +138,7 @@ export class HistoryService extends Disposable implements IHistoryService {
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@IWorkspacesHistoryService private readonly workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService private readonly workspacesService: IWorkspacesService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@@ -781,7 +781,7 @@ export class HistoryService extends Disposable implements IHistoryService {
|
||||
|
||||
const input = arg1 as IResourceInput;
|
||||
|
||||
this.workspacesHistoryService.removeFromRecentlyOpened([input.resource]);
|
||||
this.workspacesService.removeFromRecentlyOpened([input.resource]);
|
||||
}
|
||||
|
||||
private isFileOpened(resource: URI, group: IEditorGroup): boolean {
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IRecent, IRecentlyOpened, isRecentFolder, isRecentFile } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { restoreRecentlyOpened, toStoreData } from 'vs/platform/workspaces/common/workspacesHistoryStorage';
|
||||
import { StorageScope, IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class BrowserWorkspacesHistoryService extends Disposable implements IWorkspacesHistoryService {
|
||||
|
||||
static readonly RECENTLY_OPENED_KEY = 'recently.opened';
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly _onRecentlyOpenedChange: Emitter<void> = this._register(new Emitter<void>());
|
||||
readonly onRecentlyOpenedChange: Event<void> = this._onRecentlyOpenedChange.event;
|
||||
|
||||
constructor(
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
|
||||
this.addWorkspaceToRecentlyOpened();
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
this._register(this.storageService.onDidChangeStorage(event => {
|
||||
if (event.key === BrowserWorkspacesHistoryService.RECENTLY_OPENED_KEY && event.scope === StorageScope.GLOBAL) {
|
||||
this._onRecentlyOpenedChange.fire();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private addWorkspaceToRecentlyOpened(): void {
|
||||
const workspace = this.workspaceService.getWorkspace();
|
||||
switch (this.workspaceService.getWorkbenchState()) {
|
||||
case WorkbenchState.FOLDER:
|
||||
this.addRecentlyOpened([{ folderUri: workspace.folders[0].uri }]);
|
||||
break;
|
||||
case WorkbenchState.WORKSPACE:
|
||||
this.addRecentlyOpened([{ workspace: { id: workspace.id, configPath: workspace.configuration! } }]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
async getRecentlyOpened(): Promise<IRecentlyOpened> {
|
||||
const recentlyOpenedRaw = this.storageService.get(BrowserWorkspacesHistoryService.RECENTLY_OPENED_KEY, StorageScope.GLOBAL);
|
||||
if (recentlyOpenedRaw) {
|
||||
return restoreRecentlyOpened(JSON.parse(recentlyOpenedRaw), this.logService);
|
||||
}
|
||||
|
||||
return { workspaces: [], files: [] };
|
||||
}
|
||||
|
||||
async addRecentlyOpened(recents: IRecent[]): Promise<void> {
|
||||
const recentlyOpened = await this.getRecentlyOpened();
|
||||
|
||||
recents.forEach(recent => {
|
||||
if (isRecentFile(recent)) {
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, [recent.fileUri]);
|
||||
recentlyOpened.files.unshift(recent);
|
||||
} else if (isRecentFolder(recent)) {
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, [recent.folderUri]);
|
||||
recentlyOpened.workspaces.unshift(recent);
|
||||
} else {
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, [recent.workspace.configPath]);
|
||||
recentlyOpened.workspaces.unshift(recent);
|
||||
}
|
||||
});
|
||||
|
||||
return this.saveRecentlyOpened(recentlyOpened);
|
||||
}
|
||||
|
||||
async removeFromRecentlyOpened(paths: URI[]): Promise<void> {
|
||||
const recentlyOpened = await this.getRecentlyOpened();
|
||||
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, paths);
|
||||
|
||||
return this.saveRecentlyOpened(recentlyOpened);
|
||||
}
|
||||
|
||||
private doRemoveFromRecentlyOpened(recentlyOpened: IRecentlyOpened, paths: URI[]): void {
|
||||
recentlyOpened.files = recentlyOpened.files.filter(file => {
|
||||
return !paths.some(path => path.toString() === file.fileUri.toString());
|
||||
});
|
||||
|
||||
recentlyOpened.workspaces = recentlyOpened.workspaces.filter(workspace => {
|
||||
return !paths.some(path => path.toString() === (isRecentFolder(workspace) ? workspace.folderUri.toString() : workspace.workspace.configPath.toString()));
|
||||
});
|
||||
}
|
||||
|
||||
private async saveRecentlyOpened(data: IRecentlyOpened): Promise<void> {
|
||||
return this.storageService.store(BrowserWorkspacesHistoryService.RECENTLY_OPENED_KEY, JSON.stringify(toStoreData(data)), StorageScope.GLOBAL);
|
||||
}
|
||||
|
||||
async clearRecentlyOpened(): Promise<void> {
|
||||
this.storageService.remove(BrowserWorkspacesHistoryService.RECENTLY_OPENED_KEY, StorageScope.GLOBAL);
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IWorkspacesHistoryService, BrowserWorkspacesHistoryService, true);
|
||||
@@ -4,13 +4,115 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IWorkspacesService, IWorkspaceFolderCreationData, IWorkspaceIdentifier, IEnterWorkspaceResult } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IWorkspacesService, IWorkspaceFolderCreationData, IWorkspaceIdentifier, IEnterWorkspaceResult, IRecentlyOpened, restoreRecentlyOpened, IRecent, isRecentFile, isRecentFolder, toStoreData } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class WorkspacesService implements IWorkspacesService {
|
||||
export class BrowserWorkspacesService extends Disposable implements IWorkspacesService {
|
||||
|
||||
static readonly RECENTLY_OPENED_KEY = 'recently.opened';
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly _onRecentlyOpenedChange: Emitter<void> = this._register(new Emitter<void>());
|
||||
readonly onRecentlyOpenedChange: Event<void> = this._onRecentlyOpenedChange.event;
|
||||
|
||||
constructor(
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
|
||||
this.addWorkspaceToRecentlyOpened();
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
this._register(this.storageService.onDidChangeStorage(event => {
|
||||
if (event.key === BrowserWorkspacesService.RECENTLY_OPENED_KEY && event.scope === StorageScope.GLOBAL) {
|
||||
this._onRecentlyOpenedChange.fire();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private addWorkspaceToRecentlyOpened(): void {
|
||||
const workspace = this.workspaceService.getWorkspace();
|
||||
switch (this.workspaceService.getWorkbenchState()) {
|
||||
case WorkbenchState.FOLDER:
|
||||
this.addRecentlyOpened([{ folderUri: workspace.folders[0].uri }]);
|
||||
break;
|
||||
case WorkbenchState.WORKSPACE:
|
||||
this.addRecentlyOpened([{ workspace: { id: workspace.id, configPath: workspace.configuration! } }]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//#region Workspaces History
|
||||
|
||||
async getRecentlyOpened(): Promise<IRecentlyOpened> {
|
||||
const recentlyOpenedRaw = this.storageService.get(BrowserWorkspacesService.RECENTLY_OPENED_KEY, StorageScope.GLOBAL);
|
||||
if (recentlyOpenedRaw) {
|
||||
return restoreRecentlyOpened(JSON.parse(recentlyOpenedRaw), this.logService);
|
||||
}
|
||||
|
||||
return { workspaces: [], files: [] };
|
||||
}
|
||||
|
||||
async addRecentlyOpened(recents: IRecent[]): Promise<void> {
|
||||
const recentlyOpened = await this.getRecentlyOpened();
|
||||
|
||||
recents.forEach(recent => {
|
||||
if (isRecentFile(recent)) {
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, [recent.fileUri]);
|
||||
recentlyOpened.files.unshift(recent);
|
||||
} else if (isRecentFolder(recent)) {
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, [recent.folderUri]);
|
||||
recentlyOpened.workspaces.unshift(recent);
|
||||
} else {
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, [recent.workspace.configPath]);
|
||||
recentlyOpened.workspaces.unshift(recent);
|
||||
}
|
||||
});
|
||||
|
||||
return this.saveRecentlyOpened(recentlyOpened);
|
||||
}
|
||||
|
||||
async removeFromRecentlyOpened(paths: URI[]): Promise<void> {
|
||||
const recentlyOpened = await this.getRecentlyOpened();
|
||||
|
||||
this.doRemoveFromRecentlyOpened(recentlyOpened, paths);
|
||||
|
||||
return this.saveRecentlyOpened(recentlyOpened);
|
||||
}
|
||||
|
||||
private doRemoveFromRecentlyOpened(recentlyOpened: IRecentlyOpened, paths: URI[]): void {
|
||||
recentlyOpened.files = recentlyOpened.files.filter(file => {
|
||||
return !paths.some(path => path.toString() === file.fileUri.toString());
|
||||
});
|
||||
|
||||
recentlyOpened.workspaces = recentlyOpened.workspaces.filter(workspace => {
|
||||
return !paths.some(path => path.toString() === (isRecentFolder(workspace) ? workspace.folderUri.toString() : workspace.workspace.configPath.toString()));
|
||||
});
|
||||
}
|
||||
|
||||
private async saveRecentlyOpened(data: IRecentlyOpened): Promise<void> {
|
||||
return this.storageService.store(BrowserWorkspacesService.RECENTLY_OPENED_KEY, JSON.stringify(toStoreData(data)), StorageScope.GLOBAL);
|
||||
}
|
||||
|
||||
async clearRecentlyOpened(): Promise<void> {
|
||||
this.storageService.remove(BrowserWorkspacesService.RECENTLY_OPENED_KEY, StorageScope.GLOBAL);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Workspace Management
|
||||
|
||||
enterWorkspace(path: URI): Promise<IEnterWorkspaceResult | undefined> {
|
||||
throw new Error('Untitled workspaces are currently unsupported in Web');
|
||||
}
|
||||
@@ -26,6 +128,8 @@ export class WorkspacesService implements IWorkspacesService {
|
||||
getWorkspaceIdentifier(workspacePath: URI): Promise<IWorkspaceIdentifier> {
|
||||
throw new Error('Untitled workspaces are currently unsupported in Web');
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}
|
||||
|
||||
registerSingleton(IWorkspacesService, WorkspacesService, true);
|
||||
registerSingleton(IWorkspacesService, BrowserWorkspacesService, true);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IRecent, IRecentlyOpened } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
|
||||
export const IWorkspacesHistoryService = createDecorator<IWorkspacesHistoryService>('workspacesHistoryService');
|
||||
|
||||
export interface IWorkspacesHistoryService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
readonly onRecentlyOpenedChange: Event<void>;
|
||||
|
||||
addRecentlyOpened(recents: IRecent[]): Promise<void>;
|
||||
|
||||
removeFromRecentlyOpened(workspaces: URI[]): Promise<void>;
|
||||
clearRecentlyOpened(): Promise<void>;
|
||||
|
||||
getRecentlyOpened(): Promise<IRecentlyOpened>;
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import * as nls from 'vs/nls';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { IJSONEditingService } from 'vs/workbench/services/configuration/common/jsonEditing';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { WorkspaceService } from 'vs/workbench/services/configuration/browser/configurationService';
|
||||
@@ -47,7 +46,6 @@ export class NativeWorkspaceEditingService extends AbstractWorkspaceEditingServi
|
||||
@ICommandService commandService: ICommandService,
|
||||
@IFileService fileService: IFileService,
|
||||
@ITextFileService textFileService: ITextFileService,
|
||||
@IWorkspacesHistoryService private readonly workspacesHistoryService: IWorkspacesHistoryService,
|
||||
@IWorkspacesService workspacesService: IWorkspacesService,
|
||||
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
|
||||
@IFileDialogService fileDialogService: IFileDialogService,
|
||||
@@ -135,7 +133,7 @@ export class NativeWorkspaceEditingService extends AbstractWorkspaceEditingServi
|
||||
const newWorkspaceIdentifier = await this.workspacesService.getWorkspaceIdentifier(newWorkspacePath);
|
||||
|
||||
const label = this.labelService.getWorkspaceLabel(newWorkspaceIdentifier, { verbose: true });
|
||||
this.workspacesHistoryService.addRecentlyOpened([{ label, workspace: newWorkspaceIdentifier }]);
|
||||
this.workspacesService.addRecentlyOpened([{ label, workspace: newWorkspaceIdentifier }]);
|
||||
|
||||
this.workspacesService.deleteUntitledWorkspace(workspaceIdentifier);
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IRecent, IRecentlyOpened } from 'vs/platform/workspaces/common/workspacesHistory';
|
||||
import { IWorkspacesHistoryService } from 'vs/workbench/services/workspace/common/workspacesHistoryService';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IElectronService } from 'vs/platform/electron/node/electron';
|
||||
|
||||
export class NativeWorkspacesHistoryService implements IWorkspacesHistoryService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
readonly onRecentlyOpenedChange = this.electronService.onRecentlyOpenedChange;
|
||||
|
||||
constructor(
|
||||
@IElectronService private readonly electronService: IElectronService
|
||||
) { }
|
||||
|
||||
async getRecentlyOpened(): Promise<IRecentlyOpened> {
|
||||
return this.electronService.getRecentlyOpened();
|
||||
}
|
||||
|
||||
async addRecentlyOpened(recents: IRecent[]): Promise<void> {
|
||||
return this.electronService.addRecentlyOpened(recents);
|
||||
}
|
||||
|
||||
async removeFromRecentlyOpened(paths: URI[]): Promise<void> {
|
||||
return this.electronService.removeFromRecentlyOpened(paths);
|
||||
}
|
||||
|
||||
async clearRecentlyOpened(): Promise<void> {
|
||||
return this.electronService.clearRecentlyOpened();
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IWorkspacesHistoryService, NativeWorkspacesHistoryService, true);
|
||||
@@ -3,46 +3,22 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IWorkspacesService, IWorkspaceIdentifier, IWorkspaceFolderCreationData, reviveWorkspaceIdentifier, IEnterWorkspaceResult } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService';
|
||||
import { createChannelSender } from 'vs/base/parts/ipc/node/ipcChannelCreator';
|
||||
|
||||
export class WorkspacesService implements IWorkspacesService {
|
||||
export class NativeWorkspacesService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private channel: IChannel;
|
||||
|
||||
constructor(
|
||||
@IMainProcessService mainProcessService: IMainProcessService,
|
||||
@IElectronEnvironmentService private readonly electronEnvironmentService: IElectronEnvironmentService
|
||||
@IElectronEnvironmentService electronEnvironmentService: IElectronEnvironmentService
|
||||
) {
|
||||
this.channel = mainProcessService.getChannel('workspaces');
|
||||
}
|
||||
|
||||
async enterWorkspace(path: URI): Promise<IEnterWorkspaceResult | undefined> {
|
||||
const result: IEnterWorkspaceResult = await this.channel.call('enterWorkspace', [this.electronEnvironmentService.windowId, path]);
|
||||
if (result) {
|
||||
result.workspace = reviveWorkspaceIdentifier(result.workspace);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
createUntitledWorkspace(folders?: IWorkspaceFolderCreationData[], remoteAuthority?: string): Promise<IWorkspaceIdentifier> {
|
||||
return this.channel.call('createUntitledWorkspace', [folders, remoteAuthority]).then(reviveWorkspaceIdentifier);
|
||||
}
|
||||
|
||||
deleteUntitledWorkspace(workspaceIdentifier: IWorkspaceIdentifier): Promise<void> {
|
||||
return this.channel.call('deleteUntitledWorkspace', workspaceIdentifier);
|
||||
}
|
||||
|
||||
getWorkspaceIdentifier(configPath: URI): Promise<IWorkspaceIdentifier> {
|
||||
return this.channel.call('getWorkspaceIdentifier', configPath).then(reviveWorkspaceIdentifier);
|
||||
return createChannelSender<IWorkspacesService>(mainProcessService.getChannel('workspaces'), { context: electronEnvironmentService.windowId });
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IWorkspacesService, WorkspacesService, true);
|
||||
registerSingleton(IWorkspacesService, NativeWorkspacesService, true);
|
||||
|
||||
@@ -55,7 +55,6 @@ import 'vs/workbench/services/request/electron-browser/requestService';
|
||||
import 'vs/workbench/services/lifecycle/electron-browser/lifecycleService';
|
||||
import 'vs/workbench/services/sharedProcess/electron-browser/sharedProcessService';
|
||||
import 'vs/workbench/services/electron/electron-browser/electronService';
|
||||
import 'vs/workbench/services/workspace/electron-browser/workspacesHistoryService';
|
||||
import 'vs/workbench/services/workspace/electron-browser/workspaceEditingService';
|
||||
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
|
||||
@@ -45,7 +45,6 @@ import 'vs/workbench/services/dialogs/browser/dialogService';
|
||||
import 'vs/workbench/services/dialogs/browser/fileDialogService';
|
||||
import 'vs/workbench/services/host/browser/browserHostService';
|
||||
import 'vs/workbench/services/request/browser/requestService';
|
||||
import 'vs/workbench/services/workspace/browser/workspacesHistoryService';
|
||||
import 'vs/workbench/services/workspace/browser/workspaceEditingService';
|
||||
import 'vs/workbench/services/lifecycle/browser/lifecycleService';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user