提交 7c6c7ac5 编写于 作者: M Matt Bierner

Allow extends to work without json suffix

Fixes #16905
上级 c86cab22
......@@ -33,7 +33,16 @@ class TsconfigLinkProvider implements vscode.DocumentLinkProvider {
}
private getExendsLink(document: vscode.TextDocument, root: jsonc.Node): vscode.DocumentLink | undefined {
return this.pathNodeToLink(document, jsonc.findNodeAtLocation(root, ['extends']));
const extendsNode = jsonc.findNodeAtLocation(root, ['extends']);
if (!this.isPathValue(extendsNode)) {
return undefined;
}
return new vscode.DocumentLink(
this.getRange(document, extendsNode),
basename(extendsNode.value).match('.json$')
? this.getFileTarget(document, extendsNode)
: vscode.Uri.file(join(dirname(document.uri.fsPath), extendsNode!.value + '.json')));
}
private getFilesLinks(document: vscode.TextDocument, root: jsonc.Node) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册