File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 11import * as vscode from "vscode" ;
22import type * as lc from "vscode-languageclient/node" ;
33import * as ra from "./lsp_ext" ;
4- import * as commands from "./commands" ;
54
65import { Config , prepareVSCodeConfig } from "./config" ;
76import { createClient } from "./client" ;
@@ -463,17 +462,9 @@ export class Ctx implements RustAnalyzerExtensionApi {
463462 for ( const [ name , factory ] of Object . entries ( this . commandFactories ) ) {
464463 const fullName = `rust-analyzer.${ name } ` ;
465464 let callback ;
466-
467465 if ( isClientRunning ( this ) ) {
468- if ( name === "run" ) {
469- // Special case: support optional argument for `run`
470- callback = ( mode ?: "cursor" ) => {
471- return commands . run ( this , mode ) ( ) ;
472- } ;
473- } else {
474- // we asserted that `client` is defined
475- callback = factory . enabled ( this ) ;
476- }
466+ // we asserted that `client` is defined
467+ callback = factory . enabled ( this ) ;
477468 } else if ( factory . disabled ) {
478469 callback = factory . disabled ( this ) ;
479470 } else {
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ function createCommands(): Record<string, CommandFactory> {
167167 viewCrateGraph : { enabled : commands . viewCrateGraph } ,
168168 viewFullCrateGraph : { enabled : commands . viewFullCrateGraph } ,
169169 expandMacro : { enabled : commands . expandMacro } ,
170- run : { enabled : commands . run } ,
170+ run : { enabled : ( ctx ) => ( mode ?: "cursor" ) => commands . run ( ctx , mode ) ( ) } ,
171171 copyRunCommandLine : { enabled : commands . copyRunCommandLine } ,
172172 debug : { enabled : commands . debug } ,
173173 newDebugConfig : { enabled : commands . newDebugConfig } ,
You can’t perform that action at this time.
0 commit comments