提交 e334494b 编写于 作者: J Johannes Rieken

handle edge case, fixes #11402

上级 98d4bd4b
......@@ -39,7 +39,7 @@ export class ExtHostWorkspace {
}
if (isEqualOrParent(path, this._workspacePath)) {
return relative(this._workspacePath, path);
return relative(this._workspacePath, path) || path;
}
return path;
......
......@@ -20,4 +20,16 @@ suite('ExtHostWorkspace', function () {
'm:/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart');
});
test('asRelativePath, same paths, #11402', function () {
const root = '/home/aeschli/workspaces/samples/docker';
const input = '/home/aeschli/workspaces/samples/docker';
const ws = new ExtHostWorkspace(new TestThreadService(), root);
assert.equal(ws.getRelativePath(input), input);
const input2 = '/home/aeschli/workspaces/samples/docker/a.file';
assert.equal(ws.getRelativePath(input2), 'a.file');
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册