diff options
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/package.json | 12 | ||||
-rw-r--r-- | editors/code/src/client.ts | 1 | ||||
-rw-r--r-- | editors/code/src/snippets.ts | 4 |
3 files changed, 14 insertions, 3 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index aac4ba94f..448e2269f 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -655,24 +655,30 @@ | |||
655 | "problemMatchers": [ | 655 | "problemMatchers": [ |
656 | { | 656 | { |
657 | "name": "rustc", | 657 | "name": "rustc", |
658 | "owner": "rustc", | ||
659 | "source": "rustc", | ||
658 | "fileLocation": [ | 660 | "fileLocation": [ |
659 | "relative", | 661 | "autoDetect", |
660 | "${workspaceRoot}" | 662 | "${workspaceRoot}" |
661 | ], | 663 | ], |
662 | "pattern": "$rustc" | 664 | "pattern": "$rustc" |
663 | }, | 665 | }, |
664 | { | 666 | { |
665 | "name": "rustc-json", | 667 | "name": "rustc-json", |
668 | "owner": "rustc", | ||
669 | "source": "rustc", | ||
666 | "fileLocation": [ | 670 | "fileLocation": [ |
667 | "relative", | 671 | "autoDetect", |
668 | "${workspaceRoot}" | 672 | "${workspaceRoot}" |
669 | ], | 673 | ], |
670 | "pattern": "$rustc-json" | 674 | "pattern": "$rustc-json" |
671 | }, | 675 | }, |
672 | { | 676 | { |
673 | "name": "rustc-watch", | 677 | "name": "rustc-watch", |
678 | "owner": "rustc", | ||
679 | "source": "rustc", | ||
674 | "fileLocation": [ | 680 | "fileLocation": [ |
675 | "relative", | 681 | "autoDetect", |
676 | "${workspaceRoot}" | 682 | "${workspaceRoot}" |
677 | ], | 683 | ], |
678 | "background": { | 684 | "background": { |
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 41ffac7b3..18948cb3c 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -41,6 +41,7 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient | |||
41 | const clientOptions: lc.LanguageClientOptions = { | 41 | const clientOptions: lc.LanguageClientOptions = { |
42 | documentSelector: [{ scheme: 'file', language: 'rust' }], | 42 | documentSelector: [{ scheme: 'file', language: 'rust' }], |
43 | initializationOptions: vscode.workspace.getConfiguration("rust-analyzer"), | 43 | initializationOptions: vscode.workspace.getConfiguration("rust-analyzer"), |
44 | diagnosticCollectionName: "rustc", | ||
44 | traceOutputChannel, | 45 | traceOutputChannel, |
45 | middleware: { | 46 | middleware: { |
46 | // Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576 | 47 | // Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576 |
diff --git a/editors/code/src/snippets.ts b/editors/code/src/snippets.ts index bcb3f2cc7..258b49982 100644 --- a/editors/code/src/snippets.ts +++ b/editors/code/src/snippets.ts | |||
@@ -6,6 +6,10 @@ export async function applySnippetWorkspaceEdit(edit: vscode.WorkspaceEdit) { | |||
6 | assert(edit.entries().length === 1, `bad ws edit: ${JSON.stringify(edit)}`); | 6 | assert(edit.entries().length === 1, `bad ws edit: ${JSON.stringify(edit)}`); |
7 | const [uri, edits] = edit.entries()[0]; | 7 | const [uri, edits] = edit.entries()[0]; |
8 | 8 | ||
9 | if (vscode.window.activeTextEditor?.document.uri !== uri) { | ||
10 | // `vscode.window.visibleTextEditors` only contains editors whose contents are being displayed | ||
11 | await vscode.window.showTextDocument(uri, {}); | ||
12 | } | ||
9 | const editor = vscode.window.visibleTextEditors.find((it) => it.document.uri.toString() === uri.toString()); | 13 | const editor = vscode.window.visibleTextEditors.find((it) => it.document.uri.toString() === uri.toString()); |
10 | if (!editor) return; | 14 | if (!editor) return; |
11 | await applySnippetTextEdits(editor, edits); | 15 | await applySnippetTextEdits(editor, edits); |