diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2020-05-25 15:55:25 +0200 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2020-05-25 15:59:49 +0200 |
| commit | 0ebb25b29b0988be89f42091fd373ea58d7ff9fb (patch) | |
| tree | 06bb2df01d20d94ab38f2216d88555df03a826c9 /editors/code/src | |
| parent | a30bdd9795770329e4562d8bfca60ebe2e52dea1 (diff) | |
| download | rust-0ebb25b29b0988be89f42091fd373ea58d7ff9fb.tar.gz rust-0ebb25b29b0988be89f42091fd373ea58d7ff9fb.zip | |
Document `parentModule` experimental LSP request
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/commands.ts | 6 | ||||
| -rw-r--r-- | editors/code/src/lsp_ext.ts | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index 49e3845d5b1..86302db37c1 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -138,10 +138,10 @@ export function parentModule(ctx: Ctx): Cmd { ), }); const loc = response[0]; - if (loc == null) return; + if (!loc) return; - const uri = client.protocol2CodeConverter.asUri(loc.uri); - const range = client.protocol2CodeConverter.asRange(loc.range); + const uri = client.protocol2CodeConverter.asUri(loc.targetUri); + const range = client.protocol2CodeConverter.asRange(loc.targetRange); const doc = await vscode.workspace.openTextDocument(uri); const e = await vscode.window.showTextDocument(doc); diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 2a06632619b..4da12eb3092 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -31,7 +31,7 @@ export interface MatchingBraceParams { } export const matchingBrace = new lc.RequestType<MatchingBraceParams, lc.Position[], void>("experimental/matchingBrace"); -export const parentModule = new lc.RequestType<lc.TextDocumentPositionParams, lc.Location[], void>("rust-analyzer/parentModule"); +export const parentModule = new lc.RequestType<lc.TextDocumentPositionParams, lc.LocationLink[], void>("experimental/parentModule"); export interface JoinLinesParams { textDocument: lc.TextDocumentIdentifier; |
