提交 5bc80f3e 编写于 作者: R Rob Lourens

Make rootPath undefined in a multiroot workspace, #69335

上级 0403a108
......@@ -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');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册