File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 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';
7575import { GoTaskProvider } from './goTaskProvider' ;
7676import { setTelemetryEnvVars , telemetryReporter } from './goTelemetry' ;
7777import { experiments } from './experimental' ;
78+ import { allToolsInformation } from './goToolsInformation' ;
7879
7980const goCtx : GoExtensionContext = { } ;
8081
@@ -300,7 +301,16 @@ function addOnDidChangeConfigListeners(ctx: vscode.ExtensionContext) {
300301 }
301302
302303 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+ }
304314 }
305315 if ( e . affectsConfiguration ( 'go.lintTool' ) ) {
306316 checkToolExists ( updatedGoConfig [ 'lintTool' ] ) ;
You can’t perform that action at this time.
0 commit comments