mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Make rootPath undefined in a multiroot workspace, #69335
This commit is contained in:
parent
0403a10885
commit
5bc80f3ea0
|
@ -339,6 +339,11 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac
|
|||
if (folders.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (folders.length > 1) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// #54483 @Joh Why are we still using fsPath?
|
||||
return folders[0].uri.fsPath;
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ suite('ExtHostWorkspace', function () {
|
|||
assert.equal(ws.getPath(), undefined);
|
||||
|
||||
ws = createExtHostWorkspace(new TestRPCProtocol(), { id: 'foo', name: 'Test', folders: [aWorkspaceFolderData(URI.file('Folder'), 0), aWorkspaceFolderData(URI.file('Another/Folder'), 1)] }, new NullLogService());
|
||||
assert.equal(ws.getPath()!.replace(/\\/g, '/'), '/Folder');
|
||||
assert.equal(ws.getPath(), undefined);
|
||||
|
||||
ws = createExtHostWorkspace(new TestRPCProtocol(), { id: 'foo', name: 'Test', folders: [aWorkspaceFolderData(URI.file('/Folder'), 0)] }, new NullLogService());
|
||||
assert.equal(ws.getPath()!.replace(/\\/g, '/'), '/Folder');
|
||||
|
|
Loading…
Reference in a new issue