提交 3a68dedf 编写于 作者: J Johannes Rieken

Merge branch 'joh/next'

......@@ -1434,7 +1434,7 @@ declare namespace vscode {
* @return A human readable string which is presented as diagnostic message.
* Return `undefined`, `null`, or the empty string when 'value' is valid.
*/
validateInput?: (value: string) => string;
validateInput?(value: string): string;
}
/**
......@@ -1843,7 +1843,7 @@ declare namespace vscode {
* @return The resolved symbol or a thenable that resolves to that. When no result is returned,
* the given `symbol` is used.
*/
resolveWorkspaceSymbol?: (symbol: SymbolInformation, token: CancellationToken) => SymbolInformation | Thenable<SymbolInformation>;
resolveWorkspaceSymbol?(symbol: SymbolInformation, token: CancellationToken): SymbolInformation | Thenable<SymbolInformation>;
}
/**
......@@ -2445,7 +2445,7 @@ declare namespace vscode {
* @param link The link that is to be resolved.
* @param token A cancellation token.
*/
resolveDocumentLink?: (link: DocumentLink, token: CancellationToken) => DocumentLink | Thenable<DocumentLink>;
resolveDocumentLink?(link: DocumentLink, token: CancellationToken): DocumentLink | Thenable<DocumentLink>;
}
/**
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册