aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/runnables.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands/runnables.ts')
-rw-r--r--editors/code/src/commands/runnables.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index 8cd86c21e..7919997ce 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -8,18 +8,19 @@ export function run(ctx: Ctx): Cmd {
8 8
9 return async () => { 9 return async () => {
10 const editor = ctx.activeRustEditor; 10 const editor = ctx.activeRustEditor;
11 if (!editor) return; 11 const client = ctx.client;
12 if (!editor || !client) return;
12 13
13 const textDocument: lc.TextDocumentIdentifier = { 14 const textDocument: lc.TextDocumentIdentifier = {
14 uri: editor.document.uri.toString(), 15 uri: editor.document.uri.toString(),
15 }; 16 };
16 const params: RunnablesParams = { 17 const params: RunnablesParams = {
17 textDocument, 18 textDocument,
18 position: ctx.client.code2ProtocolConverter.asPosition( 19 position: client.code2ProtocolConverter.asPosition(
19 editor.selection.active, 20 editor.selection.active,
20 ), 21 ),
21 }; 22 };
22 const runnables = await ctx.client.sendRequest<Runnable[]>( 23 const runnables = await client.sendRequest<Runnable[]>(
23 'rust-analyzer/runnables', 24 'rust-analyzer/runnables',
24 params, 25 params,
25 ); 26 );