From a55b6aa3aa797c989a4979a13a5bd2ae11cfd4a5 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 29 Mar 2019 20:30:36 +0100 Subject: Remove grapqhl, fixes #387 --- autoload/go/config.vim | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'autoload/go') diff --git a/autoload/go/config.vim b/autoload/go/config.vim index 7cb7f05e..7c840c53 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -214,6 +214,12 @@ function! go#config#DebugCommands() abort return g:go_debug_commands endfunction +function! go#config#LspLog() abort + " make sure g:go_lsp_log is set so that it can be added to easily. + let g:go_lsp_log = get(g:, 'go_lsp_log', []) + return g:go_lsp_log +endfunction + function! go#config#SetDebugDiag(value) abort let g:go_debug_diag = a:value endfunction @@ -239,15 +245,27 @@ function! go#config#SetTemplateAutocreate(value) abort endfunction function! go#config#MetalinterCommand() abort - return get(g:, "go_metalinter_command", "") + return get(g:, "go_metalinter_command", "gometalinter") endfunction function! go#config#MetalinterAutosaveEnabled() abort - return get(g:, 'go_metalinter_autosave_enabled', ['vet', 'golint']) + let l:default_enabled = ["vet", "golint"] + + if go#config#MetalinterCommand() == "golangci-lint" + let l:default_enabled = ["govet", "golint"] + endif + + return get(g:, "go_metalinter_autosave_enabled", default_enabled) endfunction function! go#config#MetalinterEnabled() abort - return get(g:, "go_metalinter_enabled", ['vet', 'golint', 'errcheck']) + let l:default_enabled = ["vet", "golint", "errcheck"] + + if go#config#MetalinterCommand() == "golangci-lint" + let l:default_enabled = ["govet", "golint"] + endif + + return get(g:, "go_metalinter_enabled", default_enabled) endfunction function! go#config#MetalinterDisabled() abort @@ -448,7 +466,6 @@ function! go#config#EchoGoInfo() abort return get(g:, "go_echo_go_info", 1) endfunction - " Set the default value. A value of "1" is a shortcut for this, for " compatibility reasons. if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1 -- cgit v1.2.3