File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ import { toggleVulncheckCommandFactory } from './goVulncheck';
75
75
import { GoTaskProvider } from './goTaskProvider' ;
76
76
import { setTelemetryEnvVars , telemetryReporter } from './goTelemetry' ;
77
77
import { experiments } from './experimental' ;
78
+ import { allToolsInformation } from './goToolsInformation' ;
78
79
79
80
const goCtx : GoExtensionContext = { } ;
80
81
@@ -300,7 +301,16 @@ function addOnDidChangeConfigListeners(ctx: vscode.ExtensionContext) {
300
301
}
301
302
302
303
if ( e . affectsConfiguration ( 'go.formatTool' ) ) {
303
- checkToolExists ( getFormatTool ( updatedGoConfig ) ) ;
304
+ const tool = getFormatTool ( updatedGoConfig ) ;
305
+ // When language server gopls is active (by default), existence
306
+ // checks are skipped only for tools that gopls replaces. Other
307
+ // tools are still checked.
308
+ if (
309
+ updatedGoConfig [ 'useLanguageServer' ] === false ||
310
+ ! new Set ( [ 'gofmt' , 'goimports' , 'goformat' ] ) . has ( tool )
311
+ ) {
312
+ checkToolExists ( tool ) ;
313
+ }
304
314
}
305
315
if ( e . affectsConfiguration ( 'go.lintTool' ) ) {
306
316
checkToolExists ( updatedGoConfig [ 'lintTool' ] ) ;
You can’t perform that action at this time.
0 commit comments