Skip to content

Commit 32a5776

Browse files
committed
src/goTools.ts: disable lint tool if 'staticcheck' is true
This checks both the values of 'ui.diagnostic.staticcheck' as well as 'staticcheck' to properly turn off the linting tools. Fixes #1867 Change-Id: Ic50b675b40a5d7181e7053c3408e35c8734112e1 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/361794 Trust: Suzy Mueller <suzmue@golang.org> Run-TryBot: Suzy Mueller <suzmue@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
1 parent cc34acf commit 32a5776

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/goTools.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ export function goplsStaticcheckEnabled(
208208
goConfig: { [key: string]: any },
209209
goplsConfig: { [key: string]: any }
210210
): boolean {
211-
if (goConfig['useLanguageServer'] !== true || goplsConfig['ui.diagnostic.staticcheck'] !== true) {
211+
if (
212+
goConfig['useLanguageServer'] !== true ||
213+
goplsConfig['ui.diagnostic.staticcheck'] === false ||
214+
(goplsConfig['ui.diagnostic.staticcheck'] === undefined && goplsConfig['staticcheck'] !== true)
215+
) {
212216
return false;
213217
}
214218
const features = goConfig['languageServerExperimentalFeatures'];

0 commit comments

Comments
 (0)