提交 9069070c 编写于 作者: I isidor

Merge branch 'master' into isidorn/explorerModel

......@@ -24,4 +24,11 @@ step "Run unit tests" \
./scripts/test.sh --build --reporter dot
step "Run integration tests" \
./scripts/test-integration.sh
\ No newline at end of file
./scripts/test-integration.sh
step "Run smoke test" \
pushd test/smoke
npm install
npm run compile
node src/main.js --latest "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"
popd
\ No newline at end of file
......@@ -1041,3 +1041,8 @@ export function domContentLoaded(): TPromise<any> {
}
});
}
export function hintGPULayer(target: HTMLElement): void {
// This is to hint browsers that this dom node is suited to live in its own layer (e.g. sliders, etc.)
(<any>target.style).willChange = 'transform';
}
......@@ -170,6 +170,7 @@ export abstract class AbstractScrollbar extends Widget {
this.domNode.setTransform('translate3d(0px, 0px, 0px)');
} else {
this.domNode.setTransform('');
DomUtils.hintGPULayer(this.domNode.domNode);
}
this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize());
......
......@@ -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, Workspace, IWorkspace } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, Workspace, IWorkspace, 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';
......@@ -495,8 +495,8 @@ export class SimpleWorkspaceContextService implements IWorkspaceContextService {
public _serviceBrand: any;
private readonly _onDidChangeFolders: Emitter<URI[]> = new Emitter<URI[]>();
public readonly onDidChangeFolders: Event<URI[]> = this._onDidChangeFolders.event;
private readonly _onDidChangeWorkspaceRoots: Emitter<URI[]> = new Emitter<URI[]>();
public readonly onDidChangeWorkspaceRoots: Event<URI[]> = this._onDidChangeWorkspaceRoots.event;
private readonly folders: URI[];
......@@ -512,6 +512,10 @@ export class SimpleWorkspaceContextService implements IWorkspaceContextService {
return this.workspace;
}
public getWorkspace2(): IWorkspace2 {
return this.workspace ? { id: `${this.workspace.uid}`, roots: [this.workspace.resource] } : void 0;
}
public hasWorkspace(): boolean {
return !!this.workspace;
}
......
......@@ -413,6 +413,7 @@ export class Minimap extends ViewPart {
this._slider = createFastDomNode(document.createElement('div'));
this._slider.setPosition('absolute');
this._slider.setClassName('minimap-slider');
dom.hintGPULayer(this._slider.domNode);
this._domNode.appendChild(this._slider);
this._tokensColorTracker = MinimapTokensColorTracker.getInstance();
......@@ -614,10 +615,41 @@ export class Minimap extends ViewPart {
this._slider.setTop(layout.sliderTop);
this._slider.setHeight(layout.sliderHeight);
this._lastRenderData = this.renderLines(layout);
}
private renderLines(layout: MinimapLayout): RenderData {
const renderMinimap = this._options.renderMinimap;
const startLineNumber = layout.startLineNumber;
const endLineNumber = layout.endLineNumber;
const minimapLineHeight = getMinimapLineHeight(renderMinimap);
// Check if nothing changed w.r.t. lines from last frame
if (this._lastRenderData) {
const _lastData = this._lastRenderData._get();
const lastStartLineNumber = _lastData.rendLineNumberStart;
const lastLines = _lastData.lines;
const lastLinesLength = lastLines.length;
let linesNeedPainting = false;
for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
const lastLineIndex = lineNumber - lastStartLineNumber;
const source_dy = (lastLineIndex >= 0 && lastLineIndex < lastLinesLength ? lastLines[lastLineIndex].dy : -1);
if (source_dy === -1) {
linesNeedPainting = true;
break;
}
}
if (!linesNeedPainting) {
// Nice!! Nothing changed from last frame
return new RenderData(layout, _lastData.imageData, _lastData.lines);
}
}
// Oh well!! We need to repaint some lines...
const imageData = this._getBuffer();
// Render untouched lines by using last rendered data.
......@@ -656,16 +688,16 @@ export class Minimap extends ViewPart {
dy += minimapLineHeight;
}
// Finally, paint to the canvas
const ctx = this._canvas.domNode.getContext('2d');
ctx.putImageData(imageData, 0, 0);
// Save rendered data for reuse on next frame if possible
this._lastRenderData = new RenderData(
return new RenderData(
layout,
imageData,
renderedLines
);
// Finally, paint to the canvas
const ctx = this._canvas.domNode.getContext('2d');
ctx.putImageData(imageData, 0, 0);
}
private static _renderUntouchedLines(
......
......@@ -97,16 +97,16 @@ export class BlockCommentCommand implements editorCommon.ICommand {
if (!Range.isEmpty(r)) {
// Insert block comment start
res.push(EditOperation.insert(new Position(r.startLineNumber, r.startColumn), startToken));
res.push(EditOperation.insert(new Position(r.startLineNumber, r.startColumn), startToken + ' '));
// Insert block comment end
res.push(EditOperation.insert(new Position(r.endLineNumber, r.endColumn), endToken));
res.push(EditOperation.insert(new Position(r.endLineNumber, r.endColumn), ' ' + endToken));
} else {
// Insert both continuously
res.push(EditOperation.replace(new Range(
r.startLineNumber, r.startColumn,
r.endLineNumber, r.endColumn
), startToken + endToken));
), startToken + ' ' + endToken));
}
return res;
......@@ -145,7 +145,7 @@ export class BlockCommentCommand implements editorCommon.ICommand {
);
} else {
var srcRange = inverseEditOperations[0].range;
var deltaColumn = this._usedEndToken ? -this._usedEndToken.length : 0;
var deltaColumn = this._usedEndToken ? -this._usedEndToken.length - 1 : 0; // minus 1 space before endToken
return new Selection(
srcRange.endLineNumber,
srcRange.endColumn + deltaColumn,
......
......@@ -28,13 +28,13 @@ suite('Editor Contrib - Block Comment Command', () => {
],
new Selection(1, 3, 1, 3),
[
'fi<00>rst',
'fi<0 0>rst',
'\tsecond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 5, 1, 5)
new Selection(1, 6, 1, 6)
);
});
......@@ -49,13 +49,13 @@ suite('Editor Contrib - Block Comment Command', () => {
],
new Selection(2, 1, 1, 1),
[
'<0first',
'0>\tsecond line',
'<0 first',
' 0>\tsecond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 3, 2, 1)
new Selection(1, 4, 2, 1)
);
});
......@@ -70,13 +70,13 @@ suite('Editor Contrib - Block Comment Command', () => {
],
new Selection(1, 6, 1, 1),
[
'<0first0>',
'<0 first 0>',
'\tsecond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 3, 1, 8)
new Selection(1, 4, 1, 9)
);
testBlockCommentCommand(
......@@ -110,13 +110,13 @@ suite('Editor Contrib - Block Comment Command', () => {
],
new Selection(1, 6, 1, 3),
[
'fi<0rst0>',
'fi<0 rst 0>',
'\tsecond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 5, 1, 8)
new Selection(1, 6, 1, 9)
);
});
......@@ -131,13 +131,13 @@ suite('Editor Contrib - Block Comment Command', () => {
],
new Selection(1, 6, 1, 3),
[
'fi<0rst0>',
'fi<0 rst 0>',
'\tsecond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 5, 1, 8)
new Selection(1, 6, 1, 9)
);
testBlockCommentCommand(
......@@ -171,13 +171,13 @@ suite('Editor Contrib - Block Comment Command', () => {
],
new Selection(2, 4, 1, 1),
[
'<0first',
'\tse0>cond line',
'<0 first',
'\tse 0>cond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 3, 2, 4)
new Selection(1, 4, 2, 4)
);
});
......@@ -192,13 +192,13 @@ suite('Editor Contrib - Block Comment Command', () => {
],
new Selection(2, 4, 1, 1),
[
'<0first',
'\tse0>cond line',
'<0 first',
'\tse 0>cond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 3, 2, 4)
new Selection(1, 4, 2, 4)
);
testBlockCommentCommand(
......
......@@ -544,13 +544,13 @@ suite('Editor Contrib - Line Comment As Block Comment', () => {
],
new Selection(1, 1, 1, 1),
[
'(first)',
'( first )',
'\tsecond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 2, 1, 2)
new Selection(1, 3, 1, 3)
);
});
......@@ -586,13 +586,13 @@ suite('Editor Contrib - Line Comment As Block Comment', () => {
],
new Selection(1, 1, 1, 1),
[
'(first)',
'( first )',
'\tsecond line',
'third line',
'fourth line',
'fifth'
],
new Selection(1, 2, 1, 2)
new Selection(1, 3, 1, 3)
);
});
......@@ -607,13 +607,13 @@ suite('Editor Contrib - Line Comment As Block Comment', () => {
],
new Selection(3, 2, 1, 3),
[
'(first',
'( first',
'\tsecond line',
'third line)',
'third line )',
'fourth line',
'fifth'
],
new Selection(1, 4, 3, 2)
new Selection(1, 5, 3, 2)
);
testLineCommentCommand(
......@@ -655,7 +655,7 @@ suite('Editor Contrib - Line Comment As Block Comment 2', () => {
],
new Selection(1, 1, 1, 1),
[
'\t\t<!@#first\t #@!>',
'\t\t<!@# first\t #@!>',
'\t\tsecond line',
'\tthird line',
'fourth line',
......@@ -809,8 +809,8 @@ suite('Editor Contrib - Line Comment As Block Comment 2', () => {
],
new Selection(1, 1, 3, 1),
[
' <!@#asd qwe',
' asd qwe#@!>',
' <!@# asd qwe',
' asd qwe #@!>',
''
],
new Selection(1, 1, 3, 1)
......@@ -927,13 +927,13 @@ suite('Editor Contrib - Line Comment in mixed modes', () => {
[
'import React from \'react\';',
'const Loader = () => (',
' {/*<div>*/}',
' {/* <div> */}',
' Loading...',
' </div>',
');',
'export default Loader;'
],
new Selection(3, 7, 3, 7),
new Selection(3, 8, 3, 8),
);
});
......
......@@ -27,6 +27,17 @@ export interface IWorkspaceContextService {
*/
getWorkspace(): IWorkspace;
/**
* Provides access to the workspace object the platform is running with. This may be null if the workbench was opened
* without workspace (empty);
*/
getWorkspace2(): IWorkspace2;
/**
* An event which fires on workspace roots change.
*/
onDidChangeWorkspaceRoots: Event<URI[]>;
/**
* Returns iff the provided resource is inside the workspace or not.
*/
......@@ -44,11 +55,6 @@ export interface IWorkspaceContextService {
*/
toResource: (workspaceRelativePath: string) => URI;
/**
* TODO@Ben multiroot
*/
getFolders(): URI[];
onDidChangeFolders: Event<URI[]>;
}
export interface IWorkspace {
......@@ -72,6 +78,20 @@ export interface IWorkspace {
name?: string;
}
export interface IWorkspace2 {
/**
* the unique identifier of the workspace.
*/
readonly id: string;
/**
* Mutliple roots in this workspace. First entry is master and never changes.
*/
readonly roots: URI[];
}
export class Workspace implements IWorkspace {
constructor(private _resource: URI, private _uid?: number, private _name?: string) {
......@@ -105,9 +125,9 @@ export class Workspace implements IWorkspace {
return null;
}
public toResource(workspaceRelativePath: string): URI {
public toResource(workspaceRelativePath: string, root?: URI): URI {
if (typeof workspaceRelativePath === 'string') {
return URI.file(paths.join(this._resource.fsPath, workspaceRelativePath));
return URI.file(paths.join(root ? root.fsPath : this._resource.fsPath, workspaceRelativePath));
}
return null;
......
......@@ -37,7 +37,7 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
) {
super();
this._proxy = threadService.get(ExtHostContext.ExtHostWorkspace);
this._contextService.onDidChangeFolders(this._onDidChangeWorkspace, this, this._toDispose);
this._contextService.onDidChangeWorkspaceRoots(this._onDidChangeWorkspace, this, this._toDispose);
}
// --- workspace ---
......
......@@ -408,7 +408,7 @@ export function createApiFactory(
onWillSaveTextDocument: (listener, thisArgs?, disposables?) => {
return extHostDocumentSaveParticipant.onWillSaveTextDocumentEvent(listener, thisArgs, disposables);
},
onDidChangeConfiguration: (listener: () => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) => {
onDidChangeConfiguration: (listener: (_: any) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) => {
return extHostConfiguration.onDidChangeConfiguration(listener, thisArgs, disposables);
},
getConfiguration: (section?: string): vscode.WorkspaceConfiguration => {
......
......@@ -316,14 +316,14 @@ export class ExtHostSCM {
return sourceControl;
}
$provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<vscode.Uri> {
$provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<URI> {
const sourceControl = this._sourceControls.get(sourceControlHandle);
if (!sourceControl || !sourceControl.quickDiffProvider) {
return TPromise.as(null);
}
return asWinJsPromise(token => sourceControl.quickDiffProvider.provideOriginalResource(uri, token));
return asWinJsPromise(token => URI.parse(sourceControl.quickDiffProvider.provideOriginalResource(uri, token).toString()));
}
$onActiveSourceControlChange(handle: number): TPromise<void> {
......
......@@ -293,6 +293,11 @@ export class ActivitybarPart extends Part implements IActivityBarService {
}
private updateViewletSwitcher() {
if (!this.viewletSwitcherBar) {
// We have not been rendered yet so there is nothing to update.
return;
}
let viewletsToShow = this.getPinnedViewlets();
// Always show the active viewlet even if it is marked to be hidden
......
......@@ -17,7 +17,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, Workspace, IWorkspace } from "vs/platform/workspace/common/workspace";
import { IWorkspaceContextService, IWorkspace2, Workspace as SingleRootWorkspace, IWorkspace } from "vs/platform/workspace/common/workspace";
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { FileChangeType, FileChangesEvent, isEqual } from 'vs/platform/files/common/files';
import { ConfigModel } from 'vs/platform/configuration/common/model';
......@@ -44,14 +44,29 @@ interface IWorkspaceConfiguration<T> {
type IWorkspaceFoldersConfiguration = { [rootFolder: string]: { folders: string[]; } };
class Workspace implements IWorkspace2 {
constructor(readonly id: string, private _roots: URI[]) {
}
get roots(): URI[] {
return this._roots;
}
setRoots(roots: URI[]): void {
this._roots = roots;
}
}
export class WorkspaceConfigurationService extends Disposable implements IWorkspaceContextService, IWorkspaceConfigurationService {
private static RELOAD_CONFIGURATION_DELAY = 50;
public _serviceBrand: any;
private readonly _onDidChangeFolders: Emitter<URI[]> = this._register(new Emitter<URI[]>());
public readonly onDidChangeFolders: Event<URI[]> = this._onDidChangeFolders.event;
private readonly _onDidChangeWorkspaceRoots: Emitter<URI[]> = this._register(new Emitter<URI[]>());
public readonly onDidChangeWorkspaceRoots: Event<URI[]> = this._onDidChangeWorkspaceRoots.event;
private readonly _onDidUpdateConfiguration: Emitter<IConfigurationServiceEvent> = this._register(new Emitter<IConfigurationServiceEvent>());
public readonly onDidUpdateConfiguration: Event<IConfigurationServiceEvent> = this._onDidUpdateConfiguration.event;
......@@ -65,12 +80,12 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
private workspaceFilePathToConfiguration: { [relativeWorkspacePath: string]: TPromise<IConfigModel<any>> };
private reloadConfigurationScheduler: RunOnceScheduler;
private folders: URI[];
private readonly workspace: Workspace;
constructor(private environmentService: IEnvironmentService, private workspace?: Workspace, private workspaceSettingsRootFolder: string = WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME) {
constructor(private environmentService: IEnvironmentService, private singleRootWorkspace?: SingleRootWorkspace, private workspaceSettingsRootFolder: string = WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME) {
super();
this.folders = workspace ? [workspace.resource] : [];
this.workspace = singleRootWorkspace ? new Workspace(`${singleRootWorkspace.uid}`, [singleRootWorkspace.resource]) : null;
this.workspaceFilePathToConfiguration = Object.create(null);
this.cachedConfig = new ConfigModel<any>(null);
......@@ -95,10 +110,11 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
}
// Resovled configured folders for workspace
let configuredFolders: URI[] = [this.workspace.resource];
let [master] = this.workspace.roots;
let configuredFolders: URI[] = [master];
const config = this.getConfiguration<IWorkspaceFoldersConfiguration>('workspace');
if (config) {
const workspaceConfig = config[this.workspace.resource.toString()];
const workspaceConfig = config[master.toString()];
if (workspaceConfig) {
const additionalFolders = workspaceConfig.folders
.map(f => URI.parse(f))
......@@ -112,20 +128,20 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
configuredFolders = distinct(configuredFolders, r => r.toString());
// Find changes
const changed = !equals(this.folders, configuredFolders, (r1, r2) => r1.toString() === r2.toString());
const changed = !equals(this.workspace.roots, configuredFolders, (r1, r2) => r1.toString() === r2.toString());
this.folders = configuredFolders;
this.workspace.setRoots(configuredFolders);
if (notify && changed) {
this._onDidChangeFolders.fire(configuredFolders);
this._onDidChangeWorkspaceRoots.fire(configuredFolders);
}
}
public getFolders(): URI[] {
return this.folders;
public getWorkspace(): IWorkspace {
return this.singleRootWorkspace;
}
public getWorkspace(): IWorkspace {
public getWorkspace2(): IWorkspace2 {
return this.workspace;
}
......@@ -134,15 +150,15 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
}
public isInsideWorkspace(resource: URI): boolean {
return this.workspace ? this.workspace.isInsideWorkspace(resource) : false;
return this.workspace ? this.singleRootWorkspace.isInsideWorkspace(resource) : false;
}
public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string {
return this.workspace ? this.workspace.toWorkspaceRelativePath(resource, toOSPath) : null;
return this.workspace ? this.singleRootWorkspace.toWorkspaceRelativePath(resource, toOSPath) : null;
}
public toResource(workspaceRelativePath: string): URI {
return this.workspace ? this.workspace.toResource(workspaceRelativePath) : null;
return this.workspace ? this.singleRootWorkspace.toResource(workspaceRelativePath) : null;
}
private onBaseConfigurationChanged(event: IConfigurationServiceEvent): void {
......@@ -276,7 +292,7 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
// once: when invoked for the first time we fetch json files that contribute settings
if (!this.bulkFetchFromWorkspacePromise) {
this.bulkFetchFromWorkspacePromise = resolveStat(this.workspace.toResource(this.workspaceSettingsRootFolder)).then(stat => {
this.bulkFetchFromWorkspacePromise = resolveStat(this.toResource(this.workspaceSettingsRootFolder)).then(stat => {
if (!stat.isDirectory) {
return TPromise.as([]);
}
......@@ -287,11 +303,11 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
return false; // only JSON files
}
return this.isWorkspaceConfigurationFile(this.workspace.toWorkspaceRelativePath(stat.resource)); // only workspace config files
return this.isWorkspaceConfigurationFile(this.toWorkspaceRelativePath(stat.resource)); // only workspace config files
}).map(stat => stat.resource));
}, err => [] /* never fail this call */)
.then((contents: IContent[]) => {
contents.forEach(content => this.workspaceFilePathToConfiguration[this.workspace.toWorkspaceRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content)));
contents.forEach(content => this.workspaceFilePathToConfiguration[this.toWorkspaceRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content)));
}, errors.onUnexpectedError);
}
......@@ -317,7 +333,7 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
continue; // only JSON files or the actual settings folder
}
const workspacePath = this.workspace.toWorkspaceRelativePath(resource);
const workspacePath = this.toWorkspaceRelativePath(resource);
if (!workspacePath) {
continue; // event is not inside workspace
}
......@@ -353,7 +369,7 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
}
private createConfigModel<T>(content: IContent): IConfigModel<T> {
const path = this.workspace.toWorkspaceRelativePath(content.resource);
const path = this.toWorkspaceRelativePath(content.resource);
if (path === WORKSPACE_CONFIG_DEFAULT_PATH) {
return new WorkspaceSettingsConfigModel<T>(content.value, content.resource.toString());
} else {
......
......@@ -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 } from 'vs/platform/workspace/common/workspace';
import { IWorkspace, 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';
......@@ -66,16 +66,16 @@ export class TestContextService implements IWorkspaceContextService {
private workspace: any;
private options: any;
private _onDidChangeFolders: Emitter<URI[]>;
private _onDidChangeWorkspaceRoots: Emitter<URI[]>;
constructor(workspace: any = TestWorkspace, options: any = null) {
this.workspace = workspace;
this.options = options || Object.create(null);
this._onDidChangeFolders = new Emitter<URI[]>();
this._onDidChangeWorkspaceRoots = new Emitter<URI[]>();
}
public get onDidChangeFolders(): Event<URI[]> {
return this._onDidChangeFolders.event;
public get onDidChangeWorkspaceRoots(): Event<URI[]> {
return this._onDidChangeWorkspaceRoots.event;
}
public getFolders(): URI[] {
......@@ -90,6 +90,10 @@ export class TestContextService implements IWorkspaceContextService {
return this.workspace;
}
public getWorkspace2(): IWorkspace2 {
return this.workspace ? { id: `${this.workspace.uid}`, roots: [this.workspace.resource] } : void 0;
}
public setWorkspace(workspace: any): void {
this.workspace = workspace;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册