mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Fix NPEs
This commit is contained in:
parent
6368b40dd9
commit
cb41ffbbbd
5 changed files with 24 additions and 21 deletions
|
@ -8,18 +8,19 @@ export function run(ctx: Ctx): Cmd {
|
|||
|
||||
return async () => {
|
||||
const editor = ctx.activeRustEditor;
|
||||
if (!editor) return;
|
||||
const client = ctx.client;
|
||||
if (!editor || !client) return;
|
||||
|
||||
const textDocument: lc.TextDocumentIdentifier = {
|
||||
uri: editor.document.uri.toString(),
|
||||
};
|
||||
const params: RunnablesParams = {
|
||||
textDocument,
|
||||
position: ctx.client.code2ProtocolConverter.asPosition(
|
||||
position: client.code2ProtocolConverter.asPosition(
|
||||
editor.selection.active,
|
||||
),
|
||||
};
|
||||
const runnables = await ctx.client.sendRequest<Runnable[]>(
|
||||
const runnables = await client.sendRequest<Runnable[]>(
|
||||
'rust-analyzer/runnables',
|
||||
params,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue