mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Code reorganisation and field support
This commit is contained in:
parent
a14194b428
commit
974518fde7
6 changed files with 105 additions and 60 deletions
|
@ -421,12 +421,10 @@ export function gotoLocation(ctx: Ctx): Cmd {
|
|||
|
||||
export function openDocs(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
console.log("running openDocs");
|
||||
|
||||
const client = ctx.client;
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (!editor || !client) {
|
||||
console.log("not yet ready");
|
||||
return
|
||||
};
|
||||
|
||||
|
@ -435,7 +433,9 @@ export function openDocs(ctx: Ctx): Cmd {
|
|||
|
||||
const doclink = await client.sendRequest(ra.openDocs, { position, textDocument });
|
||||
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(doclink.remote));
|
||||
if (doclink != null) {
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(doclink));
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue