File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/tools/rust-analyzer/crates/rust-analyzer/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,18 @@ impl fmt::Display for FlycheckConfig {
111
111
match self {
112
112
FlycheckConfig :: CargoCommand { command, .. } => write ! ( f, "cargo {command}" ) ,
113
113
FlycheckConfig :: CustomCommand { command, args, .. } => {
114
- write ! ( f, "{command} {}" , args. join( " " ) )
114
+ // Don't show `my_custom_check --foo $saved_file` literally to the user, as it
115
+ // looks like we've forgotten to substitute $saved_file.
116
+ //
117
+ // Instead, show `my_custom_check --foo ...`. The
118
+ // actual path is often too long to be worth showing
119
+ // in the IDE (e.g. in the VS Code status bar).
120
+ let display_args = args
121
+ . iter ( )
122
+ . map ( |arg| if arg == SAVED_FILE_PLACEHOLDER { "..." } else { arg } )
123
+ . collect :: < Vec < _ > > ( ) ;
124
+
125
+ write ! ( f, "{command} {}" , display_args. join( " " ) )
115
126
}
116
127
}
117
128
}
You can’t perform that action at this time.
0 commit comments