Skip to content

Commit

Permalink
extension: resolve variables in customFormatter field.
Browse files Browse the repository at this point in the history
Fixes #2582
Originally PR #2942.

Co-authored-by: Sebastian Leisinger <leisinger@anapaya.net>
Change-Id: If4e2802ba4ab02e85830cf71883e0cc9557540f5
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/576296
Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
  • Loading branch information
hyangah and uniquefine committed Apr 4, 2024
1 parent 78deb71 commit 40990c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extension/src/language/legacy/goFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import vscode = require('vscode');
import { getGoConfig } from '../../config';
import { toolExecutionEnvironment } from '../../goEnv';
import { promptForMissingTool, promptForUpdatingTool } from '../../goInstallTools';
import { getBinPath } from '../../util';
import { getBinPath, resolvePath } from '../../util';
import { killProcessTree } from '../../utils/processUtils';

export class GoDocumentFormattingEditProvider implements vscode.DocumentFormattingEditProvider {
Expand Down Expand Up @@ -144,7 +144,7 @@ export function getFormatTool(goConfig: { [key: string]: any }): string {
return 'goimports';
}
if (formatTool === 'custom') {
return goConfig['alternateTools']['customFormatter'] || 'goimports';
return resolvePath(goConfig['alternateTools']['customFormatter'] || 'goimports');
}
return formatTool;
}

0 comments on commit 40990c0

Please sign in to comment.