提交 38f0cf83 编写于 作者: S Sandeep Somavarapu

#28538 Rename old workspaces to legacy

上级 8308461f
......@@ -17,7 +17,7 @@ import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingReso
import { IKeybindingEvent, KeybindingSource, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IConfirmation, IMessageService } from 'vs/platform/message/common/message';
import { IWorkspaceContextService, IWorkspace as ILegacyWorkspace, IWorkspace2 } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, ILegacyWorkspace, IWorkspace2 } from 'vs/platform/workspace/common/workspace';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
import { Selection } from 'vs/editor/common/core/selection';
......
......@@ -10,7 +10,7 @@ import Event, { Emitter } from 'vs/base/common/event';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IExtensionManagementService, DidUninstallExtensionEvent, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
import { adoptToGalleryExtensionId, getIdAndVersionFromLocalExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { IWorkspaceContextService, IWorkspace } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, ILegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
......@@ -34,7 +34,7 @@ export class ExtensionEnablementService implements IExtensionEnablementService {
extensionManagementService.onDidUninstallExtension(this.onDidUninstallExtension, this, this.disposables);
}
private get workspace(): IWorkspace {
private get workspace(): ILegacyWorkspace {
return this.contextService.getWorkspace();
}
......
......@@ -8,7 +8,7 @@
import * as assert from 'assert';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { StorageScope } from 'vs/platform/storage/common/storage';
import { IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, LegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
......@@ -95,7 +95,7 @@ suite('Workbench StorageSevice', () => {
assert.strictEqual(s.get('wkey1', StorageScope.WORKSPACE), 'foo');
assert.strictEqual(s.get('wkey2', StorageScope.WORKSPACE), 'foo2');
ws = new Workspace(TestWorkspace.resource, Date.now());
ws = new LegacyWorkspace(TestWorkspace.resource, Date.now());
ws.uid = new Date().getTime() + 100;
s = new StorageService(storageImpl, null, ws);
......
......@@ -25,7 +25,7 @@ export interface IWorkspaceContextService {
* Provides access to the workspace object the platform is running with. This may be null if the workbench was opened
* without workspace (empty);
*/
getWorkspace(): IWorkspace;
getWorkspace(): ILegacyWorkspace;
/**
* Provides access to the workspace object the platform is running with. This may be null if the workbench was opened
......@@ -62,7 +62,7 @@ export interface IWorkspaceContextService {
toResource: (workspaceRelativePath: string) => URI;
}
export interface IWorkspace {
export interface ILegacyWorkspace {
/**
* the full uri of the workspace. this is a file:// URL to the location
......@@ -99,7 +99,7 @@ export interface IWorkspace2 {
readonly roots: URI[];
}
export class Workspace implements IWorkspace {
export class LegacyWorkspace implements ILegacyWorkspace {
private _name: string;
constructor(private _resource: URI, private _ctime?: number) {
......
......@@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Workspace } from 'vs/platform/workspace/common/workspace';
import { LegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import URI from 'vs/base/common/uri';
export const TestWorkspace = new Workspace(
export const TestWorkspace = new LegacyWorkspace(
URI.file('C:\\testWorkspace'),
Date.now()
);
......@@ -18,7 +18,7 @@ import paths = require('vs/base/common/paths');
import uri from 'vs/base/common/uri';
import strings = require('vs/base/common/strings');
import { IResourceInput } from 'vs/platform/editor/common/editor';
import { Workspace as LegacyWorkspace } from "vs/platform/workspace/common/workspace";
import { LegacyWorkspace } from "vs/platform/workspace/common/workspace";
import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configuration';
import { realpath, stat } from 'vs/base/node/pfs';
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
......
......@@ -21,7 +21,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IStringDictionary } from 'vs/base/common/collections';
import { ITerminalInstance, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal';
import { ITerminalProcessFactory } from 'vs/workbench/parts/terminal/electron-browser/terminal';
import { IWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { ILegacyWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
......@@ -464,7 +464,7 @@ export class TerminalInstance implements ITerminalInstance {
return typeof data === 'string' ? data.replace(TerminalInstance.WINDOWS_EOL_REGEX, '\r') : data;
}
protected _getCwd(shell: IShellLaunchConfig, workspace: IWorkspace): string {
protected _getCwd(shell: IShellLaunchConfig, workspace: ILegacyWorkspace): string {
if (shell.cwd) {
return shell.cwd;
}
......@@ -492,7 +492,7 @@ export class TerminalInstance implements ITerminalInstance {
return TerminalInstance._sanitizeCwd(cwd);
}
protected _createProcess(workspace: IWorkspace, shell: IShellLaunchConfig): void {
protected _createProcess(workspace: ILegacyWorkspace, shell: IShellLaunchConfig): void {
const locale = this._configHelper.config.setLocaleVariables ? platform.locale : undefined;
if (!shell.executable) {
this._configHelper.mergeDefaultShellPathAndArgs(shell);
......
......@@ -10,7 +10,7 @@ import * as os from 'os';
import Uri from 'vs/base/common/uri';
import { IMessageService } from 'vs/platform/message/common/message';
import { IStringDictionary } from 'vs/base/common/collections';
import { IWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { ILegacyWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { TerminalInstance } from 'vs/workbench/parts/terminal/electron-browser/terminalInstance';
import { IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
......@@ -20,11 +20,11 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
class TestTerminalInstance extends TerminalInstance {
public _getCwd(shell: IShellLaunchConfig, workspace: IWorkspace): string {
public _getCwd(shell: IShellLaunchConfig, workspace: ILegacyWorkspace): string {
return super._getCwd(shell, workspace);
}
protected _createProcess(workspace: IWorkspace, shell: IShellLaunchConfig): void { }
protected _createProcess(workspace: ILegacyWorkspace, shell: IShellLaunchConfig): void { }
protected _createXterm(): void { }
}
......
......@@ -8,7 +8,7 @@
import * as assert from 'assert';
import { Platform } from 'vs/base/common/platform';
import { TerminalLinkHandler, LineColumnInfo } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler';
import { Workspace } from 'vs/platform/workspace/common/workspace';
import { LegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
import URI from 'vs/base/common/uri';
import * as strings from 'vs/base/common/strings';
......@@ -45,7 +45,7 @@ interface LinkFormatInfo {
column?: string;
}
class TestWorkspace extends Workspace {
class TestWorkspace extends LegacyWorkspace {
constructor(private basePath: string) {
super(new TestURI(basePath));
}
......
......@@ -18,7 +18,7 @@ import { Schemas } from "vs/base/common/network";
import { RunOnceScheduler } from 'vs/base/common/async';
import { readFile } from 'vs/base/node/pfs';
import * as extfs from 'vs/base/node/extfs';
import { IWorkspaceContextService, IWorkspace2, Workspace as LegacyWorkspace, IWorkspace as ILegacyWorkspace } from "vs/platform/workspace/common/workspace";
import { IWorkspaceContextService, IWorkspace2, LegacyWorkspace, ILegacyWorkspace } from "vs/platform/workspace/common/workspace";
import { FileChangeType, FileChangesEvent, isEqual, isEqualOrParent } from 'vs/platform/files/common/files';
import { isLinux } from 'vs/base/common/platform';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
......
......@@ -13,7 +13,7 @@ import * as sinon from 'sinon';
import { TPromise } from 'vs/base/common/winjs.base';
import { Registry } from 'vs/platform/platform';
import { ParsedArgs } from 'vs/platform/environment/common/environment';
import { Workspace } from 'vs/platform/workspace/common/workspace';
import { LegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
import { parseArgs } from 'vs/platform/environment/node/argv';
import extfs = require('vs/base/node/extfs');
......@@ -47,7 +47,7 @@ suite('WorkspaceConfigurationService - Node', () => {
}
function createService(workspaceDir: string, globalSettingsFile: string): TPromise<WorkspaceConfigurationService> {
const workspace = new Workspace(URI.file(workspaceDir));
const workspace = new LegacyWorkspace(URI.file(workspaceDir));
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
const service = new WorkspaceConfigurationService(environmentService, workspace);
......@@ -204,7 +204,7 @@ suite('WorkspaceConfigurationService - Node', () => {
test('workspace change triggers event', (done: () => void) => {
createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => {
const workspace = new Workspace(URI.file(workspaceDir));
const workspace = new LegacyWorkspace(URI.file(workspaceDir));
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
const service = new WorkspaceConfigurationService(environmentService, workspace);
......@@ -230,7 +230,7 @@ suite('WorkspaceConfigurationService - Node', () => {
test('workspace reload should triggers event if content changed', (done: () => void) => {
createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => {
const workspace = new Workspace(URI.file(workspaceDir));
const workspace = new LegacyWorkspace(URI.file(workspaceDir));
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
const service = new WorkspaceConfigurationService(environmentService, workspace);
......@@ -255,7 +255,7 @@ suite('WorkspaceConfigurationService - Node', () => {
test('workspace reload should not trigger event if nothing changed', (done: () => void) => {
createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => {
const workspace = new Workspace(URI.file(workspaceDir));
const workspace = new LegacyWorkspace(URI.file(workspaceDir));
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
const service = new WorkspaceConfigurationService(environmentService, workspace);
......@@ -280,7 +280,7 @@ suite('WorkspaceConfigurationService - Node', () => {
test('workspace reload should not trigger event if there is no model', (done: () => void) => {
createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => {
const workspace = new Workspace(URI.file(workspaceDir));
const workspace = new LegacyWorkspace(URI.file(workspaceDir));
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
const service = new WorkspaceConfigurationService(environmentService, workspace);
......
......@@ -15,7 +15,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import { Registry } from 'vs/platform/platform';
import { ParsedArgs, IEnvironmentService } from 'vs/platform/environment/common/environment';
import { parseArgs } from 'vs/platform/environment/node/argv';
import { IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, LegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
import extfs = require('vs/base/node/extfs');
import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService } from 'vs/workbench/test/workbenchTestServices';
......@@ -115,7 +115,7 @@ suite('ConfigurationEditingService', () => {
instantiationService = new TestInstantiationService();
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
instantiationService.stub(IEnvironmentService, environmentService);
const workspace = noWorkspace ? null : new Workspace(URI.file(workspaceDir));
const workspace = noWorkspace ? null : new LegacyWorkspace(URI.file(workspaceDir));
const workspaceService = new WorkspaceConfigurationService(environmentService, workspace);
instantiationService.stub(IWorkspaceContextService, workspaceService);
instantiationService.stub(IConfigurationService, workspaceService);
......
......@@ -7,7 +7,7 @@
import 'vs/workbench/parts/search/browser/search.contribution'; // load contributions
import * as assert from 'assert';
import { IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, LegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { ISearchService } from 'vs/platform/search/common/search';
......@@ -72,7 +72,7 @@ suite('QuickOpen performance (integration)', () => {
[ITelemetryService, telemetryService],
[IConfigurationService, configurationService],
[IModelService, new ModelServiceImpl(null, configurationService)],
[IWorkspaceContextService, new TestContextService(new Workspace(URI.file(testWorkspacePath)))],
[IWorkspaceContextService, new TestContextService(new LegacyWorkspace(URI.file(testWorkspacePath)))],
[IWorkbenchEditorService, new TestEditorService()],
[IEditorGroupService, new TestEditorGroupService()],
[IEnvironmentService, TestEnvironmentService],
......
......@@ -8,7 +8,7 @@
import 'vs/workbench/parts/search/browser/search.contribution'; // load contributions
import * as assert from 'assert';
import * as fs from 'fs';
import { IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, LegacyWorkspace } from 'vs/platform/workspace/common/workspace';
import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { ISearchService, IQueryOptions } from 'vs/platform/search/common/search';
......@@ -62,7 +62,7 @@ suite('TextSearch performance (integration)', () => {
[ITelemetryService, telemetryService],
[IConfigurationService, configurationService],
[IModelService, new ModelServiceImpl(null, configurationService)],
[IWorkspaceContextService, new TestContextService(new Workspace(URI.file(testWorkspacePath)))],
[IWorkspaceContextService, new TestContextService(new LegacyWorkspace(URI.file(testWorkspacePath)))],
[IWorkbenchEditorService, new TestEditorService()],
[IEditorGroupService, new TestEditorGroupService()],
[IEnvironmentService, TestEnvironmentService],
......
......@@ -27,7 +27,7 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { IEditorInput, IEditorOptions, Position, Direction, IEditor, IResourceInput } from 'vs/platform/editor/common/editor';
import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IMessageService, IConfirmation } from 'vs/platform/message/common/message';
import { IWorkspace, IWorkspaceContextService, IWorkspace2 } from 'vs/platform/workspace/common/workspace';
import { ILegacyWorkspace, IWorkspaceContextService, IWorkspace2 } from 'vs/platform/workspace/common/workspace';
import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { EditorStacksModel } from 'vs/workbench/common/editor/editorStacksModel';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
......@@ -64,7 +64,7 @@ export const TestEnvironmentService = new EnvironmentService(parseArgs(process.a
export class TestContextService implements IWorkspaceContextService {
public _serviceBrand: any;
private workspace: IWorkspace;
private workspace: ILegacyWorkspace;
private id: string;
private options: any;
......@@ -89,7 +89,7 @@ export class TestContextService implements IWorkspaceContextService {
return !!this.workspace;
}
public getWorkspace(): IWorkspace {
public getWorkspace(): ILegacyWorkspace {
return this.workspace;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册