File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed
src/tools/rust-analyzer/editors/code/src Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 1
1
import * as vscode from "vscode" ;
2
2
import type * as lc from "vscode-languageclient/node" ;
3
3
import * as ra from "./lsp_ext" ;
4
- import * as commands from "./commands" ;
5
4
6
5
import { Config , prepareVSCodeConfig } from "./config" ;
7
6
import { createClient } from "./client" ;
@@ -463,17 +462,9 @@ export class Ctx implements RustAnalyzerExtensionApi {
463
462
for ( const [ name , factory ] of Object . entries ( this . commandFactories ) ) {
464
463
const fullName = `rust-analyzer.${ name } ` ;
465
464
let callback ;
466
-
467
465
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 ) ;
477
468
} else if ( factory . disabled ) {
478
469
callback = factory . disabled ( this ) ;
479
470
} else {
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ function createCommands(): Record<string, CommandFactory> {
167
167
viewCrateGraph : { enabled : commands . viewCrateGraph } ,
168
168
viewFullCrateGraph : { enabled : commands . viewFullCrateGraph } ,
169
169
expandMacro : { enabled : commands . expandMacro } ,
170
- run : { enabled : commands . run } ,
170
+ run : { enabled : ( ctx ) => ( mode ?: "cursor" ) => commands . run ( ctx , mode ) ( ) } ,
171
171
copyRunCommandLine : { enabled : commands . copyRunCommandLine } ,
172
172
debug : { enabled : commands . debug } ,
173
173
newDebugConfig : { enabled : commands . newDebugConfig } ,
You can’t perform that action at this time.
0 commit comments