diff --git a/.bashrc b/.bashrc index 8869da97..58fe891a 100644 --- a/.bashrc +++ b/.bashrc @@ -119,9 +119,9 @@ alias vimrc="v ~/dotfiles/vim-config/configs.vim" alias tmux_conf="v ~/dotfiles/.tmux.conf" # remap some GNU utils to rust utilities -alias ls="exa --git" -alias l="exa -lahF --git" -alias ll="exa -lahF --git" +alias ls="exa" +alias l="exa -lahF" +alias ll="exa -lahF" alias t="tokei" alias b="bat" diff --git a/vim-config/configs.vim b/vim-config/configs.vim index 0205a754..82416c2c 100644 --- a/vim-config/configs.vim +++ b/vim-config/configs.vim @@ -228,6 +228,13 @@ augroup on_save autocmd BufWritePre * %s/\s\+$//e augroup END +augroup js_ts_tabs + autocmd! + + autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 + autocmd FileType typescript setlocal shiftwidth=2 tabstop=2 +augroup END + "********************" "** Plugin Configs **" "********************" @@ -402,14 +409,19 @@ nnoremap d :GitGutterToggle " Vim Go Configs " -------------- +" The following settings refer to go-vim. It seems to be a great +" plugin, but it really pollutes VIM with all sorts of error messages +" and non-customizable behavior like quickfix lists. Thus, we switched +" to coc-go and removed go-vim completely. + " set `goimports' to be used to format src files let g:go_fmt_command = 'goimports' " add golang linter path to runtime path set runtimepath+=$GOPATH/src/github.com/golang/lint/misc/vim -" disable location lists for go-vim -"let g:go_list_type = "quickfix" +" only quickfix, no location lists for go-vim +let g:go_list_type = "quickfix" " run :GoBuild or :GoTestCompile based on the go file function! s:build_go_files() @@ -445,8 +457,8 @@ let g:go_highlight_generate_tags = 1 let g:go_auto_type_info = 1 set updatetime=300 -" automatically highlight matching identifiers -let g:go_auto_sameids = 1 +" disable automatic highlighting of matching identifiers +let g:go_auto_sameids = 0 " Vim-Modern-Cpp Configs " ---------------------- @@ -496,7 +508,7 @@ let g:ale_linters = { \ 'typescript': ['eslint', 'tsserver'], \ 'javascript': ['prettier', 'eslint', 'jshint'], \ 'python': ['flake8', 'mypy'], -\ 'go': ['go', 'golint', 'errcheck'], +\ 'go': ['go', 'golint', 'errcheck', 'golangci-lint', 'govet', 'gofmt'], \ 'vim': ['vint'], \ 'elm': ['elm_ls'], \ 'cpp': ['clangtidy', 'g++'], @@ -528,6 +540,7 @@ let g:ale_fixers = { \ 'python': ['isort', 'autopep8'], \ 'elm': ['elm-format'], \ 'haskell': ['hfmt'], +\ 'go': ['gofmt'], \} " Totally usable, but needs configuration: 'cpp': ['clang-format']. " currently unusable: 'rust': ['rustfmt'] diff --git a/vim-config/plugins/ale/doc/tags b/vim-config/plugins/ale/doc/tags new file mode 100644 index 00000000..88da9b42 --- /dev/null +++ b/vim-config/plugins/ale/doc/tags @@ -0,0 +1,2561 @@ +:ALEDetail ale.txt /*:ALEDetail* +:ALEInfo ale.txt /*:ALEInfo* +:ALELint ale.txt /*:ALELint* +ALECodeAction ale.txt /*ALECodeAction* +ALEComplete ale.txt /*ALEComplete* +ALECompletePost ale.txt /*ALECompletePost* +ALECompletePost-autocmd ale.txt /*ALECompletePost-autocmd* +ALEDetail ale.txt /*ALEDetail* +ALEDisable ale.txt /*ALEDisable* +ALEDisableBuffer ale.txt /*ALEDisableBuffer* +ALEDocumentation ale.txt /*ALEDocumentation* +ALEEnable ale.txt /*ALEEnable* +ALEEnableBuffer ale.txt /*ALEEnableBuffer* +ALEError ale.txt /*ALEError* +ALEErrorLine ale.txt /*ALEErrorLine* +ALEErrorSign ale.txt /*ALEErrorSign* +ALEErrorSignLineNr ale.txt /*ALEErrorSignLineNr* +ALEFileRename ale.txt /*ALEFileRename* +ALEFindReferences ale.txt /*ALEFindReferences* +ALEFirst ale.txt /*ALEFirst* +ALEFix ale.txt /*ALEFix* +ALEFixPost ale.txt /*ALEFixPost* +ALEFixPost-autocmd ale.txt /*ALEFixPost-autocmd* +ALEFixPre ale.txt /*ALEFixPre* +ALEFixPre-autocmd ale.txt /*ALEFixPre-autocmd* +ALEFixSuggest ale.txt /*ALEFixSuggest* +ALEGoToDefinition ale.txt /*ALEGoToDefinition* +ALEGoToImplementation ale.txt /*ALEGoToImplementation* +ALEGoToTypeDefinition ale.txt /*ALEGoToTypeDefinition* +ALEHover ale.txt /*ALEHover* +ALEImport ale.txt /*ALEImport* +ALEInfo ale.txt /*ALEInfo* +ALEInfo-highlight ale.txt /*ALEInfo-highlight* +ALEInfo. ale.txt /*ALEInfo.* +ALEInfoLine ale.txt /*ALEInfoLine* +ALEInfoSign ale.txt /*ALEInfoSign* +ALEInfoSignLineNr ale.txt /*ALEInfoSignLineNr* +ALEInfoToClipboard ale.txt /*ALEInfoToClipboard* +ALEJobStarted ale.txt /*ALEJobStarted* +ALEJobStarted-autocmd ale.txt /*ALEJobStarted-autocmd* +ALELSPStarted ale.txt /*ALELSPStarted* +ALELSPStarted-autocmd ale.txt /*ALELSPStarted-autocmd* +ALELast ale.txt /*ALELast* +ALELint ale.txt /*ALELint* +ALELintPost ale.txt /*ALELintPost* +ALELintPost-autocmd ale.txt /*ALELintPost-autocmd* +ALELintPre ale.txt /*ALELintPre* +ALELintPre-autocmd ale.txt /*ALELintPre-autocmd* +ALELintStop ale.txt /*ALELintStop* +ALENext ale.txt /*ALENext* +ALENextWrap ale.txt /*ALENextWrap* +ALEOrganizeImports ale.txt /*ALEOrganizeImports* +ALEPopulateLocList ale.txt /*ALEPopulateLocList* +ALEPopulateQuickfix ale.txt /*ALEPopulateQuickfix* +ALEPrevious ale.txt /*ALEPrevious* +ALEPreviousWrap ale.txt /*ALEPreviousWrap* +ALERename ale.txt /*ALERename* +ALERepeatSelection ale.txt /*ALERepeatSelection* +ALEReset ale.txt /*ALEReset* +ALEResetBuffer ale.txt /*ALEResetBuffer* +ALEStopAllLSPs ale.txt /*ALEStopAllLSPs* +ALEStyleError ale.txt /*ALEStyleError* +ALEStyleErrorSign ale.txt /*ALEStyleErrorSign* +ALEStyleErrorSignLineNr ale.txt /*ALEStyleErrorSignLineNr* +ALEStyleWarning ale.txt /*ALEStyleWarning* +ALEStyleWarningSign ale.txt /*ALEStyleWarningSign* +ALEStyleWarningSignLineNr ale.txt /*ALEStyleWarningSignLineNr* +ALESymbolSearch ale.txt /*ALESymbolSearch* +ALEToggle ale.txt /*ALEToggle* +ALEToggleBuffer ale.txt /*ALEToggleBuffer* +ALEVirtualTextError ale.txt /*ALEVirtualTextError* +ALEVirtualTextInfo ale.txt /*ALEVirtualTextInfo* +ALEVirtualTextStyleError ale.txt /*ALEVirtualTextStyleError* +ALEVirtualTextStyleWarning ale.txt /*ALEVirtualTextStyleWarning* +ALEVirtualTextWarning ale.txt /*ALEVirtualTextWarning* +ALEWantResults ale.txt /*ALEWantResults* +ALEWantResults-autocmd ale.txt /*ALEWantResults-autocmd* +ALEWarning ale.txt /*ALEWarning* +ALEWarningLine ale.txt /*ALEWarningLine* +ALEWarningSign ale.txt /*ALEWarningSign* +ALEWarningSignLineNr ale.txt /*ALEWarningSignLineNr* +ale ale.txt /*ale* +ale#Env() ale.txt /*ale#Env()* +ale#GetFilenameMappings() ale.txt /*ale#GetFilenameMappings()* +ale#Has() ale.txt /*ale#Has()* +ale#Pad() ale.txt /*ale#Pad()* +ale#Queue() ale.txt /*ale#Queue()* +ale#command#CreateDirectory() ale.txt /*ale#command#CreateDirectory()* +ale#command#CreateFile() ale.txt /*ale#command#CreateFile()* +ale#command#EscapeCommandPart() ale.txt /*ale#command#EscapeCommandPart()* +ale#command#ManageDirectory() ale.txt /*ale#command#ManageDirectory()* +ale#command#ManageFile() ale.txt /*ale#command#ManageFile()* +ale#command#Run() ale.txt /*ale#command#Run()* +ale#completion#OmniFunc() ale.txt /*ale#completion#OmniFunc()* +ale#engine#GetLoclist() ale.txt /*ale#engine#GetLoclist()* +ale#engine#IsCheckingBuffer() ale.txt /*ale#engine#IsCheckingBuffer()* +ale#fix#registry#Add() ale.txt /*ale#fix#registry#Add()* +ale#linter#Define() ale.txt /*ale#linter#Define()* +ale#linter#Get() ale.txt /*ale#linter#Get()* +ale#linter#PreventLoading() ale.txt /*ale#linter#PreventLoading()* +ale#lsp_linter#SendRequest() ale.txt /*ale#lsp_linter#SendRequest()* +ale#other_source#ShowResults() ale.txt /*ale#other_source#ShowResults()* +ale#other_source#StartChecking() ale.txt /*ale#other_source#StartChecking()* +ale#statusline#Count() ale.txt /*ale#statusline#Count()* +ale#statusline#FirstProblem() ale.txt /*ale#statusline#FirstProblem()* +ale-ada-cspell ale-ada.txt /*ale-ada-cspell* +ale-ada-gcc ale-ada.txt /*ale-ada-gcc* +ale-ada-gnatpp ale-ada.txt /*ale-ada-gnatpp* +ale-ada-language-server ale-ada.txt /*ale-ada-language-server* +ale-ada-options ale-ada.txt /*ale-ada-options* +ale-alex-options ale.txt /*ale-alex-options* +ale-ansible-ansible-lint ale-ansible.txt /*ale-ansible-ansible-lint* +ale-ansible-language-server ale-ansible.txt /*ale-ansible-language-server* +ale-ansible-options ale-ansible.txt /*ale-ansible-options* +ale-api ale.txt /*ale-api* +ale-apkbuild-apkbuild-lint ale-apkbuild.txt /*ale-apkbuild-apkbuild-lint* +ale-apkbuild-options ale-apkbuild.txt /*ale-apkbuild-options* +ale-apkbuild-secfixes-check ale-apkbuild.txt /*ale-apkbuild-secfixes-check* +ale-asciidoc-cspell ale-asciidoc.txt /*ale-asciidoc-cspell* +ale-asciidoc-options ale-asciidoc.txt /*ale-asciidoc-options* +ale-asciidoc-textlint ale-asciidoc.txt /*ale-asciidoc-textlint* +ale-asciidoc-write-good ale-asciidoc.txt /*ale-asciidoc-write-good* +ale-asm-gcc ale-asm.txt /*ale-asm-gcc* +ale-asm-options ale-asm.txt /*ale-asm-options* +ale-asyncomplete-integration ale.txt /*ale-asyncomplete-integration* +ale-avra-avra ale-avra.txt /*ale-avra-avra* +ale-avra-options ale-avra.txt /*ale-avra-options* +ale-awk-gawk ale-awk.txt /*ale-awk-gawk* +ale-awk-options ale-awk.txt /*ale-awk-options* +ale-bats-options ale-bats.txt /*ale-bats-options* +ale-bats-shellcheck ale-bats.txt /*ale-bats-shellcheck* +ale-bazel-buildifier ale-bazel.txt /*ale-bazel-buildifier* +ale-bazel-options ale-bazel.txt /*ale-bazel-options* +ale-bib-bibclean ale-bib.txt /*ale-bib-bibclean* +ale-bib-options ale-bib.txt /*ale-bib-options* +ale-bicep-bicep ale-bicep.txt /*ale-bicep-bicep* +ale-bicep-options ale-bicep.txt /*ale-bicep-options* +ale-bitbake-oelint_adv ale-bitbake.txt /*ale-bitbake-oelint_adv* +ale-bitbake-options ale-bitbake.txt /*ale-bitbake-options* +ale-c-astyle ale-c.txt /*ale-c-astyle* +ale-c-cc ale-c.txt /*ale-c-cc* +ale-c-ccls ale-c.txt /*ale-c-ccls* +ale-c-clang ale-c.txt /*ale-c-clang* +ale-c-clangd ale-c.txt /*ale-c-clangd* +ale-c-clangformat ale-c.txt /*ale-c-clangformat* +ale-c-clangtidy ale-c.txt /*ale-c-clangtidy* +ale-c-cppcheck ale-c.txt /*ale-c-cppcheck* +ale-c-cquery ale-c.txt /*ale-c-cquery* +ale-c-cspell ale-c.txt /*ale-c-cspell* +ale-c-flawfinder ale-c.txt /*ale-c-flawfinder* +ale-c-gcc ale-c.txt /*ale-c-gcc* +ale-c-options ale-c.txt /*ale-c-options* +ale-c-uncrustify ale-c.txt /*ale-c-uncrustify* +ale-cairo-options ale-cairo.txt /*ale-cairo-options* +ale-cairo-starknet ale-cairo.txt /*ale-cairo-starknet* +ale-chef-cookstyle ale-chef.txt /*ale-chef-cookstyle* +ale-chef-foodcritic ale-chef.txt /*ale-chef-foodcritic* +ale-chef-options ale-chef.txt /*ale-chef-options* +ale-clojure-clj-kondo ale-clojure.txt /*ale-clojure-clj-kondo* +ale-clojure-joker ale-clojure.txt /*ale-clojure-joker* +ale-clojure-options ale-clojure.txt /*ale-clojure-options* +ale-cloudformation-cfn-python-lint ale-cloudformation.txt /*ale-cloudformation-cfn-python-lint* +ale-cloudformation-options ale-cloudformation.txt /*ale-cloudformation-options* +ale-cmake-cmake-lint ale-cmake.txt /*ale-cmake-cmake-lint* +ale-cmake-cmakeformat ale-cmake.txt /*ale-cmake-cmakeformat* +ale-cmake-cmakelint ale-cmake.txt /*ale-cmake-cmakelint* +ale-cmake-options ale-cmake.txt /*ale-cmake-options* +ale-coding-standards ale-development.txt /*ale-coding-standards* +ale-command-format-strings ale.txt /*ale-command-format-strings* +ale-commands ale.txt /*ale-commands* +ale-completion ale.txt /*ale-completion* +ale-completion-completeopt-bug ale.txt /*ale-completion-completeopt-bug* +ale-completion-fallback ale.txt /*ale-completion-fallback* +ale-contact ale.txt /*ale-contact* +ale-contents ale.txt /*ale-contents* +ale-cool-down ale.txt /*ale-cool-down* +ale-cpp-astyle ale-cpp.txt /*ale-cpp-astyle* +ale-cpp-cc ale-cpp.txt /*ale-cpp-cc* +ale-cpp-ccls ale-cpp.txt /*ale-cpp-ccls* +ale-cpp-clang ale-cpp.txt /*ale-cpp-clang* +ale-cpp-clangcheck ale-cpp.txt /*ale-cpp-clangcheck* +ale-cpp-clangd ale-cpp.txt /*ale-cpp-clangd* +ale-cpp-clangformat ale-cpp.txt /*ale-cpp-clangformat* +ale-cpp-clangtidy ale-cpp.txt /*ale-cpp-clangtidy* +ale-cpp-clazy ale-cpp.txt /*ale-cpp-clazy* +ale-cpp-cppcheck ale-cpp.txt /*ale-cpp-cppcheck* +ale-cpp-cpplint ale-cpp.txt /*ale-cpp-cpplint* +ale-cpp-cquery ale-cpp.txt /*ale-cpp-cquery* +ale-cpp-cspell ale-cpp.txt /*ale-cpp-cspell* +ale-cpp-flawfinder ale-cpp.txt /*ale-cpp-flawfinder* +ale-cpp-gcc ale-cpp.txt /*ale-cpp-gcc* +ale-cpp-options ale-cpp.txt /*ale-cpp-options* +ale-cpp-uncrustify ale-cpp.txt /*ale-cpp-uncrustify* +ale-cs-clangformat ale-cs.txt /*ale-cs-clangformat* +ale-cs-csc ale-cs.txt /*ale-cs-csc* +ale-cs-cspell ale-cs.txt /*ale-cs-cspell* +ale-cs-dotnet-format ale-cs.txt /*ale-cs-dotnet-format* +ale-cs-mcs ale-cs.txt /*ale-cs-mcs* +ale-cs-mcsc ale-cs.txt /*ale-cs-mcsc* +ale-cs-options ale-cs.txt /*ale-cs-options* +ale-cs-uncrustify ale-cs.txt /*ale-cs-uncrustify* +ale-cspell-options ale.txt /*ale-cspell-options* +ale-css-cspell ale-css.txt /*ale-css-cspell* +ale-css-css-beautify ale-css.txt /*ale-css-css-beautify* +ale-css-fecs ale-css.txt /*ale-css-fecs* +ale-css-options ale-css.txt /*ale-css-options* +ale-css-prettier ale-css.txt /*ale-css-prettier* +ale-css-stylelint ale-css.txt /*ale-css-stylelint* +ale-css-vscode ale-css.txt /*ale-css-vscode* +ale-cuda-clangd ale-cuda.txt /*ale-cuda-clangd* +ale-cuda-clangformat ale-cuda.txt /*ale-cuda-clangformat* +ale-cuda-nvcc ale-cuda.txt /*ale-cuda-nvcc* +ale-cuda-options ale-cuda.txt /*ale-cuda-options* +ale-d-dfmt ale-d.txt /*ale-d-dfmt* +ale-d-dls ale-d.txt /*ale-d-dls* +ale-d-options ale-d.txt /*ale-d-options* +ale-d-uncrustify ale-d.txt /*ale-d-uncrustify* +ale-dafny-dafny ale-dafny.txt /*ale-dafny-dafny* +ale-dafny-options ale-dafny.txt /*ale-dafny-options* +ale-dart-analysis_server ale-dart.txt /*ale-dart-analysis_server* +ale-dart-analyze ale-dart.txt /*ale-dart-analyze* +ale-dart-dartfmt ale-dart.txt /*ale-dart-dartfmt* +ale-dart-format ale-dart.txt /*ale-dart-format* +ale-dart-options ale-dart.txt /*ale-dart-options* +ale-deoplete-integration ale.txt /*ale-deoplete-integration* +ale-design-goals ale-development.txt /*ale-design-goals* +ale-desktop-desktop-file-validate ale-desktop.txt /*ale-desktop-desktop-file-validate* +ale-desktop-options ale-desktop.txt /*ale-desktop-options* +ale-dev ale-development.txt /*ale-dev* +ale-dev-tests ale-development.txt /*ale-dev-tests* +ale-development ale-development.txt /*ale-development* +ale-development-contents ale-development.txt /*ale-development-contents* +ale-development-contributing ale-development.txt /*ale-development-contributing* +ale-development-fixer-tests ale-development.txt /*ale-development-fixer-tests* +ale-development-introduction ale-development.txt /*ale-development-introduction* +ale-development-linter-tests ale-development.txt /*ale-development-linter-tests* +ale-development-release ale-development.txt /*ale-development-release* +ale-development-tests ale-development.txt /*ale-development-tests* +ale-development-windows-tests ale-development.txt /*ale-development-windows-tests* +ale-development.txt ale-development.txt /*ale-development.txt* +ale-dhall-format ale-dhall.txt /*ale-dhall-format* +ale-dhall-freeze ale-dhall.txt /*ale-dhall-freeze* +ale-dhall-lint ale-dhall.txt /*ale-dhall-lint* +ale-dhall-options ale-dhall.txt /*ale-dhall-options* +ale-dockerfile-dockerfile_lint ale-dockerfile.txt /*ale-dockerfile-dockerfile_lint* +ale-dockerfile-dprint ale-dockerfile.txt /*ale-dockerfile-dprint* +ale-dockerfile-hadolint ale-dockerfile.txt /*ale-dockerfile-hadolint* +ale-dockerfile-options ale-dockerfile.txt /*ale-dockerfile-options* +ale-dprint-options ale.txt /*ale-dprint-options* +ale-elixir-credo ale-elixir.txt /*ale-elixir-credo* +ale-elixir-cspell ale-elixir.txt /*ale-elixir-cspell* +ale-elixir-dialyxir ale-elixir.txt /*ale-elixir-dialyxir* +ale-elixir-elixir-ls ale-elixir.txt /*ale-elixir-elixir-ls* +ale-elixir-mix ale-elixir.txt /*ale-elixir-mix* +ale-elixir-mix-format ale-elixir.txt /*ale-elixir-mix-format* +ale-elixir-options ale-elixir.txt /*ale-elixir-options* +ale-elm-elm-format ale-elm.txt /*ale-elm-elm-format* +ale-elm-elm-ls ale-elm.txt /*ale-elm-elm-ls* +ale-elm-elm-make ale-elm.txt /*ale-elm-elm-make* +ale-elm-options ale-elm.txt /*ale-elm-options* +ale-erlang-dialyzer ale-erlang.txt /*ale-erlang-dialyzer* +ale-erlang-elvis ale-erlang.txt /*ale-erlang-elvis* +ale-erlang-erlang_ls ale-erlang.txt /*ale-erlang-erlang_ls* +ale-erlang-erlc ale-erlang.txt /*ale-erlang-erlc* +ale-erlang-erlfmt ale-erlang.txt /*ale-erlang-erlfmt* +ale-erlang-options ale-erlang.txt /*ale-erlang-options* +ale-erlang-syntaxerl ale-erlang.txt /*ale-erlang-syntaxerl* +ale-eruby-erblint ale-eruby.txt /*ale-eruby-erblint* +ale-eruby-options ale-eruby.txt /*ale-eruby-options* +ale-eruby-ruumba ale-eruby.txt /*ale-eruby-ruumba* +ale-eslint-nested-configuration-files ale-javascript.txt /*ale-eslint-nested-configuration-files* +ale-find-references ale.txt /*ale-find-references* +ale-fish-fish_indent ale-fish.txt /*ale-fish-fish_indent* +ale-fish-options ale-fish.txt /*ale-fish-options* +ale-fix ale.txt /*ale-fix* +ale-fix-configuration ale.txt /*ale-fix-configuration* +ale-fortran-gcc ale-fortran.txt /*ale-fortran-gcc* +ale-fortran-language-server ale-fortran.txt /*ale-fortran-language-server* +ale-fortran-options ale-fortran.txt /*ale-fortran-options* +ale-fountain-options ale-fountain.txt /*ale-fountain-options* +ale-fuse-fusionlint ale-fuse.txt /*ale-fuse-fusionlint* +ale-fuse-options ale-fuse.txt /*ale-fuse-options* +ale-gitcommit-gitlint ale-gitcommit.txt /*ale-gitcommit-gitlint* +ale-gitcommit-options ale-gitcommit.txt /*ale-gitcommit-options* +ale-glsl-glslang ale-glsl.txt /*ale-glsl-glslang* +ale-glsl-glslls ale-glsl.txt /*ale-glsl-glslls* +ale-glsl-options ale-glsl.txt /*ale-glsl-options* +ale-go-bingo ale-go.txt /*ale-go-bingo* +ale-go-cspell ale-go.txt /*ale-go-cspell* +ale-go-gobuild ale-go.txt /*ale-go-gobuild* +ale-go-gofmt ale-go.txt /*ale-go-gofmt* +ale-go-gofumpt ale-go.txt /*ale-go-gofumpt* +ale-go-golangci-lint ale-go.txt /*ale-go-golangci-lint* +ale-go-golangserver ale-go.txt /*ale-go-golangserver* +ale-go-golines ale-go.txt /*ale-go-golines* +ale-go-golint ale-go.txt /*ale-go-golint* +ale-go-gometalinter ale-go.txt /*ale-go-gometalinter* +ale-go-gopls ale-go.txt /*ale-go-gopls* +ale-go-govet ale-go.txt /*ale-go-govet* +ale-go-options ale-go.txt /*ale-go-options* +ale-go-revive ale-go.txt /*ale-go-revive* +ale-go-staticcheck ale-go.txt /*ale-go-staticcheck* +ale-go-to-definition ale.txt /*ale-go-to-definition* +ale-go-to-implementation ale.txt /*ale-go-to-implementation* +ale-go-to-type-definition ale.txt /*ale-go-to-type-definition* +ale-graphql-eslint ale-graphql.txt /*ale-graphql-eslint* +ale-graphql-gqlint ale-graphql.txt /*ale-graphql-gqlint* +ale-graphql-options ale-graphql.txt /*ale-graphql-options* +ale-graphql-prettier ale-graphql.txt /*ale-graphql-prettier* +ale-hack-hack ale-hack.txt /*ale-hack-hack* +ale-hack-hackfmt ale-hack.txt /*ale-hack-hackfmt* +ale-hack-hhast ale-hack.txt /*ale-hack-hhast* +ale-hack-options ale-hack.txt /*ale-hack-options* +ale-handlebars-embertemplatelint ale-handlebars.txt /*ale-handlebars-embertemplatelint* +ale-handlebars-options ale-handlebars.txt /*ale-handlebars-options* +ale-handlebars-prettier ale-handlebars.txt /*ale-handlebars-prettier* +ale-haskell-brittany ale-haskell.txt /*ale-haskell-brittany* +ale-haskell-cabal-ghc ale-haskell.txt /*ale-haskell-cabal-ghc* +ale-haskell-cspell ale-haskell.txt /*ale-haskell-cspell* +ale-haskell-floskell ale-haskell.txt /*ale-haskell-floskell* +ale-haskell-ghc ale-haskell.txt /*ale-haskell-ghc* +ale-haskell-ghc-mod ale-haskell.txt /*ale-haskell-ghc-mod* +ale-haskell-hdevtools ale-haskell.txt /*ale-haskell-hdevtools* +ale-haskell-hfmt ale-haskell.txt /*ale-haskell-hfmt* +ale-haskell-hie ale-haskell.txt /*ale-haskell-hie* +ale-haskell-hindent ale-haskell.txt /*ale-haskell-hindent* +ale-haskell-hlint ale-haskell.txt /*ale-haskell-hlint* +ale-haskell-hls ale-haskell.txt /*ale-haskell-hls* +ale-haskell-options ale-haskell.txt /*ale-haskell-options* +ale-haskell-ormolu ale-haskell.txt /*ale-haskell-ormolu* +ale-haskell-stack-build ale-haskell.txt /*ale-haskell-stack-build* +ale-haskell-stack-ghc ale-haskell.txt /*ale-haskell-stack-ghc* +ale-haskell-stylish-haskell ale-haskell.txt /*ale-haskell-stylish-haskell* +ale-hcl-options ale-hcl.txt /*ale-hcl-options* +ale-hcl-packer-fmt ale-hcl.txt /*ale-hcl-packer-fmt* +ale-hcl-terraform-fmt ale-hcl.txt /*ale-hcl-terraform-fmt* +ale-help-cspell ale-help.txt /*ale-help-cspell* +ale-help-options ale-help.txt /*ale-help-options* +ale-highlights ale.txt /*ale-highlights* +ale-hover ale.txt /*ale-hover* +ale-html-angular ale-html.txt /*ale-html-angular* +ale-html-beautify ale-html.txt /*ale-html-beautify* +ale-html-cspell ale-html.txt /*ale-html-cspell* +ale-html-fecs ale-html.txt /*ale-html-fecs* +ale-html-htmlhint ale-html.txt /*ale-html-htmlhint* +ale-html-options ale-html.txt /*ale-html-options* +ale-html-prettier ale-html.txt /*ale-html-prettier* +ale-html-stylelint ale-html.txt /*ale-html-stylelint* +ale-html-tidy ale-html.txt /*ale-html-tidy* +ale-html-vscode ale-html.txt /*ale-html-vscode* +ale-html-write-good ale-html.txt /*ale-html-write-good* +ale-idris-idris ale-idris.txt /*ale-idris-idris* +ale-idris-options ale-idris.txt /*ale-idris-options* +ale-ink-language-server ale-ink.txt /*ale-ink-language-server* +ale-ink-options ale-ink.txt /*ale-ink-options* +ale-inko-inko ale-inko.txt /*ale-inko-inko* +ale-inko-options ale-inko.txt /*ale-inko-options* +ale-integration-glsl ale-glsl.txt /*ale-integration-glsl* +ale-integration-hack ale-hack.txt /*ale-integration-hack* +ale-integration-inko ale-inko.txt /*ale-integration-inko* +ale-integration-kotlin ale-kotlin.txt /*ale-integration-kotlin* +ale-integration-options ale.txt /*ale-integration-options* +ale-integration-rust ale-rust.txt /*ale-integration-rust* +ale-integration-spec ale-spec.txt /*ale-integration-spec* +ale-integration-zeek ale-zeek.txt /*ale-integration-zeek* +ale-integration-zig ale-zig.txt /*ale-integration-zig* +ale-integrations-local-executables ale.txt /*ale-integrations-local-executables* +ale-introduction ale.txt /*ale-introduction* +ale-ispc-ispc ale-ispc.txt /*ale-ispc-ispc* +ale-ispc-options ale-ispc.txt /*ale-ispc-options* +ale-java-checkstyle ale-java.txt /*ale-java-checkstyle* +ale-java-clangformat ale-java.txt /*ale-java-clangformat* +ale-java-cspell ale-java.txt /*ale-java-cspell* +ale-java-eclipselsp ale-java.txt /*ale-java-eclipselsp* +ale-java-google-java-format ale-java.txt /*ale-java-google-java-format* +ale-java-javac ale-java.txt /*ale-java-javac* +ale-java-javalsp ale-java.txt /*ale-java-javalsp* +ale-java-options ale-java.txt /*ale-java-options* +ale-java-pmd ale-java.txt /*ale-java-pmd* +ale-java-uncrustify ale-java.txt /*ale-java-uncrustify* +ale-javascript-clangformat ale-javascript.txt /*ale-javascript-clangformat* +ale-javascript-cspell ale-javascript.txt /*ale-javascript-cspell* +ale-javascript-deno ale-javascript.txt /*ale-javascript-deno* +ale-javascript-dprint ale-javascript.txt /*ale-javascript-dprint* +ale-javascript-eslint ale-javascript.txt /*ale-javascript-eslint* +ale-javascript-fecs ale-javascript.txt /*ale-javascript-fecs* +ale-javascript-flow ale-javascript.txt /*ale-javascript-flow* +ale-javascript-importjs ale-javascript.txt /*ale-javascript-importjs* +ale-javascript-jscs ale-javascript.txt /*ale-javascript-jscs* +ale-javascript-jshint ale-javascript.txt /*ale-javascript-jshint* +ale-javascript-options ale-javascript.txt /*ale-javascript-options* +ale-javascript-prettier ale-javascript.txt /*ale-javascript-prettier* +ale-javascript-prettier-eslint ale-javascript.txt /*ale-javascript-prettier-eslint* +ale-javascript-prettier-standard ale-javascript.txt /*ale-javascript-prettier-standard* +ale-javascript-standard ale-javascript.txt /*ale-javascript-standard* +ale-javascript-xo ale-javascript.txt /*ale-javascript-xo* +ale-json-clangformat ale-json.txt /*ale-json-clangformat* +ale-json-cspell ale-json.txt /*ale-json-cspell* +ale-json-dprint ale-json.txt /*ale-json-dprint* +ale-json-eslint ale-json.txt /*ale-json-eslint* +ale-json-fixjson ale-json.txt /*ale-json-fixjson* +ale-json-jq ale-json.txt /*ale-json-jq* +ale-json-jsonlint ale-json.txt /*ale-json-jsonlint* +ale-json-options ale-json.txt /*ale-json-options* +ale-json-prettier ale-json.txt /*ale-json-prettier* +ale-json-spectral ale-json.txt /*ale-json-spectral* +ale-json-vscode ale-json.txt /*ale-json-vscode* +ale-json5-eslint ale-json5.txt /*ale-json5-eslint* +ale-json5-options ale-json5.txt /*ale-json5-options* +ale-jsonc-eslint ale-jsonc.txt /*ale-jsonc-eslint* +ale-jsonc-options ale-jsonc.txt /*ale-jsonc-options* +ale-jsonnet-jsonnet-lint ale-jsonnet.txt /*ale-jsonnet-jsonnet-lint* +ale-jsonnet-jsonnetfmt ale-jsonnet.txt /*ale-jsonnet-jsonnetfmt* +ale-jsonnet-options ale-jsonnet.txt /*ale-jsonnet-options* +ale-julia-languageserver ale-julia.txt /*ale-julia-languageserver* +ale-julia-options ale-julia.txt /*ale-julia-options* +ale-kotlin-kotlinc ale-kotlin.txt /*ale-kotlin-kotlinc* +ale-kotlin-ktlint ale-kotlin.txt /*ale-kotlin-ktlint* +ale-kotlin-languageserver ale-kotlin.txt /*ale-kotlin-languageserver* +ale-kotlin-options ale-kotlin.txt /*ale-kotlin-options* +ale-languagetool-options ale.txt /*ale-languagetool-options* +ale-latex-cspell ale-latex.txt /*ale-latex-cspell* +ale-latex-options ale-latex.txt /*ale-latex-options* +ale-latex-textlint ale-latex.txt /*ale-latex-textlint* +ale-latex-write-good ale-latex.txt /*ale-latex-write-good* +ale-less-lessc ale-less.txt /*ale-less-lessc* +ale-less-options ale-less.txt /*ale-less-options* +ale-less-prettier ale-less.txt /*ale-less-prettier* +ale-less-stylelint ale-less.txt /*ale-less-stylelint* +ale-lint ale.txt /*ale-lint* +ale-lint-file ale.txt /*ale-lint-file* +ale-lint-file-linters ale.txt /*ale-lint-file-linters* +ale-lint-language-servers ale.txt /*ale-lint-language-servers* +ale-lint-other-machines ale.txt /*ale-lint-other-machines* +ale-lint-other-sources ale.txt /*ale-lint-other-sources* +ale-lint-settings-on-startup ale.txt /*ale-lint-settings-on-startup* +ale-linter-loading-behavior ale.txt /*ale-linter-loading-behavior* +ale-linting-interrupts-mapping ale.txt /*ale-linting-interrupts-mapping* +ale-llvm-llc ale-llvm.txt /*ale-llvm-llc* +ale-llvm-options ale-llvm.txt /*ale-llvm-options* +ale-loclist-format ale.txt /*ale-loclist-format* +ale-lsp ale.txt /*ale-lsp* +ale-lsp-linters ale.txt /*ale-lsp-linters* +ale-lua-cspell ale-lua.txt /*ale-lua-cspell* +ale-lua-lua-format ale-lua.txt /*ale-lua-lua-format* +ale-lua-luac ale-lua.txt /*ale-lua-luac* +ale-lua-luacheck ale-lua.txt /*ale-lua-luacheck* +ale-lua-luafmt ale-lua.txt /*ale-lua-luafmt* +ale-lua-options ale-lua.txt /*ale-lua-options* +ale-lua-selene ale-lua.txt /*ale-lua-selene* +ale-lua-stylua ale-lua.txt /*ale-lua-stylua* +ale-make-checkmake ale-make.txt /*ale-make-checkmake* +ale-make-options ale-make.txt /*ale-make-options* +ale-markdown-cspell ale-markdown.txt /*ale-markdown-cspell* +ale-markdown-dprint ale-markdown.txt /*ale-markdown-dprint* +ale-markdown-markdownlint ale-markdown.txt /*ale-markdown-markdownlint* +ale-markdown-mdl ale-markdown.txt /*ale-markdown-mdl* +ale-markdown-options ale-markdown.txt /*ale-markdown-options* +ale-markdown-pandoc ale-markdown.txt /*ale-markdown-pandoc* +ale-markdown-prettier ale-markdown.txt /*ale-markdown-prettier* +ale-markdown-remark-lint ale-markdown.txt /*ale-markdown-remark-lint* +ale-markdown-textlint ale-markdown.txt /*ale-markdown-textlint* +ale-markdown-write-good ale-markdown.txt /*ale-markdown-write-good* +ale-mercury-mmc ale-mercury.txt /*ale-mercury-mmc* +ale-mercury-options ale-mercury.txt /*ale-mercury-options* +ale-nasm-nasm ale-nasm.txt /*ale-nasm-nasm* +ale-nasm-options ale-nasm.txt /*ale-nasm-options* +ale-navigation-commands ale.txt /*ale-navigation-commands* +ale-nim-nimcheck ale-nim.txt /*ale-nim-nimcheck* +ale-nim-nimlsp ale-nim.txt /*ale-nim-nimlsp* +ale-nim-nimpretty ale-nim.txt /*ale-nim-nimpretty* +ale-nim-options ale-nim.txt /*ale-nim-options* +ale-nix-nixfmt ale-nix.txt /*ale-nix-nixfmt* +ale-nix-nixpkgs-fmt ale-nix.txt /*ale-nix-nixpkgs-fmt* +ale-nix-options ale-nix.txt /*ale-nix-options* +ale-nix-statix ale-nix.txt /*ale-nix-statix* +ale-nroff-options ale-nroff.txt /*ale-nroff-options* +ale-nroff-write-good ale-nroff.txt /*ale-nroff-write-good* +ale-objc-ccls ale-objc.txt /*ale-objc-ccls* +ale-objc-clang ale-objc.txt /*ale-objc-clang* +ale-objc-clangd ale-objc.txt /*ale-objc-clangd* +ale-objc-clangformat ale-objc.txt /*ale-objc-clangformat* +ale-objc-options ale-objc.txt /*ale-objc-options* +ale-objc-uncrustify ale-objc.txt /*ale-objc-uncrustify* +ale-objcpp-clang ale-objcpp.txt /*ale-objcpp-clang* +ale-objcpp-clangd ale-objcpp.txt /*ale-objcpp-clangd* +ale-objcpp-options ale-objcpp.txt /*ale-objcpp-options* +ale-objcpp-uncrustify ale-objcpp.txt /*ale-objcpp-uncrustify* +ale-ocaml-dune ale-ocaml.txt /*ale-ocaml-dune* +ale-ocaml-merlin ale-ocaml.txt /*ale-ocaml-merlin* +ale-ocaml-ocamlformat ale-ocaml.txt /*ale-ocaml-ocamlformat* +ale-ocaml-ocamllsp ale-ocaml.txt /*ale-ocaml-ocamllsp* +ale-ocaml-ocp-indent ale-ocaml.txt /*ale-ocaml-ocp-indent* +ale-ocaml-ols ale-ocaml.txt /*ale-ocaml-ols* +ale-ocaml-options ale-ocaml.txt /*ale-ocaml-options* +ale-openapi-ibm-validator ale-openapi.txt /*ale-openapi-ibm-validator* +ale-openapi-options ale-openapi.txt /*ale-openapi-options* +ale-openapi-prettier ale-openapi.txt /*ale-openapi-prettier* +ale-openapi-yamllint ale-openapi.txt /*ale-openapi-yamllint* +ale-openscad-options ale-openscad.txt /*ale-openscad-options* +ale-openscad-sca2d ale-openscad.txt /*ale-openscad-sca2d* +ale-options ale.txt /*ale-options* +ale-other-integration-options ale.txt /*ale-other-integration-options* +ale-packer-fmt-fixer ale-packer.txt /*ale-packer-fmt-fixer* +ale-packer-options ale-packer.txt /*ale-packer-options* +ale-pascal-options ale-pascal.txt /*ale-pascal-options* +ale-pascal-ptop ale-pascal.txt /*ale-pascal-ptop* +ale-pawn-options ale-pawn.txt /*ale-pawn-options* +ale-pawn-uncrustify ale-pawn.txt /*ale-pawn-uncrustify* +ale-perl-options ale-perl.txt /*ale-perl-options* +ale-perl-perl ale-perl.txt /*ale-perl-perl* +ale-perl-perlcritic ale-perl.txt /*ale-perl-perlcritic* +ale-perl-perltidy ale-perl.txt /*ale-perl-perltidy* +ale-perl6-options ale-perl6.txt /*ale-perl6-options* +ale-perl6-perl6 ale-perl6.txt /*ale-perl6-perl6* +ale-php-cspell ale-php.txt /*ale-php-cspell* +ale-php-intelephense ale-php.txt /*ale-php-intelephense* +ale-php-langserver ale-php.txt /*ale-php-langserver* +ale-php-options ale-php.txt /*ale-php-options* +ale-php-phan ale-php.txt /*ale-php-phan* +ale-php-php ale-php.txt /*ale-php-php* +ale-php-php-cs-fixer ale-php.txt /*ale-php-php-cs-fixer* +ale-php-phpcbf ale-php.txt /*ale-php-phpcbf* +ale-php-phpcs ale-php.txt /*ale-php-phpcs* +ale-php-phpmd ale-php.txt /*ale-php-phpmd* +ale-php-phpstan ale-php.txt /*ale-php-phpstan* +ale-php-pint ale-php.txt /*ale-php-pint* +ale-php-psalm ale-php.txt /*ale-php-psalm* +ale-php-tlint ale-php.txt /*ale-php-tlint* +ale-po-options ale-po.txt /*ale-po-options* +ale-po-write-good ale-po.txt /*ale-po-write-good* +ale-pod-options ale-pod.txt /*ale-pod-options* +ale-pod-write-good ale-pod.txt /*ale-pod-write-good* +ale-pony-options ale-pony.txt /*ale-pony-options* +ale-pony-ponyc ale-pony.txt /*ale-pony-ponyc* +ale-powershell-cspell ale-powershell.txt /*ale-powershell-cspell* +ale-powershell-options ale-powershell.txt /*ale-powershell-options* +ale-powershell-powershell ale-powershell.txt /*ale-powershell-powershell* +ale-powershell-psscriptanalyzer ale-powershell.txt /*ale-powershell-psscriptanalyzer* +ale-prolog-options ale-prolog.txt /*ale-prolog-options* +ale-prolog-swipl ale-prolog.txt /*ale-prolog-swipl* +ale-proto-buf-format ale-proto.txt /*ale-proto-buf-format* +ale-proto-buf-lint ale-proto.txt /*ale-proto-buf-lint* +ale-proto-clangformat ale-proto.txt /*ale-proto-clangformat* +ale-proto-options ale-proto.txt /*ale-proto-options* +ale-proto-protoc-gen-lint ale-proto.txt /*ale-proto-protoc-gen-lint* +ale-proto-protolint ale-proto.txt /*ale-proto-protolint* +ale-pug-options ale-pug.txt /*ale-pug-options* +ale-pug-puglint ale-pug.txt /*ale-pug-puglint* +ale-puppet-languageserver ale-puppet.txt /*ale-puppet-languageserver* +ale-puppet-options ale-puppet.txt /*ale-puppet-options* +ale-puppet-puppet ale-puppet.txt /*ale-puppet-puppet* +ale-puppet-puppetlint ale-puppet.txt /*ale-puppet-puppetlint* +ale-purescript-language-server ale-purescript.txt /*ale-purescript-language-server* +ale-purescript-options ale-purescript.txt /*ale-purescript-options* +ale-purescript-purty ale-purescript.txt /*ale-purescript-purty* +ale-purescript-tidy ale-purescript.txt /*ale-purescript-tidy* +ale-pyrex-cython ale-pyrex.txt /*ale-pyrex-cython* +ale-pyrex-options ale-pyrex.txt /*ale-pyrex-options* +ale-python-autoflake ale-python.txt /*ale-python-autoflake* +ale-python-autoimport ale-python.txt /*ale-python-autoimport* +ale-python-autopep8 ale-python.txt /*ale-python-autopep8* +ale-python-bandit ale-python.txt /*ale-python-bandit* +ale-python-black ale-python.txt /*ale-python-black* +ale-python-cspell ale-python.txt /*ale-python-cspell* +ale-python-flake8 ale-python.txt /*ale-python-flake8* +ale-python-flakehell ale-python.txt /*ale-python-flakehell* +ale-python-isort ale-python.txt /*ale-python-isort* +ale-python-mypy ale-python.txt /*ale-python-mypy* +ale-python-options ale-python.txt /*ale-python-options* +ale-python-prospector ale-python.txt /*ale-python-prospector* +ale-python-pycodestyle ale-python.txt /*ale-python-pycodestyle* +ale-python-pydocstyle ale-python.txt /*ale-python-pydocstyle* +ale-python-pyflakes ale-python.txt /*ale-python-pyflakes* +ale-python-pyflyby ale-python.txt /*ale-python-pyflyby* +ale-python-pylama ale-python.txt /*ale-python-pylama* +ale-python-pylint ale-python.txt /*ale-python-pylint* +ale-python-pylsp ale-python.txt /*ale-python-pylsp* +ale-python-pyre ale-python.txt /*ale-python-pyre* +ale-python-pyright ale-python.txt /*ale-python-pyright* +ale-python-refurb ale-python.txt /*ale-python-refurb* +ale-python-reorder_python_imports ale-python.txt /*ale-python-reorder_python_imports* +ale-python-root ale-python.txt /*ale-python-root* +ale-python-ruff ale-python.txt /*ale-python-ruff* +ale-python-unimport ale-python.txt /*ale-python-unimport* +ale-python-vulture ale-python.txt /*ale-python-vulture* +ale-python-yapf ale-python.txt /*ale-python-yapf* +ale-qml-options ale-qml.txt /*ale-qml-options* +ale-qml-qmlfmt ale-qml.txt /*ale-qml-qmlfmt* +ale-r-languageserver ale-r.txt /*ale-r-languageserver* +ale-r-lintr ale-r.txt /*ale-r-lintr* +ale-r-options ale-r.txt /*ale-r-options* +ale-r-styler ale-r.txt /*ale-r-styler* +ale-racket-langserver ale-racket.txt /*ale-racket-langserver* +ale-racket-options ale-racket.txt /*ale-racket-options* +ale-racket-raco-fmt ale-racket.txt /*ale-racket-raco-fmt* +ale-reasonml-language-server ale-reasonml.txt /*ale-reasonml-language-server* +ale-reasonml-merlin ale-reasonml.txt /*ale-reasonml-merlin* +ale-reasonml-ols ale-reasonml.txt /*ale-reasonml-ols* +ale-reasonml-options ale-reasonml.txt /*ale-reasonml-options* +ale-reasonml-refmt ale-reasonml.txt /*ale-reasonml-refmt* +ale-refactor ale.txt /*ale-refactor* +ale-rego-cspell ale-rego.txt /*ale-rego-cspell* +ale-rego-opa-check ale-rego.txt /*ale-rego-opa-check* +ale-rego-opa-fmt-fixer ale-rego.txt /*ale-rego-opa-fmt-fixer* +ale-rego-options ale-rego.txt /*ale-rego-options* +ale-restructuredtext-cspell ale-restructuredtext.txt /*ale-restructuredtext-cspell* +ale-restructuredtext-options ale-restructuredtext.txt /*ale-restructuredtext-options* +ale-restructuredtext-textlint ale-restructuredtext.txt /*ale-restructuredtext-textlint* +ale-restructuredtext-write-good ale-restructuredtext.txt /*ale-restructuredtext-write-good* +ale-robot-options ale-robot.txt /*ale-robot-options* +ale-robot-rflint ale-robot.txt /*ale-robot-rflint* +ale-ruby-brakeman ale-ruby.txt /*ale-ruby-brakeman* +ale-ruby-cspell ale-ruby.txt /*ale-ruby-cspell* +ale-ruby-debride ale-ruby.txt /*ale-ruby-debride* +ale-ruby-options ale-ruby.txt /*ale-ruby-options* +ale-ruby-prettier ale-ruby.txt /*ale-ruby-prettier* +ale-ruby-rails_best_practices ale-ruby.txt /*ale-ruby-rails_best_practices* +ale-ruby-reek ale-ruby.txt /*ale-ruby-reek* +ale-ruby-rubocop ale-ruby.txt /*ale-ruby-rubocop* +ale-ruby-ruby ale-ruby.txt /*ale-ruby-ruby* +ale-ruby-rufo ale-ruby.txt /*ale-ruby-rufo* +ale-ruby-solargraph ale-ruby.txt /*ale-ruby-solargraph* +ale-ruby-sorbet ale-ruby.txt /*ale-ruby-sorbet* +ale-ruby-standardrb ale-ruby.txt /*ale-ruby-standardrb* +ale-ruby-syntax_tree ale-ruby.txt /*ale-ruby-syntax_tree* +ale-rust-analyzer ale-rust.txt /*ale-rust-analyzer* +ale-rust-cargo ale-rust.txt /*ale-rust-cargo* +ale-rust-cspell ale-rust.txt /*ale-rust-cspell* +ale-rust-options ale-rust.txt /*ale-rust-options* +ale-rust-rls ale-rust.txt /*ale-rust-rls* +ale-rust-rustc ale-rust.txt /*ale-rust-rustc* +ale-rust-rustfmt ale-rust.txt /*ale-rust-rustfmt* +ale-sass-options ale-sass.txt /*ale-sass-options* +ale-sass-sasslint ale-sass.txt /*ale-sass-sasslint* +ale-sass-stylelint ale-sass.txt /*ale-sass-stylelint* +ale-scala-cspell ale-scala.txt /*ale-scala-cspell* +ale-scala-metals ale-scala.txt /*ale-scala-metals* +ale-scala-options ale-scala.txt /*ale-scala-options* +ale-scala-sbtserver ale-scala.txt /*ale-scala-sbtserver* +ale-scala-scalafmt ale-scala.txt /*ale-scala-scalafmt* +ale-scala-scalastyle ale-scala.txt /*ale-scala-scalastyle* +ale-scss-options ale-scss.txt /*ale-scss-options* +ale-scss-prettier ale-scss.txt /*ale-scss-prettier* +ale-scss-sasslint ale-scss.txt /*ale-scss-sasslint* +ale-scss-stylelint ale-scss.txt /*ale-scss-stylelint* +ale-sh-bashate ale-sh.txt /*ale-sh-bashate* +ale-sh-cspell ale-sh.txt /*ale-sh-cspell* +ale-sh-language-server ale-sh.txt /*ale-sh-language-server* +ale-sh-options ale-sh.txt /*ale-sh-options* +ale-sh-shell ale-sh.txt /*ale-sh-shell* +ale-sh-shellcheck ale-sh.txt /*ale-sh-shellcheck* +ale-sh-shfmt ale-sh.txt /*ale-sh-shfmt* +ale-sml-options ale-sml.txt /*ale-sml-options* +ale-sml-smlnj ale-sml.txt /*ale-sml-smlnj* +ale-sml-smlnj-cm ale-sml.txt /*ale-sml-smlnj-cm* +ale-solidity-options ale-solidity.txt /*ale-solidity-options* +ale-solidity-solc ale-solidity.txt /*ale-solidity-solc* +ale-solidity-solhint ale-solidity.txt /*ale-solidity-solhint* +ale-solidity-solium ale-solidity.txt /*ale-solidity-solium* +ale-spec-options ale-spec.txt /*ale-spec-options* +ale-spec-rpmlint ale-spec.txt /*ale-spec-rpmlint* +ale-special-thanks ale.txt /*ale-special-thanks* +ale-sql-dprint ale-sql.txt /*ale-sql-dprint* +ale-sql-options ale-sql.txt /*ale-sql-options* +ale-sql-pgformatter ale-sql.txt /*ale-sql-pgformatter* +ale-sql-sqlfluff ale-sql.txt /*ale-sql-sqlfluff* +ale-sql-sqlfmt ale-sql.txt /*ale-sql-sqlfmt* +ale-sql-sqlformat ale-sql.txt /*ale-sql-sqlformat* +ale-stylus-options ale-stylus.txt /*ale-stylus-options* +ale-stylus-stylelint ale-stylus.txt /*ale-stylus-stylelint* +ale-sugarss-options ale-sugarss.txt /*ale-sugarss-options* +ale-sugarss-stylelint ale-sugarss.txt /*ale-sugarss-stylelint* +ale-support ale.txt /*ale-support* +ale-supported-languages-and-tools.txt ale-supported-languages-and-tools.txt /*ale-supported-languages-and-tools.txt* +ale-supported-list ale-supported-languages-and-tools.txt /*ale-supported-list* +ale-svelte-options ale-svelte.txt /*ale-svelte-options* +ale-svelte-prettier ale-svelte.txt /*ale-svelte-prettier* +ale-svelte-svelteserver ale-svelte.txt /*ale-svelte-svelteserver* +ale-swift-apple-swift-format ale-swift.txt /*ale-swift-apple-swift-format* +ale-swift-cspell ale-swift.txt /*ale-swift-cspell* +ale-swift-options ale-swift.txt /*ale-swift-options* +ale-swift-sourcekitlsp ale-swift.txt /*ale-swift-sourcekitlsp* +ale-symbol-search ale.txt /*ale-symbol-search* +ale-symbols ale.txt /*ale-symbols* +ale-systemd-analyze ale-systemd.txt /*ale-systemd-analyze* +ale-systemd-options ale-systemd.txt /*ale-systemd-options* +ale-tcl-nagelfar ale-tcl.txt /*ale-tcl-nagelfar* +ale-tcl-options ale-tcl.txt /*ale-tcl-options* +ale-terraform-checkov ale-terraform.txt /*ale-terraform-checkov* +ale-terraform-fmt-fixer ale-terraform.txt /*ale-terraform-fmt-fixer* +ale-terraform-options ale-terraform.txt /*ale-terraform-options* +ale-terraform-terraform ale-terraform.txt /*ale-terraform-terraform* +ale-terraform-terraform-ls ale-terraform.txt /*ale-terraform-terraform-ls* +ale-terraform-terraform-lsp ale-terraform.txt /*ale-terraform-terraform-lsp* +ale-terraform-tflint ale-terraform.txt /*ale-terraform-tflint* +ale-terraform-tfsec ale-terraform.txt /*ale-terraform-tfsec* +ale-tests ale-development.txt /*ale-tests* +ale-tex-chktex ale-tex.txt /*ale-tex-chktex* +ale-tex-cspell ale-tex.txt /*ale-tex-cspell* +ale-tex-lacheck ale-tex.txt /*ale-tex-lacheck* +ale-tex-latexindent ale-tex.txt /*ale-tex-latexindent* +ale-tex-options ale-tex.txt /*ale-tex-options* +ale-tex-texlab ale-tex.txt /*ale-tex-texlab* +ale-texinfo-cspell ale-texinfo.txt /*ale-texinfo-cspell* +ale-texinfo-options ale-texinfo.txt /*ale-texinfo-options* +ale-texinfo-write-good ale-texinfo.txt /*ale-texinfo-write-good* +ale-text-cspell ale-text.txt /*ale-text-cspell* +ale-text-options ale-text.txt /*ale-text-options* +ale-text-textlint ale-text.txt /*ale-text-textlint* +ale-text-write-good ale-text.txt /*ale-text-write-good* +ale-thrift-options ale-thrift.txt /*ale-thrift-options* +ale-thrift-thrift ale-thrift.txt /*ale-thrift-thrift* +ale-thrift-thriftcheck ale-thrift.txt /*ale-thrift-thriftcheck* +ale-toml-dprint ale-toml.txt /*ale-toml-dprint* +ale-toml-options ale-toml.txt /*ale-toml-options* +ale-typescript-cspell ale-typescript.txt /*ale-typescript-cspell* +ale-typescript-deno ale-typescript.txt /*ale-typescript-deno* +ale-typescript-dprint ale-typescript.txt /*ale-typescript-dprint* +ale-typescript-eslint ale-typescript.txt /*ale-typescript-eslint* +ale-typescript-options ale-typescript.txt /*ale-typescript-options* +ale-typescript-prettier ale-typescript.txt /*ale-typescript-prettier* +ale-typescript-standard ale-typescript.txt /*ale-typescript-standard* +ale-typescript-tslint ale-typescript.txt /*ale-typescript-tslint* +ale-typescript-tsserver ale-typescript.txt /*ale-typescript-tsserver* +ale-typescript-xo ale-typescript.txt /*ale-typescript-xo* +ale-v-options ale-v.txt /*ale-v-options* +ale-v-v ale-v.txt /*ale-v-v* +ale-v-vfmt ale-v.txt /*ale-v-vfmt* +ale-vala-options ale-vala.txt /*ale-vala-options* +ale-vala-uncrustify ale-vala.txt /*ale-vala-uncrustify* +ale-vala-vala-lint ale-vala.txt /*ale-vala-vala-lint* +ale-verilog-hdl-checker ale-verilog.txt /*ale-verilog-hdl-checker* +ale-verilog-iverilog ale-verilog.txt /*ale-verilog-iverilog* +ale-verilog-options ale-verilog.txt /*ale-verilog-options* +ale-verilog-verilator ale-verilog.txt /*ale-verilog-verilator* +ale-verilog-vlog ale-verilog.txt /*ale-verilog-vlog* +ale-verilog-xvlog ale-verilog.txt /*ale-verilog-xvlog* +ale-verilog-yosys ale-verilog.txt /*ale-verilog-yosys* +ale-vhdl-ghdl ale-vhdl.txt /*ale-vhdl-ghdl* +ale-vhdl-hdl-checker ale-vhdl.txt /*ale-vhdl-hdl-checker* +ale-vhdl-options ale-vhdl.txt /*ale-vhdl-options* +ale-vhdl-vcom ale-vhdl.txt /*ale-vhdl-vcom* +ale-vhdl-xvhdl ale-vhdl.txt /*ale-vhdl-xvhdl* +ale-vim-help-options ale-vim-help.txt /*ale-vim-help-options* +ale-vim-help-write-good ale-vim-help.txt /*ale-vim-help-write-good* +ale-vim-options ale-vim.txt /*ale-vim-options* +ale-vim-vimls ale-vim.txt /*ale-vim-vimls* +ale-vim-vint ale-vim.txt /*ale-vim-vint* +ale-vue-cspell ale-vue.txt /*ale-vue-cspell* +ale-vue-options ale-vue.txt /*ale-vue-options* +ale-vue-prettier ale-vue.txt /*ale-vue-prettier* +ale-vue-vls ale-vue.txt /*ale-vue-vls* +ale-vue-volar ale-vue.txt /*ale-vue-volar* +ale-wgsl-naga ale-wgsl.txt /*ale-wgsl-naga* +ale-wgsl-options ale-wgsl.txt /*ale-wgsl-options* +ale-write-good-options ale.txt /*ale-write-good-options* +ale-xhtml-cspell ale-xhtml.txt /*ale-xhtml-cspell* +ale-xhtml-options ale-xhtml.txt /*ale-xhtml-options* +ale-xhtml-write-good ale-xhtml.txt /*ale-xhtml-write-good* +ale-xml-options ale-xml.txt /*ale-xml-options* +ale-xml-xmllint ale-xml.txt /*ale-xml-xmllint* +ale-yaml-actionlint ale-yaml.txt /*ale-yaml-actionlint* +ale-yaml-circleci ale-yaml.txt /*ale-yaml-circleci* +ale-yaml-gitlablint ale-yaml.txt /*ale-yaml-gitlablint* +ale-yaml-language-server ale-yaml.txt /*ale-yaml-language-server* +ale-yaml-options ale-yaml.txt /*ale-yaml-options* +ale-yaml-prettier ale-yaml.txt /*ale-yaml-prettier* +ale-yaml-spectral ale-yaml.txt /*ale-yaml-spectral* +ale-yaml-swaglint ale-yaml.txt /*ale-yaml-swaglint* +ale-yaml-yamlfix ale-yaml.txt /*ale-yaml-yamlfix* +ale-yaml-yamllint ale-yaml.txt /*ale-yaml-yamllint* +ale-yang-lsp ale-yang.txt /*ale-yang-lsp* +ale-yang-options ale-yang.txt /*ale-yang-options* +ale-zeek-options ale-zeek.txt /*ale-zeek-options* +ale-zeek-zeek ale-zeek.txt /*ale-zeek-zeek* +ale-zig-options ale-zig.txt /*ale-zig-options* +ale-zig-zigfmt ale-zig.txt /*ale-zig-zigfmt* +ale-zig-zls ale-zig.txt /*ale-zig-zls* +ale.txt ale.txt /*ale.txt* +b:ale-c-flawfinder ale-c.txt /*b:ale-c-flawfinder* +b:ale-cpp-flawfinder ale-cpp.txt /*b:ale-cpp-flawfinder* +b:ale_ada_adals_encoding ale-ada.txt /*b:ale_ada_adals_encoding* +b:ale_ada_adals_executable ale-ada.txt /*b:ale_ada_adals_executable* +b:ale_ada_adals_project ale-ada.txt /*b:ale_ada_adals_project* +b:ale_ada_gcc_executable ale-ada.txt /*b:ale_ada_gcc_executable* +b:ale_ada_gcc_options ale-ada.txt /*b:ale_ada_gcc_options* +b:ale_ada_gnatpp_options ale-ada.txt /*b:ale_ada_gnatpp_options* +b:ale_alex_executable ale.txt /*b:ale_alex_executable* +b:ale_alex_use_global ale.txt /*b:ale_alex_use_global* +b:ale_ansible_ansible_lint_executable ale-ansible.txt /*b:ale_ansible_ansible_lint_executable* +b:ale_ansible_language_server ale-ansible.txt /*b:ale_ansible_language_server* +b:ale_ansible_language_server_config ale-ansible.txt /*b:ale_ansible_language_server_config* +b:ale_apkbuild_apkbuild_lint_executable ale-apkbuild.txt /*b:ale_apkbuild_apkbuild_lint_executable* +b:ale_apkbuild_secfixes_check_executable ale-apkbuild.txt /*b:ale_apkbuild_secfixes_check_executable* +b:ale_asm_gcc_executable ale-asm.txt /*b:ale_asm_gcc_executable* +b:ale_asm_gcc_options ale-asm.txt /*b:ale_asm_gcc_options* +b:ale_avra_avra_executable ale-avra.txt /*b:ale_avra_avra_executable* +b:ale_avra_avra_options ale-avra.txt /*b:ale_avra_avra_options* +b:ale_awk_gawk_executable ale-awk.txt /*b:ale_awk_gawk_executable* +b:ale_awk_gawk_options ale-awk.txt /*b:ale_awk_gawk_options* +b:ale_bazel_buildifier_executable ale-bazel.txt /*b:ale_bazel_buildifier_executable* +b:ale_bazel_buildifier_options ale-bazel.txt /*b:ale_bazel_buildifier_options* +b:ale_bazel_buildifier_use_global ale-bazel.txt /*b:ale_bazel_buildifier_use_global* +b:ale_bicep_bicep_executable ale-bicep.txt /*b:ale_bicep_bicep_executable* +b:ale_bicep_bicep_options ale-bicep.txt /*b:ale_bicep_bicep_options* +b:ale_c_always_make ale-c.txt /*b:ale_c_always_make* +b:ale_c_astyle_executable ale-c.txt /*b:ale_c_astyle_executable* +b:ale_c_astyle_project_options ale-c.txt /*b:ale_c_astyle_project_options* +b:ale_c_build_dir ale-c.txt /*b:ale_c_build_dir* +b:ale_c_build_dir_names ale-c.txt /*b:ale_c_build_dir_names* +b:ale_c_cc_executable ale-c.txt /*b:ale_c_cc_executable* +b:ale_c_cc_header_exts ale-c.txt /*b:ale_c_cc_header_exts* +b:ale_c_cc_options ale-c.txt /*b:ale_c_cc_options* +b:ale_c_cc_use_header_lang_flag ale-c.txt /*b:ale_c_cc_use_header_lang_flag* +b:ale_c_ccls_executable ale-c.txt /*b:ale_c_ccls_executable* +b:ale_c_ccls_init_options ale-c.txt /*b:ale_c_ccls_init_options* +b:ale_c_clangd_executable ale-c.txt /*b:ale_c_clangd_executable* +b:ale_c_clangd_options ale-c.txt /*b:ale_c_clangd_options* +b:ale_c_clangformat_executable ale-c.txt /*b:ale_c_clangformat_executable* +b:ale_c_clangformat_options ale-c.txt /*b:ale_c_clangformat_options* +b:ale_c_clangformat_style_option ale-c.txt /*b:ale_c_clangformat_style_option* +b:ale_c_clangformat_use_local_file ale-c.txt /*b:ale_c_clangformat_use_local_file* +b:ale_c_clangtidy_checks ale-c.txt /*b:ale_c_clangtidy_checks* +b:ale_c_clangtidy_executable ale-c.txt /*b:ale_c_clangtidy_executable* +b:ale_c_clangtidy_extra_options ale-c.txt /*b:ale_c_clangtidy_extra_options* +b:ale_c_clangtidy_fix_errors ale-c.txt /*b:ale_c_clangtidy_fix_errors* +b:ale_c_clangtidy_options ale-c.txt /*b:ale_c_clangtidy_options* +b:ale_c_cppcheck_executable ale-c.txt /*b:ale_c_cppcheck_executable* +b:ale_c_cppcheck_options ale-c.txt /*b:ale_c_cppcheck_options* +b:ale_c_cpplint_executable ale-cpp.txt /*b:ale_c_cpplint_executable* +b:ale_c_cpplint_options ale-cpp.txt /*b:ale_c_cpplint_options* +b:ale_c_cquery_cache_directory ale-c.txt /*b:ale_c_cquery_cache_directory* +b:ale_c_cquery_executable ale-c.txt /*b:ale_c_cquery_executable* +b:ale_c_flawfinder_error_severity ale-c.txt /*b:ale_c_flawfinder_error_severity* +b:ale_c_flawfinder_executable ale-c.txt /*b:ale_c_flawfinder_executable* +b:ale_c_flawfinder_minlevel ale-c.txt /*b:ale_c_flawfinder_minlevel* +b:ale_c_parse_compile_commands ale-c.txt /*b:ale_c_parse_compile_commands* +b:ale_c_parse_makefile ale-c.txt /*b:ale_c_parse_makefile* +b:ale_c_uncrustify_executable ale-c.txt /*b:ale_c_uncrustify_executable* +b:ale_c_uncrustify_options ale-c.txt /*b:ale_c_uncrustify_options* +b:ale_cairo_starknet_executable ale-cairo.txt /*b:ale_cairo_starknet_executable* +b:ale_chef_cookstyle_executable ale-chef.txt /*b:ale_chef_cookstyle_executable* +b:ale_chef_cookstyle_options ale-chef.txt /*b:ale_chef_cookstyle_options* +b:ale_chef_foodcritic_executable ale-chef.txt /*b:ale_chef_foodcritic_executable* +b:ale_chef_foodcritic_options ale-chef.txt /*b:ale_chef_foodcritic_options* +b:ale_clojure_clj_kondo_options ale-clojure.txt /*b:ale_clojure_clj_kondo_options* +b:ale_cmake_cmake_lint_executable ale-cmake.txt /*b:ale_cmake_cmake_lint_executable* +b:ale_cmake_cmake_lint_options ale-cmake.txt /*b:ale_cmake_cmake_lint_options* +b:ale_cmake_cmakeformat_executable ale-cmake.txt /*b:ale_cmake_cmakeformat_executable* +b:ale_cmake_cmakeformat_options ale-cmake.txt /*b:ale_cmake_cmakeformat_options* +b:ale_cmake_cmakelint_executable ale-cmake.txt /*b:ale_cmake_cmakelint_executable* +b:ale_cmake_cmakelint_options ale-cmake.txt /*b:ale_cmake_cmakelint_options* +b:ale_command_wrapper ale.txt /*b:ale_command_wrapper* +b:ale_completion_enabled ale.txt /*b:ale_completion_enabled* +b:ale_completion_excluded_words ale.txt /*b:ale_completion_excluded_words* +b:ale_cpp_astyle_executable ale-cpp.txt /*b:ale_cpp_astyle_executable* +b:ale_cpp_astyle_project_options ale-cpp.txt /*b:ale_cpp_astyle_project_options* +b:ale_cpp_cc_executable ale-cpp.txt /*b:ale_cpp_cc_executable* +b:ale_cpp_cc_header_exts ale-cpp.txt /*b:ale_cpp_cc_header_exts* +b:ale_cpp_cc_options ale-cpp.txt /*b:ale_cpp_cc_options* +b:ale_cpp_cc_use_header_lang_flag ale-cpp.txt /*b:ale_cpp_cc_use_header_lang_flag* +b:ale_cpp_ccls_executable ale-cpp.txt /*b:ale_cpp_ccls_executable* +b:ale_cpp_ccls_init_options ale-cpp.txt /*b:ale_cpp_ccls_init_options* +b:ale_cpp_clangcheck_executable ale-cpp.txt /*b:ale_cpp_clangcheck_executable* +b:ale_cpp_clangcheck_options ale-cpp.txt /*b:ale_cpp_clangcheck_options* +b:ale_cpp_clangd_executable ale-cpp.txt /*b:ale_cpp_clangd_executable* +b:ale_cpp_clangd_options ale-cpp.txt /*b:ale_cpp_clangd_options* +b:ale_cpp_clangtidy_checks ale-cpp.txt /*b:ale_cpp_clangtidy_checks* +b:ale_cpp_clangtidy_executable ale-cpp.txt /*b:ale_cpp_clangtidy_executable* +b:ale_cpp_clangtidy_extra_options ale-cpp.txt /*b:ale_cpp_clangtidy_extra_options* +b:ale_cpp_clangtidy_fix_errors ale-cpp.txt /*b:ale_cpp_clangtidy_fix_errors* +b:ale_cpp_clangtidy_options ale-cpp.txt /*b:ale_cpp_clangtidy_options* +b:ale_cpp_clazy_checks ale-cpp.txt /*b:ale_cpp_clazy_checks* +b:ale_cpp_clazy_executable ale-cpp.txt /*b:ale_cpp_clazy_executable* +b:ale_cpp_clazy_options ale-cpp.txt /*b:ale_cpp_clazy_options* +b:ale_cpp_cppcheck_executable ale-cpp.txt /*b:ale_cpp_cppcheck_executable* +b:ale_cpp_cppcheck_options ale-cpp.txt /*b:ale_cpp_cppcheck_options* +b:ale_cpp_cpplint_executable ale-cpp.txt /*b:ale_cpp_cpplint_executable* +b:ale_cpp_cpplint_options ale-cpp.txt /*b:ale_cpp_cpplint_options* +b:ale_cpp_cquery_cache_directory ale-cpp.txt /*b:ale_cpp_cquery_cache_directory* +b:ale_cpp_cquery_executable ale-cpp.txt /*b:ale_cpp_cquery_executable* +b:ale_cpp_flawfinder_executable ale-cpp.txt /*b:ale_cpp_flawfinder_executable* +b:ale_cpp_flawfinder_minlevel ale-cpp.txt /*b:ale_cpp_flawfinder_minlevel* +b:ale_cs_csc_assemblies ale-cs.txt /*b:ale_cs_csc_assemblies* +b:ale_cs_csc_assembly_path ale-cs.txt /*b:ale_cs_csc_assembly_path* +b:ale_cs_csc_options ale-cs.txt /*b:ale_cs_csc_options* +b:ale_cs_csc_source ale-cs.txt /*b:ale_cs_csc_source* +b:ale_cs_dotnet_format_executable ale-cs.txt /*b:ale_cs_dotnet_format_executable* +b:ale_cs_dotnet_format_options ale-cs.txt /*b:ale_cs_dotnet_format_options* +b:ale_cs_mcs_options ale-cs.txt /*b:ale_cs_mcs_options* +b:ale_cs_mcsc_assemblies ale-cs.txt /*b:ale_cs_mcsc_assemblies* +b:ale_cs_mcsc_assembly_path ale-cs.txt /*b:ale_cs_mcsc_assembly_path* +b:ale_cs_mcsc_options ale-cs.txt /*b:ale_cs_mcsc_options* +b:ale_cs_mcsc_source ale-cs.txt /*b:ale_cs_mcsc_source* +b:ale_cspell_executable ale.txt /*b:ale_cspell_executable* +b:ale_cspell_options ale.txt /*b:ale_cspell_options* +b:ale_cspell_use_global ale.txt /*b:ale_cspell_use_global* +b:ale_css_css_beautify_executable ale-css.txt /*b:ale_css_css_beautify_executable* +b:ale_css_css_beautify_options ale-css.txt /*b:ale_css_css_beautify_options* +b:ale_css_css_beautify_use_global ale-css.txt /*b:ale_css_css_beautify_use_global* +b:ale_css_stylelint_executable ale-css.txt /*b:ale_css_stylelint_executable* +b:ale_css_stylelint_options ale-css.txt /*b:ale_css_stylelint_options* +b:ale_css_stylelint_use_global ale-css.txt /*b:ale_css_stylelint_use_global* +b:ale_cuda_clangd_executable ale-cuda.txt /*b:ale_cuda_clangd_executable* +b:ale_cuda_clangd_options ale-cuda.txt /*b:ale_cuda_clangd_options* +b:ale_cuda_nvcc_executable ale-cuda.txt /*b:ale_cuda_nvcc_executable* +b:ale_cuda_nvcc_options ale-cuda.txt /*b:ale_cuda_nvcc_options* +b:ale_d_dfmt_options ale-d.txt /*b:ale_d_dfmt_options* +b:ale_d_dls_executable ale-d.txt /*b:ale_d_dls_executable* +b:ale_dafny_dafny_timelimit ale-dafny.txt /*b:ale_dafny_dafny_timelimit* +b:ale_dart_analysis_server_executable ale-dart.txt /*b:ale_dart_analysis_server_executable* +b:ale_dart_analyze_executable ale-dart.txt /*b:ale_dart_analyze_executable* +b:ale_dart_dartfmt_executable ale-dart.txt /*b:ale_dart_dartfmt_executable* +b:ale_dart_dartfmt_options ale-dart.txt /*b:ale_dart_dartfmt_options* +b:ale_dart_format_executable ale-dart.txt /*b:ale_dart_format_executable* +b:ale_dart_format_options ale-dart.txt /*b:ale_dart_format_options* +b:ale_default_navigation ale.txt /*b:ale_default_navigation* +b:ale_deno_executable ale-typescript.txt /*b:ale_deno_executable* +b:ale_deno_importMap ale-typescript.txt /*b:ale_deno_importMap* +b:ale_deno_lsp_project_root ale-typescript.txt /*b:ale_deno_lsp_project_root* +b:ale_deno_unstable ale-typescript.txt /*b:ale_deno_unstable* +b:ale_desktop_desktop_file_validate_options ale-desktop.txt /*b:ale_desktop_desktop_file_validate_options* +b:ale_detail_to_floating_preview ale.txt /*b:ale_detail_to_floating_preview* +b:ale_dhall_executable ale-dhall.txt /*b:ale_dhall_executable* +b:ale_dhall_freeze_options ale-dhall.txt /*b:ale_dhall_freeze_options* +b:ale_dhall_options ale-dhall.txt /*b:ale_dhall_options* +b:ale_disable_lsp ale.txt /*b:ale_disable_lsp* +b:ale_dockerfile_dockerfile_lint_executable ale-dockerfile.txt /*b:ale_dockerfile_dockerfile_lint_executable* +b:ale_dockerfile_dockerfile_lint_options ale-dockerfile.txt /*b:ale_dockerfile_dockerfile_lint_options* +b:ale_dockerfile_hadolint_image ale-dockerfile.txt /*b:ale_dockerfile_hadolint_image* +b:ale_dockerfile_hadolint_options ale-dockerfile.txt /*b:ale_dockerfile_hadolint_options* +b:ale_dockerfile_hadolint_use_docker ale-dockerfile.txt /*b:ale_dockerfile_hadolint_use_docker* +b:ale_dprint_config ale.txt /*b:ale_dprint_config* +b:ale_dprint_executable ale.txt /*b:ale_dprint_executable* +b:ale_dprint_options ale.txt /*b:ale_dprint_options* +b:ale_dprint_use_global ale.txt /*b:ale_dprint_use_global* +b:ale_echo_delay ale.txt /*b:ale_echo_delay* +b:ale_echo_msg_format ale.txt /*b:ale_echo_msg_format* +b:ale_elixir_elixir_ls_config ale-elixir.txt /*b:ale_elixir_elixir_ls_config* +b:ale_elixir_elixir_ls_release ale-elixir.txt /*b:ale_elixir_elixir_ls_release* +b:ale_elixir_mix_format_options ale-elixir.txt /*b:ale_elixir_mix_format_options* +b:ale_elixir_mix_options ale-elixir.txt /*b:ale_elixir_mix_options* +b:ale_elm_format_executable ale-elm.txt /*b:ale_elm_format_executable* +b:ale_elm_format_options ale-elm.txt /*b:ale_elm_format_options* +b:ale_elm_format_use_global ale-elm.txt /*b:ale_elm_format_use_global* +b:ale_elm_ls_elm_analyse_trigger ale-elm.txt /*b:ale_elm_ls_elm_analyse_trigger* +b:ale_elm_ls_elm_format_path ale-elm.txt /*b:ale_elm_ls_elm_format_path* +b:ale_elm_ls_elm_path ale-elm.txt /*b:ale_elm_ls_elm_path* +b:ale_elm_ls_elm_test_path ale-elm.txt /*b:ale_elm_ls_elm_test_path* +b:ale_elm_ls_executable ale-elm.txt /*b:ale_elm_ls_executable* +b:ale_elm_ls_use_global ale-elm.txt /*b:ale_elm_ls_use_global* +b:ale_elm_make_executable ale-elm.txt /*b:ale_elm_make_executable* +b:ale_elm_make_use_global ale-elm.txt /*b:ale_elm_make_use_global* +b:ale_enabled ale.txt /*b:ale_enabled* +b:ale_erlang_dialyzer_executable ale-erlang.txt /*b:ale_erlang_dialyzer_executable* +b:ale_erlang_dialyzer_options ale-erlang.txt /*b:ale_erlang_dialyzer_options* +b:ale_erlang_dialyzer_plt_file ale-erlang.txt /*b:ale_erlang_dialyzer_plt_file* +b:ale_erlang_dialyzer_rebar3_profile ale-erlang.txt /*b:ale_erlang_dialyzer_rebar3_profile* +b:ale_erlang_elvis_executable ale-erlang.txt /*b:ale_erlang_elvis_executable* +b:ale_erlang_erlang_ls_executable ale-erlang.txt /*b:ale_erlang_erlang_ls_executable* +b:ale_erlang_erlang_ls_log_dir ale-erlang.txt /*b:ale_erlang_erlang_ls_log_dir* +b:ale_erlang_erlang_ls_log_level ale-erlang.txt /*b:ale_erlang_erlang_ls_log_level* +b:ale_erlang_erlc_executable ale-erlang.txt /*b:ale_erlang_erlc_executable* +b:ale_erlang_erlc_options ale-erlang.txt /*b:ale_erlang_erlc_options* +b:ale_erlang_erlfmt_executable ale-erlang.txt /*b:ale_erlang_erlfmt_executable* +b:ale_erlang_erlfmt_options ale-erlang.txt /*b:ale_erlang_erlfmt_options* +b:ale_erlang_syntaxerl_executable ale-erlang.txt /*b:ale_erlang_syntaxerl_executable* +b:ale_eruby_erblint_executable ale-eruby.txt /*b:ale_eruby_erblint_executable* +b:ale_eruby_ruumba_executable ale-eruby.txt /*b:ale_eruby_ruumba_executable* +b:ale_exclude_highlights ale.txt /*b:ale_exclude_highlights* +b:ale_filename_mappings ale.txt /*b:ale_filename_mappings* +b:ale_fish_fish_indent_executable ale-fish.txt /*b:ale_fish_fish_indent_executable* +b:ale_fish_fish_indent_options ale-fish.txt /*b:ale_fish_fish_indent_options* +b:ale_fix_on_save ale.txt /*b:ale_fix_on_save* +b:ale_fix_on_save_ignore ale.txt /*b:ale_fix_on_save_ignore* +b:ale_fixers ale.txt /*b:ale_fixers* +b:ale_fortran_gcc_executable ale-fortran.txt /*b:ale_fortran_gcc_executable* +b:ale_fortran_gcc_options ale-fortran.txt /*b:ale_fortran_gcc_options* +b:ale_fortran_gcc_use_free_form ale-fortran.txt /*b:ale_fortran_gcc_use_free_form* +b:ale_fortran_language_server_executable ale-fortran.txt /*b:ale_fortran_language_server_executable* +b:ale_fortran_language_server_use_global ale-fortran.txt /*b:ale_fortran_language_server_use_global* +b:ale_fuse_fusionlint_executable ale-fuse.txt /*b:ale_fuse_fusionlint_executable* +b:ale_fuse_fusionlint_options ale-fuse.txt /*b:ale_fuse_fusionlint_options* +b:ale_gitcommit_gitlint_executable ale-gitcommit.txt /*b:ale_gitcommit_gitlint_executable* +b:ale_gitcommit_gitlint_options ale-gitcommit.txt /*b:ale_gitcommit_gitlint_options* +b:ale_gitcommit_gitlint_use_global ale-gitcommit.txt /*b:ale_gitcommit_gitlint_use_global* +b:ale_glsl_glslang_executable ale-glsl.txt /*b:ale_glsl_glslang_executable* +b:ale_glsl_glslang_options ale-glsl.txt /*b:ale_glsl_glslang_options* +b:ale_glsl_glslls_executable ale-glsl.txt /*b:ale_glsl_glslls_executable* +b:ale_glsl_glslls_logfile ale-glsl.txt /*b:ale_glsl_glslls_logfile* +b:ale_go_bingo_executable ale-go.txt /*b:ale_go_bingo_executable* +b:ale_go_bingo_options ale-go.txt /*b:ale_go_bingo_options* +b:ale_go_go111module ale-go.txt /*b:ale_go_go111module* +b:ale_go_go_executable ale-go.txt /*b:ale_go_go_executable* +b:ale_go_gobuild_options ale-go.txt /*b:ale_go_gobuild_options* +b:ale_go_gofmt_options ale-go.txt /*b:ale_go_gofmt_options* +b:ale_go_gofumpt_executable ale-go.txt /*b:ale_go_gofumpt_executable* +b:ale_go_gofumpt_options ale-go.txt /*b:ale_go_gofumpt_options* +b:ale_go_golangci_lint_executable ale-go.txt /*b:ale_go_golangci_lint_executable* +b:ale_go_golangci_lint_options ale-go.txt /*b:ale_go_golangci_lint_options* +b:ale_go_golangci_lint_package ale-go.txt /*b:ale_go_golangci_lint_package* +b:ale_go_golines_options ale-go.txt /*b:ale_go_golines_options* +b:ale_go_golint_executable ale-go.txt /*b:ale_go_golint_executable* +b:ale_go_golint_options ale-go.txt /*b:ale_go_golint_options* +b:ale_go_gometalinter_executable ale-go.txt /*b:ale_go_gometalinter_executable* +b:ale_go_gometalinter_lint_package ale-go.txt /*b:ale_go_gometalinter_lint_package* +b:ale_go_gometalinter_options ale-go.txt /*b:ale_go_gometalinter_options* +b:ale_go_gopls_executable ale-go.txt /*b:ale_go_gopls_executable* +b:ale_go_gopls_init_options ale-go.txt /*b:ale_go_gopls_init_options* +b:ale_go_gopls_options ale-go.txt /*b:ale_go_gopls_options* +b:ale_go_gopls_use_global ale-go.txt /*b:ale_go_gopls_use_global* +b:ale_go_govet_options ale-go.txt /*b:ale_go_govet_options* +b:ale_go_langserver_executable ale-go.txt /*b:ale_go_langserver_executable* +b:ale_go_langserver_options ale-go.txt /*b:ale_go_langserver_options* +b:ale_go_lines_executable ale-go.txt /*b:ale_go_lines_executable* +b:ale_go_revive_executable ale-go.txt /*b:ale_go_revive_executable* +b:ale_go_revive_options ale-go.txt /*b:ale_go_revive_options* +b:ale_go_staticcheck_executable ale-go.txt /*b:ale_go_staticcheck_executable* +b:ale_go_staticcheck_lint_package ale-go.txt /*b:ale_go_staticcheck_lint_package* +b:ale_go_staticcheck_options ale-go.txt /*b:ale_go_staticcheck_options* +b:ale_go_staticcheck_use_global ale-go.txt /*b:ale_go_staticcheck_use_global* +b:ale_hack_hack_executable ale-hack.txt /*b:ale_hack_hack_executable* +b:ale_hack_hackfmt_options ale-hack.txt /*b:ale_hack_hackfmt_options* +b:ale_hack_hhast_executable ale-hack.txt /*b:ale_hack_hhast_executable* +b:ale_handlebars_embertemplatelint_executable ale-handlebars.txt /*b:ale_handlebars_embertemplatelint_executable* +b:ale_handlebars_embertemplatelint_use_global ale-handlebars.txt /*b:ale_handlebars_embertemplatelint_use_global* +b:ale_haskell_brittany_executable ale-haskell.txt /*b:ale_haskell_brittany_executable* +b:ale_haskell_cabal_ghc_options ale-haskell.txt /*b:ale_haskell_cabal_ghc_options* +b:ale_haskell_floskell_executable ale-haskell.txt /*b:ale_haskell_floskell_executable* +b:ale_haskell_ghc_mod_executable ale-haskell.txt /*b:ale_haskell_ghc_mod_executable* +b:ale_haskell_ghc_options ale-haskell.txt /*b:ale_haskell_ghc_options* +b:ale_haskell_hdevtools_executable ale-haskell.txt /*b:ale_haskell_hdevtools_executable* +b:ale_haskell_hdevtools_options ale-haskell.txt /*b:ale_haskell_hdevtools_options* +b:ale_haskell_hfmt_executable ale-haskell.txt /*b:ale_haskell_hfmt_executable* +b:ale_haskell_hie_executable ale-haskell.txt /*b:ale_haskell_hie_executable* +b:ale_haskell_hindent_executable ale-haskell.txt /*b:ale_haskell_hindent_executable* +b:ale_haskell_hlint_executable ale-haskell.txt /*b:ale_haskell_hlint_executable* +b:ale_haskell_hls_config ale-haskell.txt /*b:ale_haskell_hls_config* +b:ale_haskell_hls_executable ale-haskell.txt /*b:ale_haskell_hls_executable* +b:ale_haskell_ormolu_executable ale-haskell.txt /*b:ale_haskell_ormolu_executable* +b:ale_haskell_ormolu_options ale-haskell.txt /*b:ale_haskell_ormolu_options* +b:ale_haskell_stack_build_options ale-haskell.txt /*b:ale_haskell_stack_build_options* +b:ale_haskell_stack_ghc_options ale-haskell.txt /*b:ale_haskell_stack_ghc_options* +b:ale_haskell_stylish_haskell_executable ale-haskell.txt /*b:ale_haskell_stylish_haskell_executable* +b:ale_hdl_checker_config_file ale-vhdl.txt /*b:ale_hdl_checker_config_file* +b:ale_hdl_checker_executable ale-vhdl.txt /*b:ale_hdl_checker_executable* +b:ale_hdl_checker_options ale-vhdl.txt /*b:ale_hdl_checker_options* +b:ale_hover_to_floating_preview ale.txt /*b:ale_hover_to_floating_preview* +b:ale_hover_to_preview ale.txt /*b:ale_hover_to_preview* +b:ale_html_angular_executable ale-html.txt /*b:ale_html_angular_executable* +b:ale_html_angular_use_global ale-html.txt /*b:ale_html_angular_use_global* +b:ale_html_beautify_executable ale-html.txt /*b:ale_html_beautify_executable* +b:ale_html_beautify_options ale-html.txt /*b:ale_html_beautify_options* +b:ale_html_beautify_use_global ale-html.txt /*b:ale_html_beautify_use_global* +b:ale_html_htmlhint_executable ale-html.txt /*b:ale_html_htmlhint_executable* +b:ale_html_htmlhint_options ale-html.txt /*b:ale_html_htmlhint_options* +b:ale_html_htmlhint_use_global ale-html.txt /*b:ale_html_htmlhint_use_global* +b:ale_html_stylelint_executable ale-html.txt /*b:ale_html_stylelint_executable* +b:ale_html_stylelint_options ale-html.txt /*b:ale_html_stylelint_options* +b:ale_html_stylelint_use_global ale-html.txt /*b:ale_html_stylelint_use_global* +b:ale_html_tidy_executable ale-html.txt /*b:ale_html_tidy_executable* +b:ale_html_tidy_options ale-html.txt /*b:ale_html_tidy_options* +b:ale_idris_idris_executable ale-idris.txt /*b:ale_idris_idris_executable* +b:ale_idris_idris_options ale-idris.txt /*b:ale_idris_idris_options* +b:ale_inko_inko_executable ale-inko.txt /*b:ale_inko_inko_executable* +b:ale_ispc_ispc_executable ale-ispc.txt /*b:ale_ispc_ispc_executable* +b:ale_ispc_ispc_options ale-ispc.txt /*b:ale_ispc_ispc_options* +b:ale_java_checkstyle_config ale-java.txt /*b:ale_java_checkstyle_config* +b:ale_java_checkstyle_executable ale-java.txt /*b:ale_java_checkstyle_executable* +b:ale_java_checkstyle_options ale-java.txt /*b:ale_java_checkstyle_options* +b:ale_java_eclipse_config_path ale-java.txt /*b:ale_java_eclipse_config_path* +b:ale_java_eclipse_executable ale-java.txt /*b:ale_java_eclipse_executable* +b:ale_java_eclipselsp_javaagent ale-java.txt /*b:ale_java_eclipselsp_javaagent* +b:ale_java_eclipselsp_path ale-java.txt /*b:ale_java_eclipselsp_path* +b:ale_java_eclipselsp_workspace_path ale-java.txt /*b:ale_java_eclipselsp_workspace_path* +b:ale_java_google_java_format_executable ale-java.txt /*b:ale_java_google_java_format_executable* +b:ale_java_google_java_format_options ale-java.txt /*b:ale_java_google_java_format_options* +b:ale_java_javac_classpath ale-java.txt /*b:ale_java_javac_classpath* +b:ale_java_javac_executable ale-java.txt /*b:ale_java_javac_executable* +b:ale_java_javac_options ale-java.txt /*b:ale_java_javac_options* +b:ale_java_javac_sourcepath ale-java.txt /*b:ale_java_javac_sourcepath* +b:ale_java_javalsp_config ale-java.txt /*b:ale_java_javalsp_config* +b:ale_java_javalsp_executable ale-java.txt /*b:ale_java_javalsp_executable* +b:ale_java_pmd_options ale-java.txt /*b:ale_java_pmd_options* +b:ale_javascript_eslint_executable ale-javascript.txt /*b:ale_javascript_eslint_executable* +b:ale_javascript_eslint_options ale-javascript.txt /*b:ale_javascript_eslint_options* +b:ale_javascript_eslint_suppress_eslintignore ale-javascript.txt /*b:ale_javascript_eslint_suppress_eslintignore* +b:ale_javascript_eslint_suppress_missing_config ale-javascript.txt /*b:ale_javascript_eslint_suppress_missing_config* +b:ale_javascript_eslint_use_global ale-javascript.txt /*b:ale_javascript_eslint_use_global* +b:ale_javascript_fecs_executable ale-javascript.txt /*b:ale_javascript_fecs_executable* +b:ale_javascript_fecs_use_global ale-javascript.txt /*b:ale_javascript_fecs_use_global* +b:ale_javascript_flow_executable ale-javascript.txt /*b:ale_javascript_flow_executable* +b:ale_javascript_flow_use_global ale-javascript.txt /*b:ale_javascript_flow_use_global* +b:ale_javascript_flow_use_home_config ale-javascript.txt /*b:ale_javascript_flow_use_home_config* +b:ale_javascript_flow_use_respect_pragma ale-javascript.txt /*b:ale_javascript_flow_use_respect_pragma* +b:ale_javascript_importjs_executable ale-javascript.txt /*b:ale_javascript_importjs_executable* +b:ale_javascript_jscs_executable ale-javascript.txt /*b:ale_javascript_jscs_executable* +b:ale_javascript_jscs_use_global ale-javascript.txt /*b:ale_javascript_jscs_use_global* +b:ale_javascript_jshint_executable ale-javascript.txt /*b:ale_javascript_jshint_executable* +b:ale_javascript_jshint_use_global ale-javascript.txt /*b:ale_javascript_jshint_use_global* +b:ale_javascript_prettier_eslint_executable ale-javascript.txt /*b:ale_javascript_prettier_eslint_executable* +b:ale_javascript_prettier_eslint_options ale-javascript.txt /*b:ale_javascript_prettier_eslint_options* +b:ale_javascript_prettier_eslint_use_global ale-javascript.txt /*b:ale_javascript_prettier_eslint_use_global* +b:ale_javascript_prettier_executable ale-javascript.txt /*b:ale_javascript_prettier_executable* +b:ale_javascript_prettier_options ale-javascript.txt /*b:ale_javascript_prettier_options* +b:ale_javascript_prettier_standard_executable ale-javascript.txt /*b:ale_javascript_prettier_standard_executable* +b:ale_javascript_prettier_standard_options ale-javascript.txt /*b:ale_javascript_prettier_standard_options* +b:ale_javascript_prettier_standard_use_global ale-javascript.txt /*b:ale_javascript_prettier_standard_use_global* +b:ale_javascript_prettier_use_global ale-javascript.txt /*b:ale_javascript_prettier_use_global* +b:ale_javascript_standard_executable ale-javascript.txt /*b:ale_javascript_standard_executable* +b:ale_javascript_standard_options ale-javascript.txt /*b:ale_javascript_standard_options* +b:ale_javascript_standard_use_global ale-javascript.txt /*b:ale_javascript_standard_use_global* +b:ale_javascript_xo_executable ale-javascript.txt /*b:ale_javascript_xo_executable* +b:ale_javascript_xo_options ale-javascript.txt /*b:ale_javascript_xo_options* +b:ale_javascript_xo_use_global ale-javascript.txt /*b:ale_javascript_xo_use_global* +b:ale_json_fixjson_executable ale-json.txt /*b:ale_json_fixjson_executable* +b:ale_json_fixjson_options ale-json.txt /*b:ale_json_fixjson_options* +b:ale_json_fixjson_use_global ale-json.txt /*b:ale_json_fixjson_use_global* +b:ale_json_jq_executable ale-json.txt /*b:ale_json_jq_executable* +b:ale_json_jq_filters ale-json.txt /*b:ale_json_jq_filters* +b:ale_json_jq_options ale-json.txt /*b:ale_json_jq_options* +b:ale_json_jsonlint_executable ale-json.txt /*b:ale_json_jsonlint_executable* +b:ale_json_jsonlint_use_global ale-json.txt /*b:ale_json_jsonlint_use_global* +b:ale_json_spectral_executable ale-json.txt /*b:ale_json_spectral_executable* +b:ale_json_spectral_use_global ale-json.txt /*b:ale_json_spectral_use_global* +b:ale_jsonnet_jsonnet_lint_executable ale-jsonnet.txt /*b:ale_jsonnet_jsonnet_lint_executable* +b:ale_jsonnet_jsonnet_lint_options ale-jsonnet.txt /*b:ale_jsonnet_jsonnet_lint_options* +b:ale_jsonnet_jsonnetfmt_executable ale-jsonnet.txt /*b:ale_jsonnet_jsonnetfmt_executable* +b:ale_jsonnet_jsonnetfmt_options ale-jsonnet.txt /*b:ale_jsonnet_jsonnetfmt_options* +b:ale_julia_executable ale-julia.txt /*b:ale_julia_executable* +b:ale_keep_list_window_open ale.txt /*b:ale_keep_list_window_open* +b:ale_lacheck_executable ale-tex.txt /*b:ale_lacheck_executable* +b:ale_languagetool_executable ale.txt /*b:ale_languagetool_executable* +b:ale_languagetool_options ale.txt /*b:ale_languagetool_options* +b:ale_less_lessc_executable ale-less.txt /*b:ale_less_lessc_executable* +b:ale_less_lessc_options ale-less.txt /*b:ale_less_lessc_options* +b:ale_less_lessc_use_global ale-less.txt /*b:ale_less_lessc_use_global* +b:ale_less_stylelint_executable ale-less.txt /*b:ale_less_stylelint_executable* +b:ale_less_stylelint_options ale-less.txt /*b:ale_less_stylelint_options* +b:ale_less_stylelint_use_global ale-less.txt /*b:ale_less_stylelint_use_global* +b:ale_lint_delay ale.txt /*b:ale_lint_delay* +b:ale_lint_on_insert_leave ale.txt /*b:ale_lint_on_insert_leave* +b:ale_linted ale.txt /*b:ale_linted* +b:ale_linter_aliases ale.txt /*b:ale_linter_aliases* +b:ale_linters ale.txt /*b:ale_linters* +b:ale_linters_ignore ale.txt /*b:ale_linters_ignore* +b:ale_list_vertical ale.txt /*b:ale_list_vertical* +b:ale_list_window_size ale.txt /*b:ale_list_window_size* +b:ale_llvm_llc_executable ale-llvm.txt /*b:ale_llvm_llc_executable* +b:ale_loclist_msg_format ale.txt /*b:ale_loclist_msg_format* +b:ale_lua_lua_format_executable ale-lua.txt /*b:ale_lua_lua_format_executable* +b:ale_lua_lua_format_options ale-lua.txt /*b:ale_lua_lua_format_options* +b:ale_lua_luac_executable ale-lua.txt /*b:ale_lua_luac_executable* +b:ale_lua_luacheck_executable ale-lua.txt /*b:ale_lua_luacheck_executable* +b:ale_lua_luacheck_options ale-lua.txt /*b:ale_lua_luacheck_options* +b:ale_lua_luafmt_executable ale-lua.txt /*b:ale_lua_luafmt_executable* +b:ale_lua_luafmt_options ale-lua.txt /*b:ale_lua_luafmt_options* +b:ale_lua_selene_executable ale-lua.txt /*b:ale_lua_selene_executable* +b:ale_lua_selene_options ale-lua.txt /*b:ale_lua_selene_options* +b:ale_lua_stylua_executable ale-lua.txt /*b:ale_lua_stylua_executable* +b:ale_lua_stylua_options ale-lua.txt /*b:ale_lua_stylua_options* +b:ale_make_checkmake_config ale-make.txt /*b:ale_make_checkmake_config* +b:ale_markdown_markdownlint_executable ale-markdown.txt /*b:ale_markdown_markdownlint_executable* +b:ale_markdown_markdownlint_options ale-markdown.txt /*b:ale_markdown_markdownlint_options* +b:ale_markdown_mdl_executable ale-markdown.txt /*b:ale_markdown_mdl_executable* +b:ale_markdown_mdl_options ale-markdown.txt /*b:ale_markdown_mdl_options* +b:ale_markdown_pandoc_executable ale-markdown.txt /*b:ale_markdown_pandoc_executable* +b:ale_markdown_pandoc_options ale-markdown.txt /*b:ale_markdown_pandoc_options* +b:ale_markdown_remark_lint_executable ale-markdown.txt /*b:ale_markdown_remark_lint_executable* +b:ale_markdown_remark_lint_options ale-markdown.txt /*b:ale_markdown_remark_lint_options* +b:ale_markdown_remark_lint_use_global ale-markdown.txt /*b:ale_markdown_remark_lint_use_global* +b:ale_max_signs ale.txt /*b:ale_max_signs* +b:ale_maximum_file_size ale.txt /*b:ale_maximum_file_size* +b:ale_mercury_mmc_executable ale-mercury.txt /*b:ale_mercury_mmc_executable* +b:ale_mercury_mmc_options ale-mercury.txt /*b:ale_mercury_mmc_options* +b:ale_nasm_nasm_executable ale-nasm.txt /*b:ale_nasm_nasm_executable* +b:ale_nasm_nasm_options ale-nasm.txt /*b:ale_nasm_nasm_options* +b:ale_nim_nimpretty_executable ale-nim.txt /*b:ale_nim_nimpretty_executable* +b:ale_nim_nimpretty_options ale-nim.txt /*b:ale_nim_nimpretty_options* +b:ale_nix_fix_check_executable ale-nix.txt /*b:ale_nix_fix_check_executable* +b:ale_nix_nixfmt_executable ale-nix.txt /*b:ale_nix_nixfmt_executable* +b:ale_nix_nixfmt_options ale-nix.txt /*b:ale_nix_nixfmt_options* +b:ale_nix_nixpkgsfmt_executable ale-nix.txt /*b:ale_nix_nixpkgsfmt_executable* +b:ale_nix_nixpkgsfmt_options ale-nix.txt /*b:ale_nix_nixpkgsfmt_options* +b:ale_nix_statix_check_executable ale-nix.txt /*b:ale_nix_statix_check_executable* +b:ale_nix_statix_check_options ale-nix.txt /*b:ale_nix_statix_check_options* +b:ale_nix_statix_fix_options ale-nix.txt /*b:ale_nix_statix_fix_options* +b:ale_objc_ccls_executable ale-objc.txt /*b:ale_objc_ccls_executable* +b:ale_objc_ccls_init_options ale-objc.txt /*b:ale_objc_ccls_init_options* +b:ale_objc_clang_options ale-objc.txt /*b:ale_objc_clang_options* +b:ale_objc_clangd_executable ale-objc.txt /*b:ale_objc_clangd_executable* +b:ale_objc_clangd_options ale-objc.txt /*b:ale_objc_clangd_options* +b:ale_objcpp_clang_options ale-objcpp.txt /*b:ale_objcpp_clang_options* +b:ale_objcpp_clangd_executable ale-objcpp.txt /*b:ale_objcpp_clangd_executable* +b:ale_objcpp_clangd_options ale-objcpp.txt /*b:ale_objcpp_clangd_options* +b:ale_ocaml_dune_executable ale-ocaml.txt /*b:ale_ocaml_dune_executable* +b:ale_ocaml_dune_options ale-ocaml.txt /*b:ale_ocaml_dune_options* +b:ale_ocaml_ocamlformat_executable ale-ocaml.txt /*b:ale_ocaml_ocamlformat_executable* +b:ale_ocaml_ocamlformat_options ale-ocaml.txt /*b:ale_ocaml_ocamlformat_options* +b:ale_ocaml_ocamllsp_use_opam ale-ocaml.txt /*b:ale_ocaml_ocamllsp_use_opam* +b:ale_ocaml_ocp_indent_config ale-ocaml.txt /*b:ale_ocaml_ocp_indent_config* +b:ale_ocaml_ocp_indent_executable ale-ocaml.txt /*b:ale_ocaml_ocp_indent_executable* +b:ale_ocaml_ocp_indent_options ale-ocaml.txt /*b:ale_ocaml_ocp_indent_options* +b:ale_ocaml_ols_executable ale-ocaml.txt /*b:ale_ocaml_ols_executable* +b:ale_ocaml_ols_use_global ale-ocaml.txt /*b:ale_ocaml_ols_use_global* +b:ale_opa_fmt_executable ale-rego.txt /*b:ale_opa_fmt_executable* +b:ale_opa_fmt_options ale-rego.txt /*b:ale_opa_fmt_options* +b:ale_open_list ale.txt /*b:ale_open_list* +b:ale_openapi_ibm_validator_executable ale-openapi.txt /*b:ale_openapi_ibm_validator_executable* +b:ale_openapi_ibm_validator_options ale-openapi.txt /*b:ale_openapi_ibm_validator_options* +b:ale_openscad_sca2d_executable ale-openscad.txt /*b:ale_openscad_sca2d_executable* +b:ale_openscad_sca2d_options ale-openscad.txt /*b:ale_openscad_sca2d_options* +b:ale_packer_fmt_executable ale-packer.txt /*b:ale_packer_fmt_executable* +b:ale_packer_fmt_options ale-packer.txt /*b:ale_packer_fmt_options* +b:ale_pascal_ptop_executable ale-pascal.txt /*b:ale_pascal_ptop_executable* +b:ale_pascal_ptop_options ale-pascal.txt /*b:ale_pascal_ptop_options* +b:ale_perl6_perl6_executable ale-perl6.txt /*b:ale_perl6_perl6_executable* +b:ale_perl6_perl6_options ale-perl6.txt /*b:ale_perl6_perl6_options* +b:ale_perl_perl_executable ale-perl.txt /*b:ale_perl_perl_executable* +b:ale_perl_perl_options ale-perl.txt /*b:ale_perl_perl_options* +b:ale_perl_perlcritic_executable ale-perl.txt /*b:ale_perl_perlcritic_executable* +b:ale_perl_perlcritic_options ale-perl.txt /*b:ale_perl_perlcritic_options* +b:ale_perl_perlcritic_profile ale-perl.txt /*b:ale_perl_perlcritic_profile* +b:ale_perl_perltidy_options ale-perl.txt /*b:ale_perl_perltidy_options* +b:ale_php_cs_fixer_executable ale-php.txt /*b:ale_php_cs_fixer_executable* +b:ale_php_cs_fixer_options ale-php.txt /*b:ale_php_cs_fixer_options* +b:ale_php_cs_fixer_use_global ale-php.txt /*b:ale_php_cs_fixer_use_global* +b:ale_php_intelephense_config ale-php.txt /*b:ale_php_intelephense_config* +b:ale_php_intelephense_executable ale-php.txt /*b:ale_php_intelephense_executable* +b:ale_php_intelephense_use_global ale-php.txt /*b:ale_php_intelephense_use_global* +b:ale_php_langserver_executable ale-php.txt /*b:ale_php_langserver_executable* +b:ale_php_langserver_use_global ale-php.txt /*b:ale_php_langserver_use_global* +b:ale_php_phan_executable ale-php.txt /*b:ale_php_phan_executable* +b:ale_php_phan_minimum_severity ale-php.txt /*b:ale_php_phan_minimum_severity* +b:ale_php_phan_use_client ale-php.txt /*b:ale_php_phan_use_client* +b:ale_php_php_executable ale-php.txt /*b:ale_php_php_executable* +b:ale_php_phpcbf_executable ale-php.txt /*b:ale_php_phpcbf_executable* +b:ale_php_phpcbf_options ale-php.txt /*b:ale_php_phpcbf_options* +b:ale_php_phpcbf_standard ale-php.txt /*b:ale_php_phpcbf_standard* +b:ale_php_phpcbf_use_global ale-php.txt /*b:ale_php_phpcbf_use_global* +b:ale_php_phpcs_executable ale-php.txt /*b:ale_php_phpcs_executable* +b:ale_php_phpcs_options ale-php.txt /*b:ale_php_phpcs_options* +b:ale_php_phpcs_standard ale-php.txt /*b:ale_php_phpcs_standard* +b:ale_php_phpcs_use_global ale-php.txt /*b:ale_php_phpcs_use_global* +b:ale_php_phpmd_executable ale-php.txt /*b:ale_php_phpmd_executable* +b:ale_php_phpmd_ruleset ale-php.txt /*b:ale_php_phpmd_ruleset* +b:ale_php_phpstan_autoload ale-php.txt /*b:ale_php_phpstan_autoload* +b:ale_php_phpstan_configuration ale-php.txt /*b:ale_php_phpstan_configuration* +b:ale_php_phpstan_executable ale-php.txt /*b:ale_php_phpstan_executable* +b:ale_php_phpstan_level ale-php.txt /*b:ale_php_phpstan_level* +b:ale_php_phpstan_memory-limit ale-php.txt /*b:ale_php_phpstan_memory-limit* +b:ale_php_pint_executable ale-php.txt /*b:ale_php_pint_executable* +b:ale_php_pint_options ale-php.txt /*b:ale_php_pint_options* +b:ale_php_pint_use_global ale-php.txt /*b:ale_php_pint_use_global* +b:ale_php_psalm_executable ale-php.txt /*b:ale_php_psalm_executable* +b:ale_php_psalm_options ale-php.txt /*b:ale_php_psalm_options* +b:ale_php_psalm_use_global ale-php.txt /*b:ale_php_psalm_use_global* +b:ale_php_tlint_executable ale-php.txt /*b:ale_php_tlint_executable* +b:ale_php_tlint_options ale-php.txt /*b:ale_php_tlint_options* +b:ale_php_tlint_use_global ale-php.txt /*b:ale_php_tlint_use_global* +b:ale_pony_ponyc_executable ale-pony.txt /*b:ale_pony_ponyc_executable* +b:ale_pony_ponyc_options ale-pony.txt /*b:ale_pony_ponyc_options* +b:ale_powershell_powershell_executable ale-powershell.txt /*b:ale_powershell_powershell_executable* +b:ale_powershell_psscriptanalyzer_exclusions ale-powershell.txt /*b:ale_powershell_psscriptanalyzer_exclusions* +b:ale_powershell_psscriptanalyzer_executable ale-powershell.txt /*b:ale_powershell_psscriptanalyzer_executable* +b:ale_powershell_psscriptanalyzer_module ale-powershell.txt /*b:ale_powershell_psscriptanalyzer_module* +b:ale_prolog_swipl_alarm ale-prolog.txt /*b:ale_prolog_swipl_alarm* +b:ale_prolog_swipl_alarm_handler ale-prolog.txt /*b:ale_prolog_swipl_alarm_handler* +b:ale_prolog_swipl_executable ale-prolog.txt /*b:ale_prolog_swipl_executable* +b:ale_prolog_swipl_load ale-prolog.txt /*b:ale_prolog_swipl_load* +b:ale_prolog_swipl_timeout ale-prolog.txt /*b:ale_prolog_swipl_timeout* +b:ale_pug_puglint_executable ale-pug.txt /*b:ale_pug_puglint_executable* +b:ale_pug_puglint_options ale-pug.txt /*b:ale_pug_puglint_options* +b:ale_pug_puglint_use_global ale-pug.txt /*b:ale_pug_puglint_use_global* +b:ale_puppet_languageserver_executable ale-puppet.txt /*b:ale_puppet_languageserver_executable* +b:ale_puppet_puppet_executable ale-puppet.txt /*b:ale_puppet_puppet_executable* +b:ale_puppet_puppet_options ale-puppet.txt /*b:ale_puppet_puppet_options* +b:ale_puppet_puppetlint_executable ale-puppet.txt /*b:ale_puppet_puppetlint_executable* +b:ale_puppet_puppetlint_options ale-puppet.txt /*b:ale_puppet_puppetlint_options* +b:ale_purescript_purty_executable ale-purescript.txt /*b:ale_purescript_purty_executable* +b:ale_purescript_tidy_executable ale-purescript.txt /*b:ale_purescript_tidy_executable* +b:ale_purescript_tidy_options ale-purescript.txt /*b:ale_purescript_tidy_options* +b:ale_purescript_tidy_use_global ale-purescript.txt /*b:ale_purescript_tidy_use_global* +b:ale_pyrex_cython_executable ale-pyrex.txt /*b:ale_pyrex_cython_executable* +b:ale_pyrex_cython_options ale-pyrex.txt /*b:ale_pyrex_cython_options* +b:ale_python_auto_pipenv ale-python.txt /*b:ale_python_auto_pipenv* +b:ale_python_auto_poetry ale-python.txt /*b:ale_python_auto_poetry* +b:ale_python_autoflake_executable ale-python.txt /*b:ale_python_autoflake_executable* +b:ale_python_autoflake_options ale-python.txt /*b:ale_python_autoflake_options* +b:ale_python_autoflake_use_global ale-python.txt /*b:ale_python_autoflake_use_global* +b:ale_python_autoimport_executable ale-python.txt /*b:ale_python_autoimport_executable* +b:ale_python_autoimport_options ale-python.txt /*b:ale_python_autoimport_options* +b:ale_python_autoimport_use_global ale-python.txt /*b:ale_python_autoimport_use_global* +b:ale_python_autopep8_executable ale-python.txt /*b:ale_python_autopep8_executable* +b:ale_python_autopep8_options ale-python.txt /*b:ale_python_autopep8_options* +b:ale_python_autopep8_use_global ale-python.txt /*b:ale_python_autopep8_use_global* +b:ale_python_bandit_auto_pipenv ale-python.txt /*b:ale_python_bandit_auto_pipenv* +b:ale_python_bandit_auto_poetry ale-python.txt /*b:ale_python_bandit_auto_poetry* +b:ale_python_bandit_executable ale-python.txt /*b:ale_python_bandit_executable* +b:ale_python_bandit_options ale-python.txt /*b:ale_python_bandit_options* +b:ale_python_bandit_use_config ale-python.txt /*b:ale_python_bandit_use_config* +b:ale_python_bandit_use_global ale-python.txt /*b:ale_python_bandit_use_global* +b:ale_python_black_auto_pipenv ale-python.txt /*b:ale_python_black_auto_pipenv* +b:ale_python_black_auto_poetry ale-python.txt /*b:ale_python_black_auto_poetry* +b:ale_python_black_change_directory ale-python.txt /*b:ale_python_black_change_directory* +b:ale_python_black_executable ale-python.txt /*b:ale_python_black_executable* +b:ale_python_black_options ale-python.txt /*b:ale_python_black_options* +b:ale_python_black_use_global ale-python.txt /*b:ale_python_black_use_global* +b:ale_python_flake8_auto_pipenv ale-python.txt /*b:ale_python_flake8_auto_pipenv* +b:ale_python_flake8_auto_poetry ale-python.txt /*b:ale_python_flake8_auto_poetry* +b:ale_python_flake8_change_directory ale-python.txt /*b:ale_python_flake8_change_directory* +b:ale_python_flake8_executable ale-python.txt /*b:ale_python_flake8_executable* +b:ale_python_flake8_options ale-python.txt /*b:ale_python_flake8_options* +b:ale_python_flake8_use_global ale-python.txt /*b:ale_python_flake8_use_global* +b:ale_python_flakehell_auto_pipenv ale-python.txt /*b:ale_python_flakehell_auto_pipenv* +b:ale_python_flakehell_auto_poetry ale-python.txt /*b:ale_python_flakehell_auto_poetry* +b:ale_python_flakehell_change_directory ale-python.txt /*b:ale_python_flakehell_change_directory* +b:ale_python_flakehell_executable ale-python.txt /*b:ale_python_flakehell_executable* +b:ale_python_flakehell_options ale-python.txt /*b:ale_python_flakehell_options* +b:ale_python_flakehell_use_global ale-python.txt /*b:ale_python_flakehell_use_global* +b:ale_python_isort_auto_pipenv ale-python.txt /*b:ale_python_isort_auto_pipenv* +b:ale_python_isort_auto_poetry ale-python.txt /*b:ale_python_isort_auto_poetry* +b:ale_python_isort_executable ale-python.txt /*b:ale_python_isort_executable* +b:ale_python_isort_options ale-python.txt /*b:ale_python_isort_options* +b:ale_python_isort_use_global ale-python.txt /*b:ale_python_isort_use_global* +b:ale_python_mypy_auto_pipenv ale-python.txt /*b:ale_python_mypy_auto_pipenv* +b:ale_python_mypy_auto_poetry ale-python.txt /*b:ale_python_mypy_auto_poetry* +b:ale_python_mypy_executable ale-python.txt /*b:ale_python_mypy_executable* +b:ale_python_mypy_ignore_invalid_syntax ale-python.txt /*b:ale_python_mypy_ignore_invalid_syntax* +b:ale_python_mypy_options ale-python.txt /*b:ale_python_mypy_options* +b:ale_python_mypy_show_notes ale-python.txt /*b:ale_python_mypy_show_notes* +b:ale_python_mypy_use_global ale-python.txt /*b:ale_python_mypy_use_global* +b:ale_python_prospector_auto_pipenv ale-python.txt /*b:ale_python_prospector_auto_pipenv* +b:ale_python_prospector_auto_poetry ale-python.txt /*b:ale_python_prospector_auto_poetry* +b:ale_python_prospector_executable ale-python.txt /*b:ale_python_prospector_executable* +b:ale_python_prospector_options ale-python.txt /*b:ale_python_prospector_options* +b:ale_python_prospector_use_global ale-python.txt /*b:ale_python_prospector_use_global* +b:ale_python_pycodestyle_auto_pipenv ale-python.txt /*b:ale_python_pycodestyle_auto_pipenv* +b:ale_python_pycodestyle_auto_poetry ale-python.txt /*b:ale_python_pycodestyle_auto_poetry* +b:ale_python_pycodestyle_executable ale-python.txt /*b:ale_python_pycodestyle_executable* +b:ale_python_pycodestyle_options ale-python.txt /*b:ale_python_pycodestyle_options* +b:ale_python_pycodestyle_use_global ale-python.txt /*b:ale_python_pycodestyle_use_global* +b:ale_python_pydocstyle_auto_pipenv ale-python.txt /*b:ale_python_pydocstyle_auto_pipenv* +b:ale_python_pydocstyle_auto_poetry ale-python.txt /*b:ale_python_pydocstyle_auto_poetry* +b:ale_python_pydocstyle_executable ale-python.txt /*b:ale_python_pydocstyle_executable* +b:ale_python_pydocstyle_options ale-python.txt /*b:ale_python_pydocstyle_options* +b:ale_python_pydocstyle_use_global ale-python.txt /*b:ale_python_pydocstyle_use_global* +b:ale_python_pyflakes_auto_pipenv ale-python.txt /*b:ale_python_pyflakes_auto_pipenv* +b:ale_python_pyflakes_auto_poetry ale-python.txt /*b:ale_python_pyflakes_auto_poetry* +b:ale_python_pyflakes_executable ale-python.txt /*b:ale_python_pyflakes_executable* +b:ale_python_pyflyby_auto_pipenv ale-python.txt /*b:ale_python_pyflyby_auto_pipenv* +b:ale_python_pyflyby_auto_poetry ale-python.txt /*b:ale_python_pyflyby_auto_poetry* +b:ale_python_pyflyby_executable ale-python.txt /*b:ale_python_pyflyby_executable* +b:ale_python_pyflyby_options ale-python.txt /*b:ale_python_pyflyby_options* +b:ale_python_pyflyby_use_global ale-python.txt /*b:ale_python_pyflyby_use_global* +b:ale_python_pylama_auto_pipenv ale-python.txt /*b:ale_python_pylama_auto_pipenv* +b:ale_python_pylama_auto_poetry ale-python.txt /*b:ale_python_pylama_auto_poetry* +b:ale_python_pylama_change_directory ale-python.txt /*b:ale_python_pylama_change_directory* +b:ale_python_pylama_executable ale-python.txt /*b:ale_python_pylama_executable* +b:ale_python_pylama_options ale-python.txt /*b:ale_python_pylama_options* +b:ale_python_pylama_use_global ale-python.txt /*b:ale_python_pylama_use_global* +b:ale_python_pylint_auto_pipenv ale-python.txt /*b:ale_python_pylint_auto_pipenv* +b:ale_python_pylint_auto_poetry ale-python.txt /*b:ale_python_pylint_auto_poetry* +b:ale_python_pylint_change_directory ale-python.txt /*b:ale_python_pylint_change_directory* +b:ale_python_pylint_executable ale-python.txt /*b:ale_python_pylint_executable* +b:ale_python_pylint_options ale-python.txt /*b:ale_python_pylint_options* +b:ale_python_pylint_use_global ale-python.txt /*b:ale_python_pylint_use_global* +b:ale_python_pylint_use_msg_id ale-python.txt /*b:ale_python_pylint_use_msg_id* +b:ale_python_pylsp_auto_pipenv ale-python.txt /*b:ale_python_pylsp_auto_pipenv* +b:ale_python_pylsp_auto_poetry ale-python.txt /*b:ale_python_pylsp_auto_poetry* +b:ale_python_pylsp_config ale-python.txt /*b:ale_python_pylsp_config* +b:ale_python_pylsp_executable ale-python.txt /*b:ale_python_pylsp_executable* +b:ale_python_pylsp_options ale-python.txt /*b:ale_python_pylsp_options* +b:ale_python_pylsp_use_global ale-python.txt /*b:ale_python_pylsp_use_global* +b:ale_python_pyre_auto_pipenv ale-python.txt /*b:ale_python_pyre_auto_pipenv* +b:ale_python_pyre_auto_poetry ale-python.txt /*b:ale_python_pyre_auto_poetry* +b:ale_python_pyre_executable ale-python.txt /*b:ale_python_pyre_executable* +b:ale_python_pyre_use_global ale-python.txt /*b:ale_python_pyre_use_global* +b:ale_python_pyright_config ale-python.txt /*b:ale_python_pyright_config* +b:ale_python_pyright_executable ale-python.txt /*b:ale_python_pyright_executable* +b:ale_python_refurb_auto_pipenv ale-python.txt /*b:ale_python_refurb_auto_pipenv* +b:ale_python_refurb_auto_poetry ale-python.txt /*b:ale_python_refurb_auto_poetry* +b:ale_python_refurb_change_directory ale-python.txt /*b:ale_python_refurb_change_directory* +b:ale_python_refurb_executable ale-python.txt /*b:ale_python_refurb_executable* +b:ale_python_refurb_options ale-python.txt /*b:ale_python_refurb_options* +b:ale_python_refurb_use_global ale-python.txt /*b:ale_python_refurb_use_global* +b:ale_python_reorder_python_imports_executable ale-python.txt /*b:ale_python_reorder_python_imports_executable* +b:ale_python_reorder_python_imports_options ale-python.txt /*b:ale_python_reorder_python_imports_options* +b:ale_python_reorder_python_imports_use_global ale-python.txt /*b:ale_python_reorder_python_imports_use_global* +b:ale_python_ruff_auto_pipenv ale-python.txt /*b:ale_python_ruff_auto_pipenv* +b:ale_python_ruff_auto_poetry ale-python.txt /*b:ale_python_ruff_auto_poetry* +b:ale_python_ruff_change_directory ale-python.txt /*b:ale_python_ruff_change_directory* +b:ale_python_ruff_executable ale-python.txt /*b:ale_python_ruff_executable* +b:ale_python_ruff_options ale-python.txt /*b:ale_python_ruff_options* +b:ale_python_ruff_use_global ale-python.txt /*b:ale_python_ruff_use_global* +b:ale_python_unimport_auto_pipenv ale-python.txt /*b:ale_python_unimport_auto_pipenv* +b:ale_python_unimport_auto_poetry ale-python.txt /*b:ale_python_unimport_auto_poetry* +b:ale_python_unimport_executable ale-python.txt /*b:ale_python_unimport_executable* +b:ale_python_unimport_options ale-python.txt /*b:ale_python_unimport_options* +b:ale_python_unimport_use_global ale-python.txt /*b:ale_python_unimport_use_global* +b:ale_python_vulture_change_directory ale-python.txt /*b:ale_python_vulture_change_directory* +b:ale_python_vulture_executable ale-python.txt /*b:ale_python_vulture_executable* +b:ale_python_vulture_options ale-python.txt /*b:ale_python_vulture_options* +b:ale_python_vulture_use_global ale-python.txt /*b:ale_python_vulture_use_global* +b:ale_python_yapf_executable ale-python.txt /*b:ale_python_yapf_executable* +b:ale_python_yapf_use_global ale-python.txt /*b:ale_python_yapf_use_global* +b:ale_qml_qmlfmt_executable ale-qml.txt /*b:ale_qml_qmlfmt_executable* +b:ale_r_languageserver_cmd ale-r.txt /*b:ale_r_languageserver_cmd* +b:ale_r_languageserver_config ale-r.txt /*b:ale_r_languageserver_config* +b:ale_r_lintr_lint_package ale-r.txt /*b:ale_r_lintr_lint_package* +b:ale_r_lintr_options ale-r.txt /*b:ale_r_lintr_options* +b:ale_r_styler_options ale-r.txt /*b:ale_r_styler_options* +b:ale_racket_raco_fmt_executable ale-racket.txt /*b:ale_racket_raco_fmt_executable* +b:ale_racket_raco_fmt_options ale-racket.txt /*b:ale_racket_raco_fmt_options* +b:ale_reason_ls_executable ale-reasonml.txt /*b:ale_reason_ls_executable* +b:ale_reason_ols_executable ale-reasonml.txt /*b:ale_reason_ols_executable* +b:ale_reason_ols_use_global ale-reasonml.txt /*b:ale_reason_ols_use_global* +b:ale_reasonml_refmt_executable ale-reasonml.txt /*b:ale_reasonml_refmt_executable* +b:ale_reasonml_refmt_options ale-reasonml.txt /*b:ale_reasonml_refmt_options* +b:ale_robot_rflint_executable ale-robot.txt /*b:ale_robot_rflint_executable* +b:ale_root ale.txt /*b:ale_root* +b:ale_ruby_brakeman_executable ale-ruby.txt /*b:ale_ruby_brakeman_executable* +b:ale_ruby_brakeman_options ale-ruby.txt /*b:ale_ruby_brakeman_options* +b:ale_ruby_debride_executable ale-ruby.txt /*b:ale_ruby_debride_executable* +b:ale_ruby_debride_options ale-ruby.txt /*b:ale_ruby_debride_options* +b:ale_ruby_erblint_options ale-eruby.txt /*b:ale_ruby_erblint_options* +b:ale_ruby_rails_best_practices_executable ale-ruby.txt /*b:ale_ruby_rails_best_practices_executable* +b:ale_ruby_rails_best_practices_options ale-ruby.txt /*b:ale_ruby_rails_best_practices_options* +b:ale_ruby_reek_executable ale-ruby.txt /*b:ale_ruby_reek_executable* +b:ale_ruby_reek_show_context ale-ruby.txt /*b:ale_ruby_reek_show_context* +b:ale_ruby_reek_show_wiki_link ale-ruby.txt /*b:ale_ruby_reek_show_wiki_link* +b:ale_ruby_rubocop_auto_correct_all ale-ruby.txt /*b:ale_ruby_rubocop_auto_correct_all* +b:ale_ruby_rubocop_executable ale-ruby.txt /*b:ale_ruby_rubocop_executable* +b:ale_ruby_rubocop_options ale-ruby.txt /*b:ale_ruby_rubocop_options* +b:ale_ruby_ruby_executable ale-ruby.txt /*b:ale_ruby_ruby_executable* +b:ale_ruby_rufo_executable ale-ruby.txt /*b:ale_ruby_rufo_executable* +b:ale_ruby_ruumba_options ale-eruby.txt /*b:ale_ruby_ruumba_options* +b:ale_ruby_solargraph_executable ale-ruby.txt /*b:ale_ruby_solargraph_executable* +b:ale_ruby_sorbet_enable_watchman ale-ruby.txt /*b:ale_ruby_sorbet_enable_watchman* +b:ale_ruby_sorbet_executable ale-ruby.txt /*b:ale_ruby_sorbet_executable* +b:ale_ruby_sorbet_options ale-ruby.txt /*b:ale_ruby_sorbet_options* +b:ale_ruby_standardrb_executable ale-ruby.txt /*b:ale_ruby_standardrb_executable* +b:ale_ruby_standardrb_options ale-ruby.txt /*b:ale_ruby_standardrb_options* +b:ale_ruby_syntax_tree_executable ale-ruby.txt /*b:ale_ruby_syntax_tree_executable* +b:ale_ruby_syntax_tree_options ale-ruby.txt /*b:ale_ruby_syntax_tree_options* +b:ale_rust_analyzer_config ale-rust.txt /*b:ale_rust_analyzer_config* +b:ale_rust_analyzer_executable ale-rust.txt /*b:ale_rust_analyzer_executable* +b:ale_rust_cargo_avoid_whole_workspace ale-rust.txt /*b:ale_rust_cargo_avoid_whole_workspace* +b:ale_rust_cargo_check_all_targets ale-rust.txt /*b:ale_rust_cargo_check_all_targets* +b:ale_rust_cargo_check_examples ale-rust.txt /*b:ale_rust_cargo_check_examples* +b:ale_rust_cargo_check_tests ale-rust.txt /*b:ale_rust_cargo_check_tests* +b:ale_rust_cargo_clippy_options ale-rust.txt /*b:ale_rust_cargo_clippy_options* +b:ale_rust_cargo_default_feature_behavior ale-rust.txt /*b:ale_rust_cargo_default_feature_behavior* +b:ale_rust_cargo_include_features ale-rust.txt /*b:ale_rust_cargo_include_features* +b:ale_rust_cargo_target_dir ale-rust.txt /*b:ale_rust_cargo_target_dir* +b:ale_rust_cargo_use_check ale-rust.txt /*b:ale_rust_cargo_use_check* +b:ale_rust_cargo_use_clippy ale-rust.txt /*b:ale_rust_cargo_use_clippy* +b:ale_rust_ignore_error_codes ale-rust.txt /*b:ale_rust_ignore_error_codes* +b:ale_rust_ignore_secondary_spans ale-rust.txt /*b:ale_rust_ignore_secondary_spans* +b:ale_rust_rls_config ale-rust.txt /*b:ale_rust_rls_config* +b:ale_rust_rls_executable ale-rust.txt /*b:ale_rust_rls_executable* +b:ale_rust_rls_toolchain ale-rust.txt /*b:ale_rust_rls_toolchain* +b:ale_rust_rustc_options ale-rust.txt /*b:ale_rust_rustc_options* +b:ale_rust_rustfmt_executable ale-rust.txt /*b:ale_rust_rustfmt_executable* +b:ale_rust_rustfmt_options ale-rust.txt /*b:ale_rust_rustfmt_options* +b:ale_sass_stylelint_executable ale-sass.txt /*b:ale_sass_stylelint_executable* +b:ale_sass_stylelint_use_global ale-sass.txt /*b:ale_sass_stylelint_use_global* +b:ale_scala_metals_executable ale-scala.txt /*b:ale_scala_metals_executable* +b:ale_scala_metals_project_root ale-scala.txt /*b:ale_scala_metals_project_root* +b:ale_scala_sbtserver_address ale-scala.txt /*b:ale_scala_sbtserver_address* +b:ale_scala_sbtserver_project_root ale-scala.txt /*b:ale_scala_sbtserver_project_root* +b:ale_scala_scalafmt_executable ale-scala.txt /*b:ale_scala_scalafmt_executable* +b:ale_scala_scalafmt_options ale-scala.txt /*b:ale_scala_scalafmt_options* +b:ale_scala_scalastyle_config ale-scala.txt /*b:ale_scala_scalastyle_config* +b:ale_scala_scalastyle_options ale-scala.txt /*b:ale_scala_scalastyle_options* +b:ale_scss_sasslint_executable ale-scss.txt /*b:ale_scss_sasslint_executable* +b:ale_scss_sasslint_options ale-scss.txt /*b:ale_scss_sasslint_options* +b:ale_scss_sasslint_use_global ale-scss.txt /*b:ale_scss_sasslint_use_global* +b:ale_scss_stylelint_executable ale-scss.txt /*b:ale_scss_stylelint_executable* +b:ale_scss_stylelint_options ale-scss.txt /*b:ale_scss_stylelint_options* +b:ale_scss_stylelint_use_global ale-scss.txt /*b:ale_scss_stylelint_use_global* +b:ale_set_balloons ale.txt /*b:ale_set_balloons* +b:ale_set_balloons_legacy_echo ale.txt /*b:ale_set_balloons_legacy_echo* +b:ale_sh_bashate_executable ale-sh.txt /*b:ale_sh_bashate_executable* +b:ale_sh_bashate_options ale-sh.txt /*b:ale_sh_bashate_options* +b:ale_sh_language_server_executable ale-sh.txt /*b:ale_sh_language_server_executable* +b:ale_sh_language_server_use_global ale-sh.txt /*b:ale_sh_language_server_use_global* +b:ale_sh_shell_default_shell ale-sh.txt /*b:ale_sh_shell_default_shell* +b:ale_sh_shellcheck_change_directory ale-sh.txt /*b:ale_sh_shellcheck_change_directory* +b:ale_sh_shellcheck_dialect ale-sh.txt /*b:ale_sh_shellcheck_dialect* +b:ale_sh_shellcheck_exclusions ale-sh.txt /*b:ale_sh_shellcheck_exclusions* +b:ale_sh_shellcheck_executable ale-sh.txt /*b:ale_sh_shellcheck_executable* +b:ale_sh_shellcheck_options ale-sh.txt /*b:ale_sh_shellcheck_options* +b:ale_sh_shfmt_options ale-sh.txt /*b:ale_sh_shfmt_options* +b:ale_shell ale.txt /*b:ale_shell* +b:ale_shell_arguments ale.txt /*b:ale_shell_arguments* +b:ale_sml_smlnj_cm_file ale-sml.txt /*b:ale_sml_smlnj_cm_file* +b:ale_solidity_solc_executable ale-solidity.txt /*b:ale_solidity_solc_executable* +b:ale_solidity_solc_options ale-solidity.txt /*b:ale_solidity_solc_options* +b:ale_sourcekit_lsp_executable ale-swift.txt /*b:ale_sourcekit_lsp_executable* +b:ale_spec_rpmlint_executable ale-spec.txt /*b:ale_spec_rpmlint_executable* +b:ale_spec_rpmlint_options ale-spec.txt /*b:ale_spec_rpmlint_options* +b:ale_sql_pgformatter_executable ale-sql.txt /*b:ale_sql_pgformatter_executable* +b:ale_sql_pgformatter_options ale-sql.txt /*b:ale_sql_pgformatter_options* +b:ale_sql_sqlfluff_executable ale-sql.txt /*b:ale_sql_sqlfluff_executable* +b:ale_sql_sqlfluff_options ale-sql.txt /*b:ale_sql_sqlfluff_options* +b:ale_sql_sqlfmt_executable ale-sql.txt /*b:ale_sql_sqlfmt_executable* +b:ale_sql_sqlfmt_options ale-sql.txt /*b:ale_sql_sqlfmt_options* +b:ale_sql_sqlformat_executable ale-sql.txt /*b:ale_sql_sqlformat_executable* +b:ale_sql_sqlformat_options ale-sql.txt /*b:ale_sql_sqlformat_options* +b:ale_stylus_stylelint_executable ale-stylus.txt /*b:ale_stylus_stylelint_executable* +b:ale_stylus_stylelint_options ale-stylus.txt /*b:ale_stylus_stylelint_options* +b:ale_stylus_stylelint_use_global ale-stylus.txt /*b:ale_stylus_stylelint_use_global* +b:ale_sugarss_stylelint_executable ale-sugarss.txt /*b:ale_sugarss_stylelint_executable* +b:ale_sugarss_stylelint_options ale-sugarss.txt /*b:ale_sugarss_stylelint_options* +b:ale_sugarss_stylelint_use_global ale-sugarss.txt /*b:ale_sugarss_stylelint_use_global* +b:ale_svelte_svelteserver_executable ale-svelte.txt /*b:ale_svelte_svelteserver_executable* +b:ale_svelte_svelteserver_use_global ale-svelte.txt /*b:ale_svelte_svelteserver_use_global* +b:ale_swift_appleswiftformat_executable ale-swift.txt /*b:ale_swift_appleswiftformat_executable* +b:ale_swift_appleswiftformat_use_swiftpm ale-swift.txt /*b:ale_swift_appleswiftformat_use_swiftpm* +b:ale_tcl_nagelfar_executable ale-tcl.txt /*b:ale_tcl_nagelfar_executable* +b:ale_tcl_nagelfar_options ale-tcl.txt /*b:ale_tcl_nagelfar_options* +b:ale_terraform_checkov_executable ale-terraform.txt /*b:ale_terraform_checkov_executable* +b:ale_terraform_checkov_options ale-terraform.txt /*b:ale_terraform_checkov_options* +b:ale_terraform_fmt_executable ale-terraform.txt /*b:ale_terraform_fmt_executable* +b:ale_terraform_fmt_options ale-terraform.txt /*b:ale_terraform_fmt_options* +b:ale_terraform_langserver_executable ale-terraform.txt /*b:ale_terraform_langserver_executable* +b:ale_terraform_langserver_options ale-terraform.txt /*b:ale_terraform_langserver_options* +b:ale_terraform_ls_executable ale-terraform.txt /*b:ale_terraform_ls_executable* +b:ale_terraform_ls_options ale-terraform.txt /*b:ale_terraform_ls_options* +b:ale_terraform_terraform_executable ale-terraform.txt /*b:ale_terraform_terraform_executable* +b:ale_terraform_tflint_executable ale-terraform.txt /*b:ale_terraform_tflint_executable* +b:ale_terraform_tflint_options ale-terraform.txt /*b:ale_terraform_tflint_options* +b:ale_terraform_tfsec_executable ale-terraform.txt /*b:ale_terraform_tfsec_executable* +b:ale_terraform_tfsec_options ale-terraform.txt /*b:ale_terraform_tfsec_options* +b:ale_tex_chktex_executable ale-tex.txt /*b:ale_tex_chktex_executable* +b:ale_tex_chktex_options ale-tex.txt /*b:ale_tex_chktex_options* +b:ale_tex_latexindent_executable ale-tex.txt /*b:ale_tex_latexindent_executable* +b:ale_tex_latexindent_options ale-tex.txt /*b:ale_tex_latexindent_options* +b:ale_tex_texlab_config ale-tex.txt /*b:ale_tex_texlab_config* +b:ale_tex_texlab_executable ale-tex.txt /*b:ale_tex_texlab_executable* +b:ale_tex_texlab_options ale-tex.txt /*b:ale_tex_texlab_options* +b:ale_textlint_executable ale-text.txt /*b:ale_textlint_executable* +b:ale_textlint_options ale-text.txt /*b:ale_textlint_options* +b:ale_textlint_use_global ale-text.txt /*b:ale_textlint_use_global* +b:ale_thrift_thrift_executable ale-thrift.txt /*b:ale_thrift_thrift_executable* +b:ale_thrift_thrift_generators ale-thrift.txt /*b:ale_thrift_thrift_generators* +b:ale_thrift_thrift_includes ale-thrift.txt /*b:ale_thrift_thrift_includes* +b:ale_thrift_thrift_options ale-thrift.txt /*b:ale_thrift_thrift_options* +b:ale_thrift_thriftcheck_executable ale-thrift.txt /*b:ale_thrift_thriftcheck_executable* +b:ale_thrift_thriftcheck_options ale-thrift.txt /*b:ale_thrift_thriftcheck_options* +b:ale_type_map ale.txt /*b:ale_type_map* +b:ale_typescript_standard_executable ale-typescript.txt /*b:ale_typescript_standard_executable* +b:ale_typescript_standard_options ale-typescript.txt /*b:ale_typescript_standard_options* +b:ale_typescript_standard_use_global ale-typescript.txt /*b:ale_typescript_standard_use_global* +b:ale_typescript_tslint_config_path ale-typescript.txt /*b:ale_typescript_tslint_config_path* +b:ale_typescript_tslint_executable ale-typescript.txt /*b:ale_typescript_tslint_executable* +b:ale_typescript_tslint_ignore_empty_files ale-typescript.txt /*b:ale_typescript_tslint_ignore_empty_files* +b:ale_typescript_tslint_rules_dir ale-typescript.txt /*b:ale_typescript_tslint_rules_dir* +b:ale_typescript_tslint_use_global ale-typescript.txt /*b:ale_typescript_tslint_use_global* +b:ale_typescript_tsserver_config_path ale-typescript.txt /*b:ale_typescript_tsserver_config_path* +b:ale_typescript_tsserver_executable ale-typescript.txt /*b:ale_typescript_tsserver_executable* +b:ale_typescript_tsserver_use_global ale-typescript.txt /*b:ale_typescript_tsserver_use_global* +b:ale_typescript_xo_executable ale-typescript.txt /*b:ale_typescript_xo_executable* +b:ale_typescript_xo_options ale-typescript.txt /*b:ale_typescript_xo_options* +b:ale_typescript_xo_use_global ale-typescript.txt /*b:ale_typescript_xo_use_global* +b:ale_update_tagstack ale.txt /*b:ale_update_tagstack* +b:ale_v_v_executable ale-v.txt /*b:ale_v_v_executable* +b:ale_v_v_options ale-v.txt /*b:ale_v_v_options* +b:ale_v_vfmt_options ale-v.txt /*b:ale_v_vfmt_options* +b:ale_verilog_verilator_options ale-verilog.txt /*b:ale_verilog_verilator_options* +b:ale_verilog_vlog_executable ale-verilog.txt /*b:ale_verilog_vlog_executable* +b:ale_verilog_vlog_options ale-verilog.txt /*b:ale_verilog_vlog_options* +b:ale_verilog_xvlog_executable ale-verilog.txt /*b:ale_verilog_xvlog_executable* +b:ale_verilog_xvlog_options ale-verilog.txt /*b:ale_verilog_xvlog_options* +b:ale_verilog_yosys_executable ale-verilog.txt /*b:ale_verilog_yosys_executable* +b:ale_verilog_yosys_options ale-verilog.txt /*b:ale_verilog_yosys_options* +b:ale_vhdl_ghdl_executable ale-vhdl.txt /*b:ale_vhdl_ghdl_executable* +b:ale_vhdl_ghdl_options ale-vhdl.txt /*b:ale_vhdl_ghdl_options* +b:ale_vhdl_vcom_executable ale-vhdl.txt /*b:ale_vhdl_vcom_executable* +b:ale_vhdl_vcom_options ale-vhdl.txt /*b:ale_vhdl_vcom_options* +b:ale_vhdl_xvhdl_executable ale-vhdl.txt /*b:ale_vhdl_xvhdl_executable* +b:ale_vhdl_xvhdl_options ale-vhdl.txt /*b:ale_vhdl_xvhdl_options* +b:ale_vim_vimls_config ale-vim.txt /*b:ale_vim_vimls_config* +b:ale_vim_vimls_executable ale-vim.txt /*b:ale_vim_vimls_executable* +b:ale_vim_vimls_use_global ale-vim.txt /*b:ale_vim_vimls_use_global* +b:ale_vim_vint_executable ale-vim.txt /*b:ale_vim_vint_executable* +b:ale_vim_vint_show_style_issues ale-vim.txt /*b:ale_vim_vint_show_style_issues* +b:ale_virtualenv_dir_names ale.txt /*b:ale_virtualenv_dir_names* +b:ale_virtualtext_delay ale.txt /*b:ale_virtualtext_delay* +b:ale_virtualtext_prefix ale.txt /*b:ale_virtualtext_prefix* +b:ale_vue_vls_executable ale-vue.txt /*b:ale_vue_vls_executable* +b:ale_vue_vls_use_global ale-vue.txt /*b:ale_vue_vls_use_global* +b:ale_vue_volar_executable ale-vue.txt /*b:ale_vue_volar_executable* +b:ale_vue_volar_init_options ale-vue.txt /*b:ale_vue_volar_init_options* +b:ale_vue_volar_use_global ale-vue.txt /*b:ale_vue_volar_use_global* +b:ale_warn_about_trailing_blank_lines ale.txt /*b:ale_warn_about_trailing_blank_lines* +b:ale_warn_about_trailing_whitespace ale.txt /*b:ale_warn_about_trailing_whitespace* +b:ale_wgsl_naga_executable ale-wgsl.txt /*b:ale_wgsl_naga_executable* +b:ale_windows_node_executable_path ale.txt /*b:ale_windows_node_executable_path* +b:ale_writegood_executable ale.txt /*b:ale_writegood_executable* +b:ale_writegood_options ale.txt /*b:ale_writegood_options* +b:ale_writegood_use_global ale.txt /*b:ale_writegood_use_global* +b:ale_xml_xmllint_executable ale-xml.txt /*b:ale_xml_xmllint_executable* +b:ale_xml_xmllint_indentsize ale-xml.txt /*b:ale_xml_xmllint_indentsize* +b:ale_xml_xmllint_options ale-xml.txt /*b:ale_xml_xmllint_options* +b:ale_yaml_actionlint_executable ale-yaml.txt /*b:ale_yaml_actionlint_executable* +b:ale_yaml_actionlint_options ale-yaml.txt /*b:ale_yaml_actionlint_options* +b:ale_yaml_gitlablint_executable ale-yaml.txt /*b:ale_yaml_gitlablint_executable* +b:ale_yaml_gitlablint_options ale-yaml.txt /*b:ale_yaml_gitlablint_options* +b:ale_yaml_ls_config ale-yaml.txt /*b:ale_yaml_ls_config* +b:ale_yaml_ls_executable ale-yaml.txt /*b:ale_yaml_ls_executable* +b:ale_yaml_ls_use_global ale-yaml.txt /*b:ale_yaml_ls_use_global* +b:ale_yaml_spectral_executable ale-yaml.txt /*b:ale_yaml_spectral_executable* +b:ale_yaml_spectral_use_global ale-yaml.txt /*b:ale_yaml_spectral_use_global* +b:ale_yaml_swaglint_executable ale-yaml.txt /*b:ale_yaml_swaglint_executable* +b:ale_yaml_swaglint_use_global ale-yaml.txt /*b:ale_yaml_swaglint_use_global* +b:ale_yaml_yamlfix_executable ale-yaml.txt /*b:ale_yaml_yamlfix_executable* +b:ale_yaml_yamlfix_options ale-yaml.txt /*b:ale_yaml_yamlfix_options* +b:ale_yaml_yamlfix_use_global ale-yaml.txt /*b:ale_yaml_yamlfix_use_global* +b:ale_yaml_yamllint_executable ale-yaml.txt /*b:ale_yaml_yamllint_executable* +b:ale_yaml_yamllint_options ale-yaml.txt /*b:ale_yaml_yamllint_options* +b:ale_yang_lsp_executable ale-yang.txt /*b:ale_yang_lsp_executable* +b:ale_zeek_zeek_executable ale-zeek.txt /*b:ale_zeek_zeek_executable* +b:ale_zig_zigfmt_executable ale-zig.txt /*b:ale_zig_zigfmt_executable* +b:ale_zig_zls_config ale-zig.txt /*b:ale_zig_zls_config* +b:ale_zig_zls_executable ale-zig.txt /*b:ale_zig_zls_executable* +b:rego_opacheck_executable ale-rego.txt /*b:rego_opacheck_executable* +b:rego_opacheck_options ale-rego.txt /*b:rego_opacheck_options* +b:vala_vala_lint_config_filename ale-vala.txt /*b:vala_vala_lint_config_filename* +b:vala_vala_lint_executable ale-vala.txt /*b:vala_vala_lint_executable* +g:airline#extensions#ale#enabled ale.txt /*g:airline#extensions#ale#enabled* +g:ale-c-flawfinder ale-c.txt /*g:ale-c-flawfinder* +g:ale-cpp-flawfinder ale-cpp.txt /*g:ale-cpp-flawfinder* +g:ale_ada_adals_encoding ale-ada.txt /*g:ale_ada_adals_encoding* +g:ale_ada_adals_executable ale-ada.txt /*g:ale_ada_adals_executable* +g:ale_ada_adals_project ale-ada.txt /*g:ale_ada_adals_project* +g:ale_ada_gcc_executable ale-ada.txt /*g:ale_ada_gcc_executable* +g:ale_ada_gcc_options ale-ada.txt /*g:ale_ada_gcc_options* +g:ale_ada_gnatpp_options ale-ada.txt /*g:ale_ada_gnatpp_options* +g:ale_alex_executable ale.txt /*g:ale_alex_executable* +g:ale_alex_use_global ale.txt /*g:ale_alex_use_global* +g:ale_ansible_ansible_lint_executable ale-ansible.txt /*g:ale_ansible_ansible_lint_executable* +g:ale_ansible_language_server ale-ansible.txt /*g:ale_ansible_language_server* +g:ale_ansible_language_server_config ale-ansible.txt /*g:ale_ansible_language_server_config* +g:ale_apkbuild_apkbuild_lint_executable ale-apkbuild.txt /*g:ale_apkbuild_apkbuild_lint_executable* +g:ale_apkbuild_secfixes_check_executable ale-apkbuild.txt /*g:ale_apkbuild_secfixes_check_executable* +g:ale_asm_gcc_executable ale-asm.txt /*g:ale_asm_gcc_executable* +g:ale_asm_gcc_options ale-asm.txt /*g:ale_asm_gcc_options* +g:ale_avra_avra_executable ale-avra.txt /*g:ale_avra_avra_executable* +g:ale_avra_avra_options ale-avra.txt /*g:ale_avra_avra_options* +g:ale_awk_gawk_executable ale-awk.txt /*g:ale_awk_gawk_executable* +g:ale_awk_gawk_options ale-awk.txt /*g:ale_awk_gawk_options* +g:ale_bazel_buildifier_executable ale-bazel.txt /*g:ale_bazel_buildifier_executable* +g:ale_bazel_buildifier_options ale-bazel.txt /*g:ale_bazel_buildifier_options* +g:ale_bazel_buildifier_use_global ale-bazel.txt /*g:ale_bazel_buildifier_use_global* +g:ale_bib_bibclean_executable ale-bib.txt /*g:ale_bib_bibclean_executable* +g:ale_bib_bibclean_options ale-bib.txt /*g:ale_bib_bibclean_options* +g:ale_bicep_bicep_executable ale-bicep.txt /*g:ale_bicep_bicep_executable* +g:ale_bicep_bicep_options ale-bicep.txt /*g:ale_bicep_bicep_options* +g:ale_bitbake_oelint_adv_config ale-bitbake.txt /*g:ale_bitbake_oelint_adv_config* +g:ale_bitbake_oelint_adv_executable ale-bitbake.txt /*g:ale_bitbake_oelint_adv_executable* +g:ale_bitbake_oelint_adv_options ale-bitbake.txt /*g:ale_bitbake_oelint_adv_options* +g:ale_c_always_make ale-c.txt /*g:ale_c_always_make* +g:ale_c_astyle_executable ale-c.txt /*g:ale_c_astyle_executable* +g:ale_c_astyle_project_options ale-c.txt /*g:ale_c_astyle_project_options* +g:ale_c_build_dir ale-c.txt /*g:ale_c_build_dir* +g:ale_c_build_dir_names ale-c.txt /*g:ale_c_build_dir_names* +g:ale_c_cc_executable ale-c.txt /*g:ale_c_cc_executable* +g:ale_c_cc_header_exts ale-c.txt /*g:ale_c_cc_header_exts* +g:ale_c_cc_options ale-c.txt /*g:ale_c_cc_options* +g:ale_c_cc_use_header_lang_flag ale-c.txt /*g:ale_c_cc_use_header_lang_flag* +g:ale_c_ccls_executable ale-c.txt /*g:ale_c_ccls_executable* +g:ale_c_ccls_init_options ale-c.txt /*g:ale_c_ccls_init_options* +g:ale_c_clangd_executable ale-c.txt /*g:ale_c_clangd_executable* +g:ale_c_clangd_options ale-c.txt /*g:ale_c_clangd_options* +g:ale_c_clangformat_executable ale-c.txt /*g:ale_c_clangformat_executable* +g:ale_c_clangformat_options ale-c.txt /*g:ale_c_clangformat_options* +g:ale_c_clangformat_style_option ale-c.txt /*g:ale_c_clangformat_style_option* +g:ale_c_clangformat_use_local_file ale-c.txt /*g:ale_c_clangformat_use_local_file* +g:ale_c_clangtidy_checks ale-c.txt /*g:ale_c_clangtidy_checks* +g:ale_c_clangtidy_executable ale-c.txt /*g:ale_c_clangtidy_executable* +g:ale_c_clangtidy_extra_options ale-c.txt /*g:ale_c_clangtidy_extra_options* +g:ale_c_clangtidy_fix_errors ale-c.txt /*g:ale_c_clangtidy_fix_errors* +g:ale_c_clangtidy_options ale-c.txt /*g:ale_c_clangtidy_options* +g:ale_c_cppcheck_executable ale-c.txt /*g:ale_c_cppcheck_executable* +g:ale_c_cppcheck_options ale-c.txt /*g:ale_c_cppcheck_options* +g:ale_c_cpplint_executable ale-cpp.txt /*g:ale_c_cpplint_executable* +g:ale_c_cpplint_options ale-cpp.txt /*g:ale_c_cpplint_options* +g:ale_c_cquery_cache_directory ale-c.txt /*g:ale_c_cquery_cache_directory* +g:ale_c_cquery_executable ale-c.txt /*g:ale_c_cquery_executable* +g:ale_c_flawfinder_error_severity ale-c.txt /*g:ale_c_flawfinder_error_severity* +g:ale_c_flawfinder_executable ale-c.txt /*g:ale_c_flawfinder_executable* +g:ale_c_flawfinder_minlevel ale-c.txt /*g:ale_c_flawfinder_minlevel* +g:ale_c_parse_compile_commands ale-c.txt /*g:ale_c_parse_compile_commands* +g:ale_c_parse_makefile ale-c.txt /*g:ale_c_parse_makefile* +g:ale_c_uncrustify_executable ale-c.txt /*g:ale_c_uncrustify_executable* +g:ale_c_uncrustify_options ale-c.txt /*g:ale_c_uncrustify_options* +g:ale_cache_executable_check_failures ale.txt /*g:ale_cache_executable_check_failures* +g:ale_cairo_starknet_executable ale-cairo.txt /*g:ale_cairo_starknet_executable* +g:ale_change_sign_column_color ale.txt /*g:ale_change_sign_column_color* +g:ale_chef_cookstyle_executable ale-chef.txt /*g:ale_chef_cookstyle_executable* +g:ale_chef_cookstyle_options ale-chef.txt /*g:ale_chef_cookstyle_options* +g:ale_chef_foodcritic_executable ale-chef.txt /*g:ale_chef_foodcritic_executable* +g:ale_chef_foodcritic_options ale-chef.txt /*g:ale_chef_foodcritic_options* +g:ale_clojure_clj_kondo_options ale-clojure.txt /*g:ale_clojure_clj_kondo_options* +g:ale_close_preview_on_insert ale.txt /*g:ale_close_preview_on_insert* +g:ale_cmake_cmake_lint_executable ale-cmake.txt /*g:ale_cmake_cmake_lint_executable* +g:ale_cmake_cmake_lint_options ale-cmake.txt /*g:ale_cmake_cmake_lint_options* +g:ale_cmake_cmakeformat_executable ale-cmake.txt /*g:ale_cmake_cmakeformat_executable* +g:ale_cmake_cmakeformat_options ale-cmake.txt /*g:ale_cmake_cmakeformat_options* +g:ale_cmake_cmakelint_executable ale-cmake.txt /*g:ale_cmake_cmakelint_executable* +g:ale_cmake_cmakelint_options ale-cmake.txt /*g:ale_cmake_cmakelint_options* +g:ale_command_wrapper ale.txt /*g:ale_command_wrapper* +g:ale_completion_autoimport ale.txt /*g:ale_completion_autoimport* +g:ale_completion_delay ale.txt /*g:ale_completion_delay* +g:ale_completion_enabled ale.txt /*g:ale_completion_enabled* +g:ale_completion_excluded_words ale.txt /*g:ale_completion_excluded_words* +g:ale_completion_max_suggestions ale.txt /*g:ale_completion_max_suggestions* +g:ale_completion_symbols ale.txt /*g:ale_completion_symbols* +g:ale_completion_tsserver_remove_warnings ale.txt /*g:ale_completion_tsserver_remove_warnings* +g:ale_cpp_astyle_executable ale-cpp.txt /*g:ale_cpp_astyle_executable* +g:ale_cpp_astyle_project_options ale-cpp.txt /*g:ale_cpp_astyle_project_options* +g:ale_cpp_cc_executable ale-cpp.txt /*g:ale_cpp_cc_executable* +g:ale_cpp_cc_header_exts ale-cpp.txt /*g:ale_cpp_cc_header_exts* +g:ale_cpp_cc_options ale-cpp.txt /*g:ale_cpp_cc_options* +g:ale_cpp_cc_use_header_lang_flag ale-cpp.txt /*g:ale_cpp_cc_use_header_lang_flag* +g:ale_cpp_ccls_executable ale-cpp.txt /*g:ale_cpp_ccls_executable* +g:ale_cpp_ccls_init_options ale-cpp.txt /*g:ale_cpp_ccls_init_options* +g:ale_cpp_clangcheck_executable ale-cpp.txt /*g:ale_cpp_clangcheck_executable* +g:ale_cpp_clangcheck_options ale-cpp.txt /*g:ale_cpp_clangcheck_options* +g:ale_cpp_clangd_executable ale-cpp.txt /*g:ale_cpp_clangd_executable* +g:ale_cpp_clangd_options ale-cpp.txt /*g:ale_cpp_clangd_options* +g:ale_cpp_clangtidy_checks ale-cpp.txt /*g:ale_cpp_clangtidy_checks* +g:ale_cpp_clangtidy_executable ale-cpp.txt /*g:ale_cpp_clangtidy_executable* +g:ale_cpp_clangtidy_extra_options ale-cpp.txt /*g:ale_cpp_clangtidy_extra_options* +g:ale_cpp_clangtidy_fix_errors ale-cpp.txt /*g:ale_cpp_clangtidy_fix_errors* +g:ale_cpp_clangtidy_options ale-cpp.txt /*g:ale_cpp_clangtidy_options* +g:ale_cpp_clazy_checks ale-cpp.txt /*g:ale_cpp_clazy_checks* +g:ale_cpp_clazy_executable ale-cpp.txt /*g:ale_cpp_clazy_executable* +g:ale_cpp_clazy_options ale-cpp.txt /*g:ale_cpp_clazy_options* +g:ale_cpp_cppcheck_executable ale-cpp.txt /*g:ale_cpp_cppcheck_executable* +g:ale_cpp_cppcheck_options ale-cpp.txt /*g:ale_cpp_cppcheck_options* +g:ale_cpp_cpplint_executable ale-cpp.txt /*g:ale_cpp_cpplint_executable* +g:ale_cpp_cpplint_options ale-cpp.txt /*g:ale_cpp_cpplint_options* +g:ale_cpp_cquery_cache_directory ale-cpp.txt /*g:ale_cpp_cquery_cache_directory* +g:ale_cpp_cquery_executable ale-cpp.txt /*g:ale_cpp_cquery_executable* +g:ale_cpp_flawfinder_executable ale-cpp.txt /*g:ale_cpp_flawfinder_executable* +g:ale_cpp_flawfinder_minlevel ale-cpp.txt /*g:ale_cpp_flawfinder_minlevel* +g:ale_cs_csc_assemblies ale-cs.txt /*g:ale_cs_csc_assemblies* +g:ale_cs_csc_assembly_path ale-cs.txt /*g:ale_cs_csc_assembly_path* +g:ale_cs_csc_options ale-cs.txt /*g:ale_cs_csc_options* +g:ale_cs_csc_source ale-cs.txt /*g:ale_cs_csc_source* +g:ale_cs_dotnet_format_executable ale-cs.txt /*g:ale_cs_dotnet_format_executable* +g:ale_cs_dotnet_format_options ale-cs.txt /*g:ale_cs_dotnet_format_options* +g:ale_cs_mcs_options ale-cs.txt /*g:ale_cs_mcs_options* +g:ale_cs_mcsc_assemblies ale-cs.txt /*g:ale_cs_mcsc_assemblies* +g:ale_cs_mcsc_assembly_path ale-cs.txt /*g:ale_cs_mcsc_assembly_path* +g:ale_cs_mcsc_options ale-cs.txt /*g:ale_cs_mcsc_options* +g:ale_cs_mcsc_source ale-cs.txt /*g:ale_cs_mcsc_source* +g:ale_cspell_executable ale.txt /*g:ale_cspell_executable* +g:ale_cspell_options ale.txt /*g:ale_cspell_options* +g:ale_cspell_use_global ale.txt /*g:ale_cspell_use_global* +g:ale_css_css_beautify_executable ale-css.txt /*g:ale_css_css_beautify_executable* +g:ale_css_css_beautify_options ale-css.txt /*g:ale_css_css_beautify_options* +g:ale_css_css_beautify_use_global ale-css.txt /*g:ale_css_css_beautify_use_global* +g:ale_css_stylelint_executable ale-css.txt /*g:ale_css_stylelint_executable* +g:ale_css_stylelint_options ale-css.txt /*g:ale_css_stylelint_options* +g:ale_css_stylelint_use_global ale-css.txt /*g:ale_css_stylelint_use_global* +g:ale_cuda_clangd_executable ale-cuda.txt /*g:ale_cuda_clangd_executable* +g:ale_cuda_clangd_options ale-cuda.txt /*g:ale_cuda_clangd_options* +g:ale_cuda_nvcc_executable ale-cuda.txt /*g:ale_cuda_nvcc_executable* +g:ale_cuda_nvcc_options ale-cuda.txt /*g:ale_cuda_nvcc_options* +g:ale_cursor_detail ale.txt /*g:ale_cursor_detail* +g:ale_d_dfmt_options ale-d.txt /*g:ale_d_dfmt_options* +g:ale_d_dls_executable ale-d.txt /*g:ale_d_dls_executable* +g:ale_dafny_dafny_timelimit ale-dafny.txt /*g:ale_dafny_dafny_timelimit* +g:ale_dart_analysis_server_executable ale-dart.txt /*g:ale_dart_analysis_server_executable* +g:ale_dart_analyze_executable ale-dart.txt /*g:ale_dart_analyze_executable* +g:ale_dart_dartfmt_executable ale-dart.txt /*g:ale_dart_dartfmt_executable* +g:ale_dart_dartfmt_options ale-dart.txt /*g:ale_dart_dartfmt_options* +g:ale_dart_format_executable ale-dart.txt /*g:ale_dart_format_executable* +g:ale_dart_format_options ale-dart.txt /*g:ale_dart_format_options* +g:ale_default_navigation ale.txt /*g:ale_default_navigation* +g:ale_deno_executable ale-typescript.txt /*g:ale_deno_executable* +g:ale_deno_importMap ale-typescript.txt /*g:ale_deno_importMap* +g:ale_deno_lsp_project_root ale-typescript.txt /*g:ale_deno_lsp_project_root* +g:ale_deno_unstable ale-typescript.txt /*g:ale_deno_unstable* +g:ale_desktop_desktop_file_validate_options ale-desktop.txt /*g:ale_desktop_desktop_file_validate_options* +g:ale_detail_to_floating_preview ale.txt /*g:ale_detail_to_floating_preview* +g:ale_dhall_executable ale-dhall.txt /*g:ale_dhall_executable* +g:ale_dhall_freeze_options ale-dhall.txt /*g:ale_dhall_freeze_options* +g:ale_dhall_options ale-dhall.txt /*g:ale_dhall_options* +g:ale_disable_lsp ale.txt /*g:ale_disable_lsp* +g:ale_dockerfile_dockerfile_lint_executable ale-dockerfile.txt /*g:ale_dockerfile_dockerfile_lint_executable* +g:ale_dockerfile_dockerfile_lint_options ale-dockerfile.txt /*g:ale_dockerfile_dockerfile_lint_options* +g:ale_dockerfile_hadolint_image ale-dockerfile.txt /*g:ale_dockerfile_hadolint_image* +g:ale_dockerfile_hadolint_options ale-dockerfile.txt /*g:ale_dockerfile_hadolint_options* +g:ale_dockerfile_hadolint_use_docker ale-dockerfile.txt /*g:ale_dockerfile_hadolint_use_docker* +g:ale_dprint_config ale.txt /*g:ale_dprint_config* +g:ale_dprint_executable ale.txt /*g:ale_dprint_executable* +g:ale_dprint_options ale.txt /*g:ale_dprint_options* +g:ale_dprint_use_global ale.txt /*g:ale_dprint_use_global* +g:ale_echo_cursor ale.txt /*g:ale_echo_cursor* +g:ale_echo_delay ale.txt /*g:ale_echo_delay* +g:ale_echo_msg_error_str ale.txt /*g:ale_echo_msg_error_str* +g:ale_echo_msg_format ale.txt /*g:ale_echo_msg_format* +g:ale_echo_msg_info_str ale.txt /*g:ale_echo_msg_info_str* +g:ale_echo_msg_log_str ale.txt /*g:ale_echo_msg_log_str* +g:ale_echo_msg_warning_str ale.txt /*g:ale_echo_msg_warning_str* +g:ale_elixir_credo_config_file ale-elixir.txt /*g:ale_elixir_credo_config_file* +g:ale_elixir_credo_strict ale-elixir.txt /*g:ale_elixir_credo_strict* +g:ale_elixir_elixir_ls_config ale-elixir.txt /*g:ale_elixir_elixir_ls_config* +g:ale_elixir_elixir_ls_release ale-elixir.txt /*g:ale_elixir_elixir_ls_release* +g:ale_elixir_mix_format_options ale-elixir.txt /*g:ale_elixir_mix_format_options* +g:ale_elixir_mix_options ale-elixir.txt /*g:ale_elixir_mix_options* +g:ale_elm_format_executable ale-elm.txt /*g:ale_elm_format_executable* +g:ale_elm_format_options ale-elm.txt /*g:ale_elm_format_options* +g:ale_elm_format_use_global ale-elm.txt /*g:ale_elm_format_use_global* +g:ale_elm_ls_elm_analyse_trigger ale-elm.txt /*g:ale_elm_ls_elm_analyse_trigger* +g:ale_elm_ls_elm_format_path ale-elm.txt /*g:ale_elm_ls_elm_format_path* +g:ale_elm_ls_elm_path ale-elm.txt /*g:ale_elm_ls_elm_path* +g:ale_elm_ls_elm_test_path ale-elm.txt /*g:ale_elm_ls_elm_test_path* +g:ale_elm_ls_executable ale-elm.txt /*g:ale_elm_ls_executable* +g:ale_elm_ls_use_global ale-elm.txt /*g:ale_elm_ls_use_global* +g:ale_elm_make_executable ale-elm.txt /*g:ale_elm_make_executable* +g:ale_elm_make_use_global ale-elm.txt /*g:ale_elm_make_use_global* +g:ale_enabled ale.txt /*g:ale_enabled* +g:ale_erlang_dialyzer_executable ale-erlang.txt /*g:ale_erlang_dialyzer_executable* +g:ale_erlang_dialyzer_options ale-erlang.txt /*g:ale_erlang_dialyzer_options* +g:ale_erlang_dialyzer_plt_file ale-erlang.txt /*g:ale_erlang_dialyzer_plt_file* +g:ale_erlang_dialyzer_rebar3_profile ale-erlang.txt /*g:ale_erlang_dialyzer_rebar3_profile* +g:ale_erlang_elvis_executable ale-erlang.txt /*g:ale_erlang_elvis_executable* +g:ale_erlang_erlang_ls_executable ale-erlang.txt /*g:ale_erlang_erlang_ls_executable* +g:ale_erlang_erlang_ls_log_dir ale-erlang.txt /*g:ale_erlang_erlang_ls_log_dir* +g:ale_erlang_erlang_ls_log_level ale-erlang.txt /*g:ale_erlang_erlang_ls_log_level* +g:ale_erlang_erlc_executable ale-erlang.txt /*g:ale_erlang_erlc_executable* +g:ale_erlang_erlc_options ale-erlang.txt /*g:ale_erlang_erlc_options* +g:ale_erlang_erlfmt_executable ale-erlang.txt /*g:ale_erlang_erlfmt_executable* +g:ale_erlang_erlfmt_options ale-erlang.txt /*g:ale_erlang_erlfmt_options* +g:ale_erlang_syntaxerl_executable ale-erlang.txt /*g:ale_erlang_syntaxerl_executable* +g:ale_eruby_erblint_executable ale-eruby.txt /*g:ale_eruby_erblint_executable* +g:ale_eruby_ruumba_executable ale-eruby.txt /*g:ale_eruby_ruumba_executable* +g:ale_exclude_highlights ale.txt /*g:ale_exclude_highlights* +g:ale_filename_mappings ale.txt /*g:ale_filename_mappings* +g:ale_fish_fish_indent_executable ale-fish.txt /*g:ale_fish_fish_indent_executable* +g:ale_fish_fish_indent_options ale-fish.txt /*g:ale_fish_fish_indent_options* +g:ale_fix_on_save ale.txt /*g:ale_fix_on_save* +g:ale_fix_on_save_ignore ale.txt /*g:ale_fix_on_save_ignore* +g:ale_fixers ale.txt /*g:ale_fixers* +g:ale_floating_preview ale.txt /*g:ale_floating_preview* +g:ale_floating_preview_popup_opts ale.txt /*g:ale_floating_preview_popup_opts* +g:ale_floating_window_border ale.txt /*g:ale_floating_window_border* +g:ale_fortran_gcc_executable ale-fortran.txt /*g:ale_fortran_gcc_executable* +g:ale_fortran_gcc_options ale-fortran.txt /*g:ale_fortran_gcc_options* +g:ale_fortran_gcc_use_free_form ale-fortran.txt /*g:ale_fortran_gcc_use_free_form* +g:ale_fortran_language_server_executable ale-fortran.txt /*g:ale_fortran_language_server_executable* +g:ale_fortran_language_server_use_global ale-fortran.txt /*g:ale_fortran_language_server_use_global* +g:ale_fuse_fusionlint_executable ale-fuse.txt /*g:ale_fuse_fusionlint_executable* +g:ale_fuse_fusionlint_options ale-fuse.txt /*g:ale_fuse_fusionlint_options* +g:ale_gitcommit_gitlint_executable ale-gitcommit.txt /*g:ale_gitcommit_gitlint_executable* +g:ale_gitcommit_gitlint_options ale-gitcommit.txt /*g:ale_gitcommit_gitlint_options* +g:ale_gitcommit_gitlint_use_global ale-gitcommit.txt /*g:ale_gitcommit_gitlint_use_global* +g:ale_glsl_glslang_executable ale-glsl.txt /*g:ale_glsl_glslang_executable* +g:ale_glsl_glslang_options ale-glsl.txt /*g:ale_glsl_glslang_options* +g:ale_glsl_glslls_executable ale-glsl.txt /*g:ale_glsl_glslls_executable* +g:ale_glsl_glslls_logfile ale-glsl.txt /*g:ale_glsl_glslls_logfile* +g:ale_go_bingo_executable ale-go.txt /*g:ale_go_bingo_executable* +g:ale_go_bingo_options ale-go.txt /*g:ale_go_bingo_options* +g:ale_go_go111module ale-go.txt /*g:ale_go_go111module* +g:ale_go_go_executable ale-go.txt /*g:ale_go_go_executable* +g:ale_go_gobuild_options ale-go.txt /*g:ale_go_gobuild_options* +g:ale_go_gofmt_options ale-go.txt /*g:ale_go_gofmt_options* +g:ale_go_gofumpt_executable ale-go.txt /*g:ale_go_gofumpt_executable* +g:ale_go_gofumpt_options ale-go.txt /*g:ale_go_gofumpt_options* +g:ale_go_golangci_lint_executable ale-go.txt /*g:ale_go_golangci_lint_executable* +g:ale_go_golangci_lint_options ale-go.txt /*g:ale_go_golangci_lint_options* +g:ale_go_golangci_lint_package ale-go.txt /*g:ale_go_golangci_lint_package* +g:ale_go_golines_options ale-go.txt /*g:ale_go_golines_options* +g:ale_go_golint_executable ale-go.txt /*g:ale_go_golint_executable* +g:ale_go_golint_options ale-go.txt /*g:ale_go_golint_options* +g:ale_go_gometalinter_executable ale-go.txt /*g:ale_go_gometalinter_executable* +g:ale_go_gometalinter_lint_package ale-go.txt /*g:ale_go_gometalinter_lint_package* +g:ale_go_gometalinter_options ale-go.txt /*g:ale_go_gometalinter_options* +g:ale_go_gopls_executable ale-go.txt /*g:ale_go_gopls_executable* +g:ale_go_gopls_init_options ale-go.txt /*g:ale_go_gopls_init_options* +g:ale_go_gopls_options ale-go.txt /*g:ale_go_gopls_options* +g:ale_go_gopls_use_global ale-go.txt /*g:ale_go_gopls_use_global* +g:ale_go_govet_options ale-go.txt /*g:ale_go_govet_options* +g:ale_go_langserver_executable ale-go.txt /*g:ale_go_langserver_executable* +g:ale_go_langserver_options ale-go.txt /*g:ale_go_langserver_options* +g:ale_go_lines_executable ale-go.txt /*g:ale_go_lines_executable* +g:ale_go_revive_executable ale-go.txt /*g:ale_go_revive_executable* +g:ale_go_revive_options ale-go.txt /*g:ale_go_revive_options* +g:ale_go_staticcheck_executable ale-go.txt /*g:ale_go_staticcheck_executable* +g:ale_go_staticcheck_lint_package ale-go.txt /*g:ale_go_staticcheck_lint_package* +g:ale_go_staticcheck_options ale-go.txt /*g:ale_go_staticcheck_options* +g:ale_go_staticcheck_use_global ale-go.txt /*g:ale_go_staticcheck_use_global* +g:ale_hack_hack_executable ale-hack.txt /*g:ale_hack_hack_executable* +g:ale_hack_hackfmt_options ale-hack.txt /*g:ale_hack_hackfmt_options* +g:ale_hack_hhast_executable ale-hack.txt /*g:ale_hack_hhast_executable* +g:ale_handlebars_embertemplatelint_executable ale-handlebars.txt /*g:ale_handlebars_embertemplatelint_executable* +g:ale_handlebars_embertemplatelint_use_global ale-handlebars.txt /*g:ale_handlebars_embertemplatelint_use_global* +g:ale_haskell_brittany_executable ale-haskell.txt /*g:ale_haskell_brittany_executable* +g:ale_haskell_cabal_ghc_options ale-haskell.txt /*g:ale_haskell_cabal_ghc_options* +g:ale_haskell_floskell_executable ale-haskell.txt /*g:ale_haskell_floskell_executable* +g:ale_haskell_ghc_mod_executable ale-haskell.txt /*g:ale_haskell_ghc_mod_executable* +g:ale_haskell_ghc_options ale-haskell.txt /*g:ale_haskell_ghc_options* +g:ale_haskell_hdevtools_executable ale-haskell.txt /*g:ale_haskell_hdevtools_executable* +g:ale_haskell_hdevtools_options ale-haskell.txt /*g:ale_haskell_hdevtools_options* +g:ale_haskell_hfmt_executable ale-haskell.txt /*g:ale_haskell_hfmt_executable* +g:ale_haskell_hie_executable ale-haskell.txt /*g:ale_haskell_hie_executable* +g:ale_haskell_hindent_executable ale-haskell.txt /*g:ale_haskell_hindent_executable* +g:ale_haskell_hlint_executable ale-haskell.txt /*g:ale_haskell_hlint_executable* +g:ale_haskell_hls_config ale-haskell.txt /*g:ale_haskell_hls_config* +g:ale_haskell_hls_executable ale-haskell.txt /*g:ale_haskell_hls_executable* +g:ale_haskell_ormolu_executable ale-haskell.txt /*g:ale_haskell_ormolu_executable* +g:ale_haskell_ormolu_options ale-haskell.txt /*g:ale_haskell_ormolu_options* +g:ale_haskell_stack_build_options ale-haskell.txt /*g:ale_haskell_stack_build_options* +g:ale_haskell_stack_ghc_options ale-haskell.txt /*g:ale_haskell_stack_ghc_options* +g:ale_haskell_stylish_haskell_executable ale-haskell.txt /*g:ale_haskell_stylish_haskell_executable* +g:ale_hdl_checker_config_file ale-vhdl.txt /*g:ale_hdl_checker_config_file* +g:ale_hdl_checker_executable ale-vhdl.txt /*g:ale_hdl_checker_executable* +g:ale_hdl_checker_options ale-vhdl.txt /*g:ale_hdl_checker_options* +g:ale_history_enabled ale.txt /*g:ale_history_enabled* +g:ale_history_log_output ale.txt /*g:ale_history_log_output* +g:ale_hover_cursor ale.txt /*g:ale_hover_cursor* +g:ale_hover_to_floating_preview ale.txt /*g:ale_hover_to_floating_preview* +g:ale_hover_to_preview ale.txt /*g:ale_hover_to_preview* +g:ale_html_angular_executable ale-html.txt /*g:ale_html_angular_executable* +g:ale_html_angular_use_global ale-html.txt /*g:ale_html_angular_use_global* +g:ale_html_beautify_executable ale-html.txt /*g:ale_html_beautify_executable* +g:ale_html_beautify_options ale-html.txt /*g:ale_html_beautify_options* +g:ale_html_beautify_use_global ale-html.txt /*g:ale_html_beautify_use_global* +g:ale_html_htmlhint_executable ale-html.txt /*g:ale_html_htmlhint_executable* +g:ale_html_htmlhint_options ale-html.txt /*g:ale_html_htmlhint_options* +g:ale_html_htmlhint_use_global ale-html.txt /*g:ale_html_htmlhint_use_global* +g:ale_html_stylelint_executable ale-html.txt /*g:ale_html_stylelint_executable* +g:ale_html_stylelint_options ale-html.txt /*g:ale_html_stylelint_options* +g:ale_html_stylelint_use_global ale-html.txt /*g:ale_html_stylelint_use_global* +g:ale_html_tidy_executable ale-html.txt /*g:ale_html_tidy_executable* +g:ale_html_tidy_options ale-html.txt /*g:ale_html_tidy_options* +g:ale_idris_idris_executable ale-idris.txt /*g:ale_idris_idris_executable* +g:ale_idris_idris_options ale-idris.txt /*g:ale_idris_idris_options* +g:ale_inko_inko_executable ale-inko.txt /*g:ale_inko_inko_executable* +g:ale_ispc_ispc_executable ale-ispc.txt /*g:ale_ispc_ispc_executable* +g:ale_ispc_ispc_options ale-ispc.txt /*g:ale_ispc_ispc_options* +g:ale_java_checkstyle_config ale-java.txt /*g:ale_java_checkstyle_config* +g:ale_java_checkstyle_executable ale-java.txt /*g:ale_java_checkstyle_executable* +g:ale_java_checkstyle_options ale-java.txt /*g:ale_java_checkstyle_options* +g:ale_java_eclipse_config_path ale-java.txt /*g:ale_java_eclipse_config_path* +g:ale_java_eclipse_executable ale-java.txt /*g:ale_java_eclipse_executable* +g:ale_java_eclipselsp_javaagent ale-java.txt /*g:ale_java_eclipselsp_javaagent* +g:ale_java_eclipselsp_path ale-java.txt /*g:ale_java_eclipselsp_path* +g:ale_java_eclipselsp_workspace_path ale-java.txt /*g:ale_java_eclipselsp_workspace_path* +g:ale_java_google_java_format_executable ale-java.txt /*g:ale_java_google_java_format_executable* +g:ale_java_google_java_format_options ale-java.txt /*g:ale_java_google_java_format_options* +g:ale_java_javac_classpath ale-java.txt /*g:ale_java_javac_classpath* +g:ale_java_javac_executable ale-java.txt /*g:ale_java_javac_executable* +g:ale_java_javac_options ale-java.txt /*g:ale_java_javac_options* +g:ale_java_javac_sourcepath ale-java.txt /*g:ale_java_javac_sourcepath* +g:ale_java_javalsp_config ale-java.txt /*g:ale_java_javalsp_config* +g:ale_java_javalsp_executable ale-java.txt /*g:ale_java_javalsp_executable* +g:ale_java_pmd_options ale-java.txt /*g:ale_java_pmd_options* +g:ale_javascript_eslint_executable ale-javascript.txt /*g:ale_javascript_eslint_executable* +g:ale_javascript_eslint_options ale-javascript.txt /*g:ale_javascript_eslint_options* +g:ale_javascript_eslint_suppress_eslintignore ale-javascript.txt /*g:ale_javascript_eslint_suppress_eslintignore* +g:ale_javascript_eslint_suppress_missing_config ale-javascript.txt /*g:ale_javascript_eslint_suppress_missing_config* +g:ale_javascript_eslint_use_global ale-javascript.txt /*g:ale_javascript_eslint_use_global* +g:ale_javascript_fecs_executable ale-javascript.txt /*g:ale_javascript_fecs_executable* +g:ale_javascript_fecs_use_global ale-javascript.txt /*g:ale_javascript_fecs_use_global* +g:ale_javascript_flow_executable ale-javascript.txt /*g:ale_javascript_flow_executable* +g:ale_javascript_flow_use_global ale-javascript.txt /*g:ale_javascript_flow_use_global* +g:ale_javascript_flow_use_home_config ale-javascript.txt /*g:ale_javascript_flow_use_home_config* +g:ale_javascript_flow_use_respect_pragma ale-javascript.txt /*g:ale_javascript_flow_use_respect_pragma* +g:ale_javascript_importjs_executable ale-javascript.txt /*g:ale_javascript_importjs_executable* +g:ale_javascript_jscs_executable ale-javascript.txt /*g:ale_javascript_jscs_executable* +g:ale_javascript_jscs_use_global ale-javascript.txt /*g:ale_javascript_jscs_use_global* +g:ale_javascript_jshint_executable ale-javascript.txt /*g:ale_javascript_jshint_executable* +g:ale_javascript_jshint_use_global ale-javascript.txt /*g:ale_javascript_jshint_use_global* +g:ale_javascript_prettier_eslint_executable ale-javascript.txt /*g:ale_javascript_prettier_eslint_executable* +g:ale_javascript_prettier_eslint_options ale-javascript.txt /*g:ale_javascript_prettier_eslint_options* +g:ale_javascript_prettier_eslint_use_global ale-javascript.txt /*g:ale_javascript_prettier_eslint_use_global* +g:ale_javascript_prettier_executable ale-javascript.txt /*g:ale_javascript_prettier_executable* +g:ale_javascript_prettier_options ale-javascript.txt /*g:ale_javascript_prettier_options* +g:ale_javascript_prettier_standard_executable ale-javascript.txt /*g:ale_javascript_prettier_standard_executable* +g:ale_javascript_prettier_standard_options ale-javascript.txt /*g:ale_javascript_prettier_standard_options* +g:ale_javascript_prettier_standard_use_global ale-javascript.txt /*g:ale_javascript_prettier_standard_use_global* +g:ale_javascript_prettier_use_global ale-javascript.txt /*g:ale_javascript_prettier_use_global* +g:ale_javascript_standard_executable ale-javascript.txt /*g:ale_javascript_standard_executable* +g:ale_javascript_standard_options ale-javascript.txt /*g:ale_javascript_standard_options* +g:ale_javascript_standard_use_global ale-javascript.txt /*g:ale_javascript_standard_use_global* +g:ale_javascript_xo_executable ale-javascript.txt /*g:ale_javascript_xo_executable* +g:ale_javascript_xo_options ale-javascript.txt /*g:ale_javascript_xo_options* +g:ale_javascript_xo_use_global ale-javascript.txt /*g:ale_javascript_xo_use_global* +g:ale_json_fixjson_executable ale-json.txt /*g:ale_json_fixjson_executable* +g:ale_json_fixjson_options ale-json.txt /*g:ale_json_fixjson_options* +g:ale_json_fixjson_use_global ale-json.txt /*g:ale_json_fixjson_use_global* +g:ale_json_jq_executable ale-json.txt /*g:ale_json_jq_executable* +g:ale_json_jq_filters ale-json.txt /*g:ale_json_jq_filters* +g:ale_json_jq_options ale-json.txt /*g:ale_json_jq_options* +g:ale_json_jsonlint_executable ale-json.txt /*g:ale_json_jsonlint_executable* +g:ale_json_jsonlint_use_global ale-json.txt /*g:ale_json_jsonlint_use_global* +g:ale_json_spectral_executable ale-json.txt /*g:ale_json_spectral_executable* +g:ale_json_spectral_use_global ale-json.txt /*g:ale_json_spectral_use_global* +g:ale_jsonnet_jsonnet_lint_executable ale-jsonnet.txt /*g:ale_jsonnet_jsonnet_lint_executable* +g:ale_jsonnet_jsonnet_lint_options ale-jsonnet.txt /*g:ale_jsonnet_jsonnet_lint_options* +g:ale_jsonnet_jsonnetfmt_executable ale-jsonnet.txt /*g:ale_jsonnet_jsonnetfmt_executable* +g:ale_jsonnet_jsonnetfmt_options ale-jsonnet.txt /*g:ale_jsonnet_jsonnetfmt_options* +g:ale_julia_executable ale-julia.txt /*g:ale_julia_executable* +g:ale_keep_list_window_open ale.txt /*g:ale_keep_list_window_open* +g:ale_kotlin_kotlinc_classpath ale-kotlin.txt /*g:ale_kotlin_kotlinc_classpath* +g:ale_kotlin_kotlinc_config_file ale-kotlin.txt /*g:ale_kotlin_kotlinc_config_file* +g:ale_kotlin_kotlinc_enable_config ale-kotlin.txt /*g:ale_kotlin_kotlinc_enable_config* +g:ale_kotlin_kotlinc_module_filename ale-kotlin.txt /*g:ale_kotlin_kotlinc_module_filename* +g:ale_kotlin_kotlinc_options ale-kotlin.txt /*g:ale_kotlin_kotlinc_options* +g:ale_kotlin_kotlinc_sourcepath ale-kotlin.txt /*g:ale_kotlin_kotlinc_sourcepath* +g:ale_kotlin_kotlinc_use_module_file ale-kotlin.txt /*g:ale_kotlin_kotlinc_use_module_file* +g:ale_kotlin_ktlint_executable ale-kotlin.txt /*g:ale_kotlin_ktlint_executable* +g:ale_kotlin_ktlint_options ale-kotlin.txt /*g:ale_kotlin_ktlint_options* +g:ale_kotlin_ktlint_rulesets ale-kotlin.txt /*g:ale_kotlin_ktlint_rulesets* +g:ale_kotlin_languageserver_executable ale-kotlin.txt /*g:ale_kotlin_languageserver_executable* +g:ale_lacheck_executable ale-tex.txt /*g:ale_lacheck_executable* +g:ale_languagetool_executable ale.txt /*g:ale_languagetool_executable* +g:ale_languagetool_options ale.txt /*g:ale_languagetool_options* +g:ale_less_lessc_executable ale-less.txt /*g:ale_less_lessc_executable* +g:ale_less_lessc_options ale-less.txt /*g:ale_less_lessc_options* +g:ale_less_lessc_use_global ale-less.txt /*g:ale_less_lessc_use_global* +g:ale_less_stylelint_executable ale-less.txt /*g:ale_less_stylelint_executable* +g:ale_less_stylelint_options ale-less.txt /*g:ale_less_stylelint_options* +g:ale_less_stylelint_use_global ale-less.txt /*g:ale_less_stylelint_use_global* +g:ale_lint_delay ale.txt /*g:ale_lint_delay* +g:ale_lint_on_enter ale.txt /*g:ale_lint_on_enter* +g:ale_lint_on_filetype_changed ale.txt /*g:ale_lint_on_filetype_changed* +g:ale_lint_on_insert_leave ale.txt /*g:ale_lint_on_insert_leave* +g:ale_lint_on_save ale.txt /*g:ale_lint_on_save* +g:ale_lint_on_text_changed ale.txt /*g:ale_lint_on_text_changed* +g:ale_linter_aliases ale.txt /*g:ale_linter_aliases* +g:ale_linters ale.txt /*g:ale_linters* +g:ale_linters_explicit ale.txt /*g:ale_linters_explicit* +g:ale_linters_ignore ale.txt /*g:ale_linters_ignore* +g:ale_list_vertical ale.txt /*g:ale_list_vertical* +g:ale_list_window_size ale.txt /*g:ale_list_window_size* +g:ale_llvm_llc_executable ale-llvm.txt /*g:ale_llvm_llc_executable* +g:ale_loclist_msg_format ale.txt /*g:ale_loclist_msg_format* +g:ale_lsp_show_message_format ale.txt /*g:ale_lsp_show_message_format* +g:ale_lsp_show_message_severity ale.txt /*g:ale_lsp_show_message_severity* +g:ale_lsp_suggestions ale.txt /*g:ale_lsp_suggestions* +g:ale_lua_lua_format_executable ale-lua.txt /*g:ale_lua_lua_format_executable* +g:ale_lua_lua_format_options ale-lua.txt /*g:ale_lua_lua_format_options* +g:ale_lua_luac_executable ale-lua.txt /*g:ale_lua_luac_executable* +g:ale_lua_luacheck_executable ale-lua.txt /*g:ale_lua_luacheck_executable* +g:ale_lua_luacheck_options ale-lua.txt /*g:ale_lua_luacheck_options* +g:ale_lua_luafmt_executable ale-lua.txt /*g:ale_lua_luafmt_executable* +g:ale_lua_luafmt_options ale-lua.txt /*g:ale_lua_luafmt_options* +g:ale_lua_selene_executable ale-lua.txt /*g:ale_lua_selene_executable* +g:ale_lua_selene_options ale-lua.txt /*g:ale_lua_selene_options* +g:ale_lua_stylua_executable ale-lua.txt /*g:ale_lua_stylua_executable* +g:ale_lua_stylua_options ale-lua.txt /*g:ale_lua_stylua_options* +g:ale_make_checkmake_config ale-make.txt /*g:ale_make_checkmake_config* +g:ale_markdown_markdownlint_executable ale-markdown.txt /*g:ale_markdown_markdownlint_executable* +g:ale_markdown_markdownlint_options ale-markdown.txt /*g:ale_markdown_markdownlint_options* +g:ale_markdown_mdl_executable ale-markdown.txt /*g:ale_markdown_mdl_executable* +g:ale_markdown_mdl_options ale-markdown.txt /*g:ale_markdown_mdl_options* +g:ale_markdown_pandoc_executable ale-markdown.txt /*g:ale_markdown_pandoc_executable* +g:ale_markdown_pandoc_options ale-markdown.txt /*g:ale_markdown_pandoc_options* +g:ale_markdown_remark_lint_executable ale-markdown.txt /*g:ale_markdown_remark_lint_executable* +g:ale_markdown_remark_lint_options ale-markdown.txt /*g:ale_markdown_remark_lint_options* +g:ale_markdown_remark_lint_use_global ale-markdown.txt /*g:ale_markdown_remark_lint_use_global* +g:ale_max_buffer_history_size ale.txt /*g:ale_max_buffer_history_size* +g:ale_max_signs ale.txt /*g:ale_max_signs* +g:ale_maximum_file_size ale.txt /*g:ale_maximum_file_size* +g:ale_mercury_mmc_executable ale-mercury.txt /*g:ale_mercury_mmc_executable* +g:ale_mercury_mmc_options ale-mercury.txt /*g:ale_mercury_mmc_options* +g:ale_nasm_nasm_executable ale-nasm.txt /*g:ale_nasm_nasm_executable* +g:ale_nasm_nasm_options ale-nasm.txt /*g:ale_nasm_nasm_options* +g:ale_nim_nimpretty_executable ale-nim.txt /*g:ale_nim_nimpretty_executable* +g:ale_nim_nimpretty_options ale-nim.txt /*g:ale_nim_nimpretty_options* +g:ale_nix_fix_check_executable ale-nix.txt /*g:ale_nix_fix_check_executable* +g:ale_nix_nixfmt_executable ale-nix.txt /*g:ale_nix_nixfmt_executable* +g:ale_nix_nixfmt_options ale-nix.txt /*g:ale_nix_nixfmt_options* +g:ale_nix_nixpkgsfmt_executable ale-nix.txt /*g:ale_nix_nixpkgsfmt_executable* +g:ale_nix_nixpkgsfmt_options ale-nix.txt /*g:ale_nix_nixpkgsfmt_options* +g:ale_nix_statix_check_executable ale-nix.txt /*g:ale_nix_statix_check_executable* +g:ale_nix_statix_check_options ale-nix.txt /*g:ale_nix_statix_check_options* +g:ale_nix_statix_fix_options ale-nix.txt /*g:ale_nix_statix_fix_options* +g:ale_objc_ccls_executable ale-objc.txt /*g:ale_objc_ccls_executable* +g:ale_objc_ccls_init_options ale-objc.txt /*g:ale_objc_ccls_init_options* +g:ale_objc_clang_options ale-objc.txt /*g:ale_objc_clang_options* +g:ale_objc_clangd_executable ale-objc.txt /*g:ale_objc_clangd_executable* +g:ale_objc_clangd_options ale-objc.txt /*g:ale_objc_clangd_options* +g:ale_objcpp_clang_options ale-objcpp.txt /*g:ale_objcpp_clang_options* +g:ale_objcpp_clangd_executable ale-objcpp.txt /*g:ale_objcpp_clangd_executable* +g:ale_objcpp_clangd_options ale-objcpp.txt /*g:ale_objcpp_clangd_options* +g:ale_ocaml_dune_executable ale-ocaml.txt /*g:ale_ocaml_dune_executable* +g:ale_ocaml_dune_options ale-ocaml.txt /*g:ale_ocaml_dune_options* +g:ale_ocaml_ocamlformat_executable ale-ocaml.txt /*g:ale_ocaml_ocamlformat_executable* +g:ale_ocaml_ocamlformat_options ale-ocaml.txt /*g:ale_ocaml_ocamlformat_options* +g:ale_ocaml_ocamllsp_use_opam ale-ocaml.txt /*g:ale_ocaml_ocamllsp_use_opam* +g:ale_ocaml_ocp_indent_config ale-ocaml.txt /*g:ale_ocaml_ocp_indent_config* +g:ale_ocaml_ocp_indent_executable ale-ocaml.txt /*g:ale_ocaml_ocp_indent_executable* +g:ale_ocaml_ocp_indent_options ale-ocaml.txt /*g:ale_ocaml_ocp_indent_options* +g:ale_ocaml_ols_executable ale-ocaml.txt /*g:ale_ocaml_ols_executable* +g:ale_ocaml_ols_use_global ale-ocaml.txt /*g:ale_ocaml_ols_use_global* +g:ale_opa_fmt_executable ale-rego.txt /*g:ale_opa_fmt_executable* +g:ale_opa_fmt_options ale-rego.txt /*g:ale_opa_fmt_options* +g:ale_open_list ale.txt /*g:ale_open_list* +g:ale_openapi_ibm_validator_executable ale-openapi.txt /*g:ale_openapi_ibm_validator_executable* +g:ale_openapi_ibm_validator_options ale-openapi.txt /*g:ale_openapi_ibm_validator_options* +g:ale_openscad_sca2d_executable ale-openscad.txt /*g:ale_openscad_sca2d_executable* +g:ale_openscad_sca2d_options ale-openscad.txt /*g:ale_openscad_sca2d_options* +g:ale_packer_fmt_executable ale-packer.txt /*g:ale_packer_fmt_executable* +g:ale_packer_fmt_options ale-packer.txt /*g:ale_packer_fmt_options* +g:ale_pascal_ptop_executable ale-pascal.txt /*g:ale_pascal_ptop_executable* +g:ale_pascal_ptop_options ale-pascal.txt /*g:ale_pascal_ptop_options* +g:ale_pattern_options ale.txt /*g:ale_pattern_options* +g:ale_pattern_options_enabled ale.txt /*g:ale_pattern_options_enabled* +g:ale_perl6_perl6_executable ale-perl6.txt /*g:ale_perl6_perl6_executable* +g:ale_perl6_perl6_options ale-perl6.txt /*g:ale_perl6_perl6_options* +g:ale_perl_perl_executable ale-perl.txt /*g:ale_perl_perl_executable* +g:ale_perl_perl_options ale-perl.txt /*g:ale_perl_perl_options* +g:ale_perl_perlcritic_executable ale-perl.txt /*g:ale_perl_perlcritic_executable* +g:ale_perl_perlcritic_options ale-perl.txt /*g:ale_perl_perlcritic_options* +g:ale_perl_perlcritic_profile ale-perl.txt /*g:ale_perl_perlcritic_profile* +g:ale_perl_perlcritic_showrules ale-perl.txt /*g:ale_perl_perlcritic_showrules* +g:ale_perl_perltidy_options ale-perl.txt /*g:ale_perl_perltidy_options* +g:ale_php_cs_fixer_executable ale-php.txt /*g:ale_php_cs_fixer_executable* +g:ale_php_cs_fixer_options ale-php.txt /*g:ale_php_cs_fixer_options* +g:ale_php_cs_fixer_use_global ale-php.txt /*g:ale_php_cs_fixer_use_global* +g:ale_php_intelephense_config ale-php.txt /*g:ale_php_intelephense_config* +g:ale_php_intelephense_executable ale-php.txt /*g:ale_php_intelephense_executable* +g:ale_php_intelephense_use_global ale-php.txt /*g:ale_php_intelephense_use_global* +g:ale_php_langserver_executable ale-php.txt /*g:ale_php_langserver_executable* +g:ale_php_langserver_use_global ale-php.txt /*g:ale_php_langserver_use_global* +g:ale_php_phan_executable ale-php.txt /*g:ale_php_phan_executable* +g:ale_php_phan_minimum_severity ale-php.txt /*g:ale_php_phan_minimum_severity* +g:ale_php_phan_use_client ale-php.txt /*g:ale_php_phan_use_client* +g:ale_php_php_executable ale-php.txt /*g:ale_php_php_executable* +g:ale_php_phpcbf_executable ale-php.txt /*g:ale_php_phpcbf_executable* +g:ale_php_phpcbf_options ale-php.txt /*g:ale_php_phpcbf_options* +g:ale_php_phpcbf_standard ale-php.txt /*g:ale_php_phpcbf_standard* +g:ale_php_phpcbf_use_global ale-php.txt /*g:ale_php_phpcbf_use_global* +g:ale_php_phpcs_executable ale-php.txt /*g:ale_php_phpcs_executable* +g:ale_php_phpcs_options ale-php.txt /*g:ale_php_phpcs_options* +g:ale_php_phpcs_standard ale-php.txt /*g:ale_php_phpcs_standard* +g:ale_php_phpcs_use_global ale-php.txt /*g:ale_php_phpcs_use_global* +g:ale_php_phpmd_executable ale-php.txt /*g:ale_php_phpmd_executable* +g:ale_php_phpmd_ruleset ale-php.txt /*g:ale_php_phpmd_ruleset* +g:ale_php_phpstan_autoload ale-php.txt /*g:ale_php_phpstan_autoload* +g:ale_php_phpstan_configuration ale-php.txt /*g:ale_php_phpstan_configuration* +g:ale_php_phpstan_executable ale-php.txt /*g:ale_php_phpstan_executable* +g:ale_php_phpstan_level ale-php.txt /*g:ale_php_phpstan_level* +g:ale_php_phpstan_memory-limit ale-php.txt /*g:ale_php_phpstan_memory-limit* +g:ale_php_pint_executable ale-php.txt /*g:ale_php_pint_executable* +g:ale_php_pint_options ale-php.txt /*g:ale_php_pint_options* +g:ale_php_pint_use_global ale-php.txt /*g:ale_php_pint_use_global* +g:ale_php_psalm_executable ale-php.txt /*g:ale_php_psalm_executable* +g:ale_php_psalm_options ale-php.txt /*g:ale_php_psalm_options* +g:ale_php_psalm_use_global ale-php.txt /*g:ale_php_psalm_use_global* +g:ale_php_tlint_executable ale-php.txt /*g:ale_php_tlint_executable* +g:ale_php_tlint_options ale-php.txt /*g:ale_php_tlint_options* +g:ale_php_tlint_use_global ale-php.txt /*g:ale_php_tlint_use_global* +g:ale_pony_ponyc_executable ale-pony.txt /*g:ale_pony_ponyc_executable* +g:ale_pony_ponyc_options ale-pony.txt /*g:ale_pony_ponyc_options* +g:ale_popup_menu_enabled ale.txt /*g:ale_popup_menu_enabled* +g:ale_powershell_powershell_executable ale-powershell.txt /*g:ale_powershell_powershell_executable* +g:ale_powershell_psscriptanalyzer_exclusions ale-powershell.txt /*g:ale_powershell_psscriptanalyzer_exclusions* +g:ale_powershell_psscriptanalyzer_executable ale-powershell.txt /*g:ale_powershell_psscriptanalyzer_executable* +g:ale_powershell_psscriptanalyzer_module ale-powershell.txt /*g:ale_powershell_psscriptanalyzer_module* +g:ale_prolog_swipl_alarm ale-prolog.txt /*g:ale_prolog_swipl_alarm* +g:ale_prolog_swipl_alarm_handler ale-prolog.txt /*g:ale_prolog_swipl_alarm_handler* +g:ale_prolog_swipl_executable ale-prolog.txt /*g:ale_prolog_swipl_executable* +g:ale_prolog_swipl_load ale-prolog.txt /*g:ale_prolog_swipl_load* +g:ale_prolog_swipl_timeout ale-prolog.txt /*g:ale_prolog_swipl_timeout* +g:ale_proto_buf_format_executable ale-proto.txt /*g:ale_proto_buf_format_executable* +g:ale_proto_buf_lint_config ale-proto.txt /*g:ale_proto_buf_lint_config* +g:ale_proto_buf_lint_executable ale-proto.txt /*g:ale_proto_buf_lint_executable* +g:ale_proto_protoc_gen_lint_options ale-proto.txt /*g:ale_proto_protoc_gen_lint_options* +g:ale_proto_protolint_config ale-proto.txt /*g:ale_proto_protolint_config* +g:ale_proto_protolint_executable ale-proto.txt /*g:ale_proto_protolint_executable* +g:ale_pug_puglint_executable ale-pug.txt /*g:ale_pug_puglint_executable* +g:ale_pug_puglint_options ale-pug.txt /*g:ale_pug_puglint_options* +g:ale_pug_puglint_use_global ale-pug.txt /*g:ale_pug_puglint_use_global* +g:ale_puppet_languageserver_executable ale-puppet.txt /*g:ale_puppet_languageserver_executable* +g:ale_puppet_puppet_executable ale-puppet.txt /*g:ale_puppet_puppet_executable* +g:ale_puppet_puppet_options ale-puppet.txt /*g:ale_puppet_puppet_options* +g:ale_puppet_puppetlint_executable ale-puppet.txt /*g:ale_puppet_puppetlint_executable* +g:ale_puppet_puppetlint_options ale-puppet.txt /*g:ale_puppet_puppetlint_options* +g:ale_purescript_purty_executable ale-purescript.txt /*g:ale_purescript_purty_executable* +g:ale_purescript_tidy_executable ale-purescript.txt /*g:ale_purescript_tidy_executable* +g:ale_purescript_tidy_options ale-purescript.txt /*g:ale_purescript_tidy_options* +g:ale_purescript_tidy_use_global ale-purescript.txt /*g:ale_purescript_tidy_use_global* +g:ale_pyrex_cython_executable ale-pyrex.txt /*g:ale_pyrex_cython_executable* +g:ale_pyrex_cython_options ale-pyrex.txt /*g:ale_pyrex_cython_options* +g:ale_python_auto_pipenv ale-python.txt /*g:ale_python_auto_pipenv* +g:ale_python_auto_poetry ale-python.txt /*g:ale_python_auto_poetry* +g:ale_python_autoflake_executable ale-python.txt /*g:ale_python_autoflake_executable* +g:ale_python_autoflake_options ale-python.txt /*g:ale_python_autoflake_options* +g:ale_python_autoflake_use_global ale-python.txt /*g:ale_python_autoflake_use_global* +g:ale_python_autoimport_executable ale-python.txt /*g:ale_python_autoimport_executable* +g:ale_python_autoimport_options ale-python.txt /*g:ale_python_autoimport_options* +g:ale_python_autoimport_use_global ale-python.txt /*g:ale_python_autoimport_use_global* +g:ale_python_autopep8_executable ale-python.txt /*g:ale_python_autopep8_executable* +g:ale_python_autopep8_options ale-python.txt /*g:ale_python_autopep8_options* +g:ale_python_autopep8_use_global ale-python.txt /*g:ale_python_autopep8_use_global* +g:ale_python_bandit_auto_pipenv ale-python.txt /*g:ale_python_bandit_auto_pipenv* +g:ale_python_bandit_auto_poetry ale-python.txt /*g:ale_python_bandit_auto_poetry* +g:ale_python_bandit_executable ale-python.txt /*g:ale_python_bandit_executable* +g:ale_python_bandit_options ale-python.txt /*g:ale_python_bandit_options* +g:ale_python_bandit_use_config ale-python.txt /*g:ale_python_bandit_use_config* +g:ale_python_bandit_use_global ale-python.txt /*g:ale_python_bandit_use_global* +g:ale_python_black_auto_pipenv ale-python.txt /*g:ale_python_black_auto_pipenv* +g:ale_python_black_auto_poetry ale-python.txt /*g:ale_python_black_auto_poetry* +g:ale_python_black_change_directory ale-python.txt /*g:ale_python_black_change_directory* +g:ale_python_black_executable ale-python.txt /*g:ale_python_black_executable* +g:ale_python_black_options ale-python.txt /*g:ale_python_black_options* +g:ale_python_black_use_global ale-python.txt /*g:ale_python_black_use_global* +g:ale_python_flake8_auto_pipenv ale-python.txt /*g:ale_python_flake8_auto_pipenv* +g:ale_python_flake8_auto_poetry ale-python.txt /*g:ale_python_flake8_auto_poetry* +g:ale_python_flake8_change_directory ale-python.txt /*g:ale_python_flake8_change_directory* +g:ale_python_flake8_executable ale-python.txt /*g:ale_python_flake8_executable* +g:ale_python_flake8_options ale-python.txt /*g:ale_python_flake8_options* +g:ale_python_flake8_use_global ale-python.txt /*g:ale_python_flake8_use_global* +g:ale_python_flakehell_auto_pipenv ale-python.txt /*g:ale_python_flakehell_auto_pipenv* +g:ale_python_flakehell_auto_poetry ale-python.txt /*g:ale_python_flakehell_auto_poetry* +g:ale_python_flakehell_executable ale-python.txt /*g:ale_python_flakehell_executable* +g:ale_python_flakehell_options ale-python.txt /*g:ale_python_flakehell_options* +g:ale_python_flakehell_use_global ale-python.txt /*g:ale_python_flakehell_use_global* +g:ale_python_isort_auto_pipenv ale-python.txt /*g:ale_python_isort_auto_pipenv* +g:ale_python_isort_auto_poetry ale-python.txt /*g:ale_python_isort_auto_poetry* +g:ale_python_isort_executable ale-python.txt /*g:ale_python_isort_executable* +g:ale_python_isort_options ale-python.txt /*g:ale_python_isort_options* +g:ale_python_isort_use_global ale-python.txt /*g:ale_python_isort_use_global* +g:ale_python_mypy_auto_pipenv ale-python.txt /*g:ale_python_mypy_auto_pipenv* +g:ale_python_mypy_auto_poetry ale-python.txt /*g:ale_python_mypy_auto_poetry* +g:ale_python_mypy_executable ale-python.txt /*g:ale_python_mypy_executable* +g:ale_python_mypy_ignore_invalid_syntax ale-python.txt /*g:ale_python_mypy_ignore_invalid_syntax* +g:ale_python_mypy_options ale-python.txt /*g:ale_python_mypy_options* +g:ale_python_mypy_show_notes ale-python.txt /*g:ale_python_mypy_show_notes* +g:ale_python_mypy_use_global ale-python.txt /*g:ale_python_mypy_use_global* +g:ale_python_prospector_auto_pipenv ale-python.txt /*g:ale_python_prospector_auto_pipenv* +g:ale_python_prospector_auto_poetry ale-python.txt /*g:ale_python_prospector_auto_poetry* +g:ale_python_prospector_executable ale-python.txt /*g:ale_python_prospector_executable* +g:ale_python_prospector_options ale-python.txt /*g:ale_python_prospector_options* +g:ale_python_prospector_use_global ale-python.txt /*g:ale_python_prospector_use_global* +g:ale_python_pycodestyle_auto_pipenv ale-python.txt /*g:ale_python_pycodestyle_auto_pipenv* +g:ale_python_pycodestyle_auto_poetry ale-python.txt /*g:ale_python_pycodestyle_auto_poetry* +g:ale_python_pycodestyle_executable ale-python.txt /*g:ale_python_pycodestyle_executable* +g:ale_python_pycodestyle_options ale-python.txt /*g:ale_python_pycodestyle_options* +g:ale_python_pycodestyle_use_global ale-python.txt /*g:ale_python_pycodestyle_use_global* +g:ale_python_pydocstyle_auto_pipenv ale-python.txt /*g:ale_python_pydocstyle_auto_pipenv* +g:ale_python_pydocstyle_auto_poetry ale-python.txt /*g:ale_python_pydocstyle_auto_poetry* +g:ale_python_pydocstyle_executable ale-python.txt /*g:ale_python_pydocstyle_executable* +g:ale_python_pydocstyle_options ale-python.txt /*g:ale_python_pydocstyle_options* +g:ale_python_pydocstyle_use_global ale-python.txt /*g:ale_python_pydocstyle_use_global* +g:ale_python_pyflakes_auto_pipenv ale-python.txt /*g:ale_python_pyflakes_auto_pipenv* +g:ale_python_pyflakes_auto_poetry ale-python.txt /*g:ale_python_pyflakes_auto_poetry* +g:ale_python_pyflakes_executable ale-python.txt /*g:ale_python_pyflakes_executable* +g:ale_python_pyflyby_auto_pipenv ale-python.txt /*g:ale_python_pyflyby_auto_pipenv* +g:ale_python_pyflyby_auto_poetry ale-python.txt /*g:ale_python_pyflyby_auto_poetry* +g:ale_python_pyflyby_executable ale-python.txt /*g:ale_python_pyflyby_executable* +g:ale_python_pyflyby_options ale-python.txt /*g:ale_python_pyflyby_options* +g:ale_python_pyflyby_use_global ale-python.txt /*g:ale_python_pyflyby_use_global* +g:ale_python_pylama_auto_pipenv ale-python.txt /*g:ale_python_pylama_auto_pipenv* +g:ale_python_pylama_auto_poetry ale-python.txt /*g:ale_python_pylama_auto_poetry* +g:ale_python_pylama_change_directory ale-python.txt /*g:ale_python_pylama_change_directory* +g:ale_python_pylama_executable ale-python.txt /*g:ale_python_pylama_executable* +g:ale_python_pylama_options ale-python.txt /*g:ale_python_pylama_options* +g:ale_python_pylama_use_global ale-python.txt /*g:ale_python_pylama_use_global* +g:ale_python_pylint_auto_pipenv ale-python.txt /*g:ale_python_pylint_auto_pipenv* +g:ale_python_pylint_auto_poetry ale-python.txt /*g:ale_python_pylint_auto_poetry* +g:ale_python_pylint_change_directory ale-python.txt /*g:ale_python_pylint_change_directory* +g:ale_python_pylint_executable ale-python.txt /*g:ale_python_pylint_executable* +g:ale_python_pylint_options ale-python.txt /*g:ale_python_pylint_options* +g:ale_python_pylint_use_global ale-python.txt /*g:ale_python_pylint_use_global* +g:ale_python_pylint_use_msg_id ale-python.txt /*g:ale_python_pylint_use_msg_id* +g:ale_python_pylsp_auto_pipenv ale-python.txt /*g:ale_python_pylsp_auto_pipenv* +g:ale_python_pylsp_auto_poetry ale-python.txt /*g:ale_python_pylsp_auto_poetry* +g:ale_python_pylsp_config ale-python.txt /*g:ale_python_pylsp_config* +g:ale_python_pylsp_executable ale-python.txt /*g:ale_python_pylsp_executable* +g:ale_python_pylsp_options ale-python.txt /*g:ale_python_pylsp_options* +g:ale_python_pylsp_use_global ale-python.txt /*g:ale_python_pylsp_use_global* +g:ale_python_pyre_auto_pipenv ale-python.txt /*g:ale_python_pyre_auto_pipenv* +g:ale_python_pyre_auto_poetry ale-python.txt /*g:ale_python_pyre_auto_poetry* +g:ale_python_pyre_executable ale-python.txt /*g:ale_python_pyre_executable* +g:ale_python_pyre_use_global ale-python.txt /*g:ale_python_pyre_use_global* +g:ale_python_pyright_config ale-python.txt /*g:ale_python_pyright_config* +g:ale_python_pyright_executable ale-python.txt /*g:ale_python_pyright_executable* +g:ale_python_refurb_auto_pipenv ale-python.txt /*g:ale_python_refurb_auto_pipenv* +g:ale_python_refurb_auto_poetry ale-python.txt /*g:ale_python_refurb_auto_poetry* +g:ale_python_refurb_change_directory ale-python.txt /*g:ale_python_refurb_change_directory* +g:ale_python_refurb_executable ale-python.txt /*g:ale_python_refurb_executable* +g:ale_python_refurb_options ale-python.txt /*g:ale_python_refurb_options* +g:ale_python_refurb_use_global ale-python.txt /*g:ale_python_refurb_use_global* +g:ale_python_reorder_python_imports_executable ale-python.txt /*g:ale_python_reorder_python_imports_executable* +g:ale_python_reorder_python_imports_options ale-python.txt /*g:ale_python_reorder_python_imports_options* +g:ale_python_reorder_python_imports_use_global ale-python.txt /*g:ale_python_reorder_python_imports_use_global* +g:ale_python_ruff_auto_pipenv ale-python.txt /*g:ale_python_ruff_auto_pipenv* +g:ale_python_ruff_auto_poetry ale-python.txt /*g:ale_python_ruff_auto_poetry* +g:ale_python_ruff_change_directory ale-python.txt /*g:ale_python_ruff_change_directory* +g:ale_python_ruff_executable ale-python.txt /*g:ale_python_ruff_executable* +g:ale_python_ruff_options ale-python.txt /*g:ale_python_ruff_options* +g:ale_python_ruff_use_global ale-python.txt /*g:ale_python_ruff_use_global* +g:ale_python_unimport_auto_pipenv ale-python.txt /*g:ale_python_unimport_auto_pipenv* +g:ale_python_unimport_auto_poetry ale-python.txt /*g:ale_python_unimport_auto_poetry* +g:ale_python_unimport_executable ale-python.txt /*g:ale_python_unimport_executable* +g:ale_python_unimport_options ale-python.txt /*g:ale_python_unimport_options* +g:ale_python_unimport_use_global ale-python.txt /*g:ale_python_unimport_use_global* +g:ale_python_vulture_change_directory ale-python.txt /*g:ale_python_vulture_change_directory* +g:ale_python_vulture_executable ale-python.txt /*g:ale_python_vulture_executable* +g:ale_python_vulture_options ale-python.txt /*g:ale_python_vulture_options* +g:ale_python_vulture_use_global ale-python.txt /*g:ale_python_vulture_use_global* +g:ale_python_yapf_executable ale-python.txt /*g:ale_python_yapf_executable* +g:ale_python_yapf_use_global ale-python.txt /*g:ale_python_yapf_use_global* +g:ale_qml_qmlfmt_executable ale-qml.txt /*g:ale_qml_qmlfmt_executable* +g:ale_r_languageserver_cmd ale-r.txt /*g:ale_r_languageserver_cmd* +g:ale_r_languageserver_config ale-r.txt /*g:ale_r_languageserver_config* +g:ale_r_lintr_lint_package ale-r.txt /*g:ale_r_lintr_lint_package* +g:ale_r_lintr_options ale-r.txt /*g:ale_r_lintr_options* +g:ale_r_styler_options ale-r.txt /*g:ale_r_styler_options* +g:ale_racket_raco_fmt_executable ale-racket.txt /*g:ale_racket_raco_fmt_executable* +g:ale_racket_raco_fmt_options ale-racket.txt /*g:ale_racket_raco_fmt_options* +g:ale_reason_ls_executable ale-reasonml.txt /*g:ale_reason_ls_executable* +g:ale_reason_ols_executable ale-reasonml.txt /*g:ale_reason_ols_executable* +g:ale_reason_ols_use_global ale-reasonml.txt /*g:ale_reason_ols_use_global* +g:ale_reasonml_refmt_executable ale-reasonml.txt /*g:ale_reasonml_refmt_executable* +g:ale_reasonml_refmt_options ale-reasonml.txt /*g:ale_reasonml_refmt_options* +g:ale_rename_tsserver_find_in_comments ale.txt /*g:ale_rename_tsserver_find_in_comments* +g:ale_rename_tsserver_find_in_strings ale.txt /*g:ale_rename_tsserver_find_in_strings* +g:ale_robot_rflint_executable ale-robot.txt /*g:ale_robot_rflint_executable* +g:ale_root ale.txt /*g:ale_root* +g:ale_ruby_brakeman_executable ale-ruby.txt /*g:ale_ruby_brakeman_executable* +g:ale_ruby_brakeman_options ale-ruby.txt /*g:ale_ruby_brakeman_options* +g:ale_ruby_debride_executable ale-ruby.txt /*g:ale_ruby_debride_executable* +g:ale_ruby_debride_options ale-ruby.txt /*g:ale_ruby_debride_options* +g:ale_ruby_erblint_options ale-eruby.txt /*g:ale_ruby_erblint_options* +g:ale_ruby_rails_best_practices_executable ale-ruby.txt /*g:ale_ruby_rails_best_practices_executable* +g:ale_ruby_rails_best_practices_options ale-ruby.txt /*g:ale_ruby_rails_best_practices_options* +g:ale_ruby_reek_executable ale-ruby.txt /*g:ale_ruby_reek_executable* +g:ale_ruby_reek_show_context ale-ruby.txt /*g:ale_ruby_reek_show_context* +g:ale_ruby_reek_show_wiki_link ale-ruby.txt /*g:ale_ruby_reek_show_wiki_link* +g:ale_ruby_rubocop_auto_correct_all ale-ruby.txt /*g:ale_ruby_rubocop_auto_correct_all* +g:ale_ruby_rubocop_executable ale-ruby.txt /*g:ale_ruby_rubocop_executable* +g:ale_ruby_rubocop_options ale-ruby.txt /*g:ale_ruby_rubocop_options* +g:ale_ruby_ruby_executable ale-ruby.txt /*g:ale_ruby_ruby_executable* +g:ale_ruby_rufo_executable ale-ruby.txt /*g:ale_ruby_rufo_executable* +g:ale_ruby_ruumba_options ale-eruby.txt /*g:ale_ruby_ruumba_options* +g:ale_ruby_solargraph_executable ale-ruby.txt /*g:ale_ruby_solargraph_executable* +g:ale_ruby_sorbet_enable_watchman ale-ruby.txt /*g:ale_ruby_sorbet_enable_watchman* +g:ale_ruby_sorbet_executable ale-ruby.txt /*g:ale_ruby_sorbet_executable* +g:ale_ruby_sorbet_options ale-ruby.txt /*g:ale_ruby_sorbet_options* +g:ale_ruby_standardrb_executable ale-ruby.txt /*g:ale_ruby_standardrb_executable* +g:ale_ruby_standardrb_options ale-ruby.txt /*g:ale_ruby_standardrb_options* +g:ale_ruby_syntax_tree_executable ale-ruby.txt /*g:ale_ruby_syntax_tree_executable* +g:ale_ruby_syntax_tree_options ale-ruby.txt /*g:ale_ruby_syntax_tree_options* +g:ale_rust_analyzer_config ale-rust.txt /*g:ale_rust_analyzer_config* +g:ale_rust_analyzer_executable ale-rust.txt /*g:ale_rust_analyzer_executable* +g:ale_rust_cargo_avoid_whole_workspace ale-rust.txt /*g:ale_rust_cargo_avoid_whole_workspace* +g:ale_rust_cargo_check_all_targets ale-rust.txt /*g:ale_rust_cargo_check_all_targets* +g:ale_rust_cargo_check_examples ale-rust.txt /*g:ale_rust_cargo_check_examples* +g:ale_rust_cargo_check_tests ale-rust.txt /*g:ale_rust_cargo_check_tests* +g:ale_rust_cargo_clippy_options ale-rust.txt /*g:ale_rust_cargo_clippy_options* +g:ale_rust_cargo_default_feature_behavior ale-rust.txt /*g:ale_rust_cargo_default_feature_behavior* +g:ale_rust_cargo_include_features ale-rust.txt /*g:ale_rust_cargo_include_features* +g:ale_rust_cargo_target_dir ale-rust.txt /*g:ale_rust_cargo_target_dir* +g:ale_rust_cargo_use_check ale-rust.txt /*g:ale_rust_cargo_use_check* +g:ale_rust_cargo_use_clippy ale-rust.txt /*g:ale_rust_cargo_use_clippy* +g:ale_rust_ignore_error_codes ale-rust.txt /*g:ale_rust_ignore_error_codes* +g:ale_rust_ignore_secondary_spans ale-rust.txt /*g:ale_rust_ignore_secondary_spans* +g:ale_rust_rls_config ale-rust.txt /*g:ale_rust_rls_config* +g:ale_rust_rls_executable ale-rust.txt /*g:ale_rust_rls_executable* +g:ale_rust_rls_toolchain ale-rust.txt /*g:ale_rust_rls_toolchain* +g:ale_rust_rustc_options ale-rust.txt /*g:ale_rust_rustc_options* +g:ale_rust_rustfmt_executable ale-rust.txt /*g:ale_rust_rustfmt_executable* +g:ale_rust_rustfmt_options ale-rust.txt /*g:ale_rust_rustfmt_options* +g:ale_sass_stylelint_executable ale-sass.txt /*g:ale_sass_stylelint_executable* +g:ale_sass_stylelint_use_global ale-sass.txt /*g:ale_sass_stylelint_use_global* +g:ale_scala_metals_executable ale-scala.txt /*g:ale_scala_metals_executable* +g:ale_scala_metals_project_root ale-scala.txt /*g:ale_scala_metals_project_root* +g:ale_scala_sbtserver_address ale-scala.txt /*g:ale_scala_sbtserver_address* +g:ale_scala_sbtserver_project_root ale-scala.txt /*g:ale_scala_sbtserver_project_root* +g:ale_scala_scalafmt_executable ale-scala.txt /*g:ale_scala_scalafmt_executable* +g:ale_scala_scalafmt_options ale-scala.txt /*g:ale_scala_scalafmt_options* +g:ale_scala_scalastyle_config ale-scala.txt /*g:ale_scala_scalastyle_config* +g:ale_scala_scalastyle_options ale-scala.txt /*g:ale_scala_scalastyle_options* +g:ale_scss_sasslint_executable ale-scss.txt /*g:ale_scss_sasslint_executable* +g:ale_scss_sasslint_options ale-scss.txt /*g:ale_scss_sasslint_options* +g:ale_scss_sasslint_use_global ale-scss.txt /*g:ale_scss_sasslint_use_global* +g:ale_scss_stylelint_executable ale-scss.txt /*g:ale_scss_stylelint_executable* +g:ale_scss_stylelint_options ale-scss.txt /*g:ale_scss_stylelint_options* +g:ale_scss_stylelint_use_global ale-scss.txt /*g:ale_scss_stylelint_use_global* +g:ale_set_balloons ale.txt /*g:ale_set_balloons* +g:ale_set_balloons_legacy_echo ale.txt /*g:ale_set_balloons_legacy_echo* +g:ale_set_highlights ale.txt /*g:ale_set_highlights* +g:ale_set_loclist ale.txt /*g:ale_set_loclist* +g:ale_set_quickfix ale.txt /*g:ale_set_quickfix* +g:ale_set_signs ale.txt /*g:ale_set_signs* +g:ale_sh_bashate_executable ale-sh.txt /*g:ale_sh_bashate_executable* +g:ale_sh_bashate_options ale-sh.txt /*g:ale_sh_bashate_options* +g:ale_sh_language_server_executable ale-sh.txt /*g:ale_sh_language_server_executable* +g:ale_sh_language_server_use_global ale-sh.txt /*g:ale_sh_language_server_use_global* +g:ale_sh_shell_default_shell ale-sh.txt /*g:ale_sh_shell_default_shell* +g:ale_sh_shellcheck_change_directory ale-sh.txt /*g:ale_sh_shellcheck_change_directory* +g:ale_sh_shellcheck_dialect ale-sh.txt /*g:ale_sh_shellcheck_dialect* +g:ale_sh_shellcheck_exclusions ale-sh.txt /*g:ale_sh_shellcheck_exclusions* +g:ale_sh_shellcheck_executable ale-sh.txt /*g:ale_sh_shellcheck_executable* +g:ale_sh_shellcheck_options ale-sh.txt /*g:ale_sh_shellcheck_options* +g:ale_sh_shfmt_options ale-sh.txt /*g:ale_sh_shfmt_options* +g:ale_shell ale.txt /*g:ale_shell* +g:ale_shell_arguments ale.txt /*g:ale_shell_arguments* +g:ale_sign_column_always ale.txt /*g:ale_sign_column_always* +g:ale_sign_error ale.txt /*g:ale_sign_error* +g:ale_sign_highlight_linenrs ale.txt /*g:ale_sign_highlight_linenrs* +g:ale_sign_info ale.txt /*g:ale_sign_info* +g:ale_sign_offset ale.txt /*g:ale_sign_offset* +g:ale_sign_priority ale.txt /*g:ale_sign_priority* +g:ale_sign_style_error ale.txt /*g:ale_sign_style_error* +g:ale_sign_style_warning ale.txt /*g:ale_sign_style_warning* +g:ale_sign_warning ale.txt /*g:ale_sign_warning* +g:ale_sml_smlnj_cm_file ale-sml.txt /*g:ale_sml_smlnj_cm_file* +g:ale_solidity_solc_executable ale-solidity.txt /*g:ale_solidity_solc_executable* +g:ale_solidity_solc_options ale-solidity.txt /*g:ale_solidity_solc_options* +g:ale_sourcekit_lsp_executable ale-swift.txt /*g:ale_sourcekit_lsp_executable* +g:ale_spec_rpmlint_executable ale-spec.txt /*g:ale_spec_rpmlint_executable* +g:ale_spec_rpmlint_options ale-spec.txt /*g:ale_spec_rpmlint_options* +g:ale_sql_pgformatter_executable ale-sql.txt /*g:ale_sql_pgformatter_executable* +g:ale_sql_pgformatter_options ale-sql.txt /*g:ale_sql_pgformatter_options* +g:ale_sql_sqlfluff_executable ale-sql.txt /*g:ale_sql_sqlfluff_executable* +g:ale_sql_sqlfluff_options ale-sql.txt /*g:ale_sql_sqlfluff_options* +g:ale_sql_sqlfmt_executable ale-sql.txt /*g:ale_sql_sqlfmt_executable* +g:ale_sql_sqlfmt_options ale-sql.txt /*g:ale_sql_sqlfmt_options* +g:ale_sql_sqlformat_executable ale-sql.txt /*g:ale_sql_sqlformat_executable* +g:ale_sql_sqlformat_options ale-sql.txt /*g:ale_sql_sqlformat_options* +g:ale_stylus_stylelint_executable ale-stylus.txt /*g:ale_stylus_stylelint_executable* +g:ale_stylus_stylelint_options ale-stylus.txt /*g:ale_stylus_stylelint_options* +g:ale_stylus_stylelint_use_global ale-stylus.txt /*g:ale_stylus_stylelint_use_global* +g:ale_sugarss_stylelint_executable ale-sugarss.txt /*g:ale_sugarss_stylelint_executable* +g:ale_sugarss_stylelint_options ale-sugarss.txt /*g:ale_sugarss_stylelint_options* +g:ale_sugarss_stylelint_use_global ale-sugarss.txt /*g:ale_sugarss_stylelint_use_global* +g:ale_svelte_svelteserver_executable ale-svelte.txt /*g:ale_svelte_svelteserver_executable* +g:ale_svelte_svelteserver_use_global ale-svelte.txt /*g:ale_svelte_svelteserver_use_global* +g:ale_swift_appleswiftformat_executable ale-swift.txt /*g:ale_swift_appleswiftformat_executable* +g:ale_swift_appleswiftformat_use_swiftpm ale-swift.txt /*g:ale_swift_appleswiftformat_use_swiftpm* +g:ale_tcl_nagelfar_executable ale-tcl.txt /*g:ale_tcl_nagelfar_executable* +g:ale_tcl_nagelfar_options ale-tcl.txt /*g:ale_tcl_nagelfar_options* +g:ale_terraform_checkov_executable ale-terraform.txt /*g:ale_terraform_checkov_executable* +g:ale_terraform_checkov_options ale-terraform.txt /*g:ale_terraform_checkov_options* +g:ale_terraform_fmt_executable ale-terraform.txt /*g:ale_terraform_fmt_executable* +g:ale_terraform_fmt_options ale-terraform.txt /*g:ale_terraform_fmt_options* +g:ale_terraform_langserver_executable ale-terraform.txt /*g:ale_terraform_langserver_executable* +g:ale_terraform_langserver_options ale-terraform.txt /*g:ale_terraform_langserver_options* +g:ale_terraform_ls_executable ale-terraform.txt /*g:ale_terraform_ls_executable* +g:ale_terraform_ls_options ale-terraform.txt /*g:ale_terraform_ls_options* +g:ale_terraform_terraform_executable ale-terraform.txt /*g:ale_terraform_terraform_executable* +g:ale_terraform_tflint_executable ale-terraform.txt /*g:ale_terraform_tflint_executable* +g:ale_terraform_tflint_options ale-terraform.txt /*g:ale_terraform_tflint_options* +g:ale_terraform_tfsec_executable ale-terraform.txt /*g:ale_terraform_tfsec_executable* +g:ale_terraform_tfsec_options ale-terraform.txt /*g:ale_terraform_tfsec_options* +g:ale_tex_chktex_executable ale-tex.txt /*g:ale_tex_chktex_executable* +g:ale_tex_chktex_options ale-tex.txt /*g:ale_tex_chktex_options* +g:ale_tex_latexindent_executable ale-tex.txt /*g:ale_tex_latexindent_executable* +g:ale_tex_latexindent_options ale-tex.txt /*g:ale_tex_latexindent_options* +g:ale_tex_texlab_config ale-tex.txt /*g:ale_tex_texlab_config* +g:ale_tex_texlab_executable ale-tex.txt /*g:ale_tex_texlab_executable* +g:ale_tex_texlab_options ale-tex.txt /*g:ale_tex_texlab_options* +g:ale_textlint_executable ale-text.txt /*g:ale_textlint_executable* +g:ale_textlint_options ale-text.txt /*g:ale_textlint_options* +g:ale_textlint_use_global ale-text.txt /*g:ale_textlint_use_global* +g:ale_thrift_thrift_executable ale-thrift.txt /*g:ale_thrift_thrift_executable* +g:ale_thrift_thrift_generators ale-thrift.txt /*g:ale_thrift_thrift_generators* +g:ale_thrift_thrift_includes ale-thrift.txt /*g:ale_thrift_thrift_includes* +g:ale_thrift_thrift_options ale-thrift.txt /*g:ale_thrift_thrift_options* +g:ale_thrift_thriftcheck_executable ale-thrift.txt /*g:ale_thrift_thriftcheck_executable* +g:ale_thrift_thriftcheck_options ale-thrift.txt /*g:ale_thrift_thriftcheck_options* +g:ale_type_map ale.txt /*g:ale_type_map* +g:ale_typescript_standard_executable ale-typescript.txt /*g:ale_typescript_standard_executable* +g:ale_typescript_standard_options ale-typescript.txt /*g:ale_typescript_standard_options* +g:ale_typescript_standard_use_global ale-typescript.txt /*g:ale_typescript_standard_use_global* +g:ale_typescript_tslint_config_path ale-typescript.txt /*g:ale_typescript_tslint_config_path* +g:ale_typescript_tslint_executable ale-typescript.txt /*g:ale_typescript_tslint_executable* +g:ale_typescript_tslint_ignore_empty_files ale-typescript.txt /*g:ale_typescript_tslint_ignore_empty_files* +g:ale_typescript_tslint_rules_dir ale-typescript.txt /*g:ale_typescript_tslint_rules_dir* +g:ale_typescript_tslint_use_global ale-typescript.txt /*g:ale_typescript_tslint_use_global* +g:ale_typescript_tsserver_config_path ale-typescript.txt /*g:ale_typescript_tsserver_config_path* +g:ale_typescript_tsserver_executable ale-typescript.txt /*g:ale_typescript_tsserver_executable* +g:ale_typescript_tsserver_use_global ale-typescript.txt /*g:ale_typescript_tsserver_use_global* +g:ale_typescript_xo_executable ale-typescript.txt /*g:ale_typescript_xo_executable* +g:ale_typescript_xo_options ale-typescript.txt /*g:ale_typescript_xo_options* +g:ale_typescript_xo_use_global ale-typescript.txt /*g:ale_typescript_xo_use_global* +g:ale_update_tagstack ale.txt /*g:ale_update_tagstack* +g:ale_use_global_executables ale.txt /*g:ale_use_global_executables* +g:ale_v_v_executable ale-v.txt /*g:ale_v_v_executable* +g:ale_v_v_options ale-v.txt /*g:ale_v_v_options* +g:ale_v_vfmt_options ale-v.txt /*g:ale_v_vfmt_options* +g:ale_verilog_verilator_options ale-verilog.txt /*g:ale_verilog_verilator_options* +g:ale_verilog_vlog_executable ale-verilog.txt /*g:ale_verilog_vlog_executable* +g:ale_verilog_vlog_options ale-verilog.txt /*g:ale_verilog_vlog_options* +g:ale_verilog_xvlog_executable ale-verilog.txt /*g:ale_verilog_xvlog_executable* +g:ale_verilog_xvlog_options ale-verilog.txt /*g:ale_verilog_xvlog_options* +g:ale_verilog_yosys_executable ale-verilog.txt /*g:ale_verilog_yosys_executable* +g:ale_verilog_yosys_options ale-verilog.txt /*g:ale_verilog_yosys_options* +g:ale_vhdl_ghdl_executable ale-vhdl.txt /*g:ale_vhdl_ghdl_executable* +g:ale_vhdl_ghdl_options ale-vhdl.txt /*g:ale_vhdl_ghdl_options* +g:ale_vhdl_vcom_executable ale-vhdl.txt /*g:ale_vhdl_vcom_executable* +g:ale_vhdl_vcom_options ale-vhdl.txt /*g:ale_vhdl_vcom_options* +g:ale_vhdl_xvhdl_executable ale-vhdl.txt /*g:ale_vhdl_xvhdl_executable* +g:ale_vhdl_xvhdl_options ale-vhdl.txt /*g:ale_vhdl_xvhdl_options* +g:ale_vim_vimls_config ale-vim.txt /*g:ale_vim_vimls_config* +g:ale_vim_vimls_executable ale-vim.txt /*g:ale_vim_vimls_executable* +g:ale_vim_vimls_use_global ale-vim.txt /*g:ale_vim_vimls_use_global* +g:ale_vim_vint_executable ale-vim.txt /*g:ale_vim_vint_executable* +g:ale_vim_vint_show_style_issues ale-vim.txt /*g:ale_vim_vint_show_style_issues* +g:ale_virtualenv_dir_names ale.txt /*g:ale_virtualenv_dir_names* +g:ale_virtualtext_cursor ale.txt /*g:ale_virtualtext_cursor* +g:ale_virtualtext_delay ale.txt /*g:ale_virtualtext_delay* +g:ale_virtualtext_prefix ale.txt /*g:ale_virtualtext_prefix* +g:ale_vue_vls_executable ale-vue.txt /*g:ale_vue_vls_executable* +g:ale_vue_vls_use_global ale-vue.txt /*g:ale_vue_vls_use_global* +g:ale_vue_volar_executable ale-vue.txt /*g:ale_vue_volar_executable* +g:ale_vue_volar_init_options ale-vue.txt /*g:ale_vue_volar_init_options* +g:ale_vue_volar_use_global ale-vue.txt /*g:ale_vue_volar_use_global* +g:ale_want_results_buffer ale.txt /*g:ale_want_results_buffer* +g:ale_warn_about_trailing_blank_lines ale.txt /*g:ale_warn_about_trailing_blank_lines* +g:ale_warn_about_trailing_whitespace ale.txt /*g:ale_warn_about_trailing_whitespace* +g:ale_wgsl_naga_executable ale-wgsl.txt /*g:ale_wgsl_naga_executable* +g:ale_windows_node_executable_path ale.txt /*g:ale_windows_node_executable_path* +g:ale_writegood_executable ale.txt /*g:ale_writegood_executable* +g:ale_writegood_options ale.txt /*g:ale_writegood_options* +g:ale_writegood_use_global ale.txt /*g:ale_writegood_use_global* +g:ale_xml_xmllint_executable ale-xml.txt /*g:ale_xml_xmllint_executable* +g:ale_xml_xmllint_indentsize ale-xml.txt /*g:ale_xml_xmllint_indentsize* +g:ale_xml_xmllint_options ale-xml.txt /*g:ale_xml_xmllint_options* +g:ale_yaml_actionlint_executable ale-yaml.txt /*g:ale_yaml_actionlint_executable* +g:ale_yaml_actionlint_options ale-yaml.txt /*g:ale_yaml_actionlint_options* +g:ale_yaml_gitlablint_executable ale-yaml.txt /*g:ale_yaml_gitlablint_executable* +g:ale_yaml_gitlablint_options ale-yaml.txt /*g:ale_yaml_gitlablint_options* +g:ale_yaml_ls_config ale-yaml.txt /*g:ale_yaml_ls_config* +g:ale_yaml_ls_executable ale-yaml.txt /*g:ale_yaml_ls_executable* +g:ale_yaml_ls_use_global ale-yaml.txt /*g:ale_yaml_ls_use_global* +g:ale_yaml_spectral_executable ale-yaml.txt /*g:ale_yaml_spectral_executable* +g:ale_yaml_spectral_use_global ale-yaml.txt /*g:ale_yaml_spectral_use_global* +g:ale_yaml_swaglint_executable ale-yaml.txt /*g:ale_yaml_swaglint_executable* +g:ale_yaml_swaglint_use_global ale-yaml.txt /*g:ale_yaml_swaglint_use_global* +g:ale_yaml_yamlfix_executable ale-yaml.txt /*g:ale_yaml_yamlfix_executable* +g:ale_yaml_yamlfix_options ale-yaml.txt /*g:ale_yaml_yamlfix_options* +g:ale_yaml_yamlfix_use_global ale-yaml.txt /*g:ale_yaml_yamlfix_use_global* +g:ale_yaml_yamllint_executable ale-yaml.txt /*g:ale_yaml_yamllint_executable* +g:ale_yaml_yamllint_options ale-yaml.txt /*g:ale_yaml_yamllint_options* +g:ale_yang_lsp_executable ale-yang.txt /*g:ale_yang_lsp_executable* +g:ale_zeek_zeek_executable ale-zeek.txt /*g:ale_zeek_zeek_executable* +g:ale_zig_zigfmt_executable ale-zig.txt /*g:ale_zig_zigfmt_executable* +g:ale_zig_zls_config ale-zig.txt /*g:ale_zig_zls_config* +g:ale_zig_zls_executable ale-zig.txt /*g:ale_zig_zls_executable* +g:html_tidy_use_global ale-html.txt /*g:html_tidy_use_global* +g:nim_nimlsp_nim_sources ale-nim.txt /*g:nim_nimlsp_nim_sources* +g:rego_opacheck_executable ale-rego.txt /*g:rego_opacheck_executable* +g:rego_opacheck_options ale-rego.txt /*g:rego_opacheck_options* +g:vala_vala_lint_config_filename ale-vala.txt /*g:vala_vala_lint_config_filename* +g:vala_vala_lint_executable ale-vala.txt /*g:vala_vala_lint_executable* +terraform-lsp ale-terraform.txt /*terraform-lsp* diff --git a/vim-config/plugins/vim-go/.codecov.yml b/vim-config/plugins/vim-go/.codecov.yml deleted file mode 100644 index 9a8b1bb9..00000000 --- a/vim-config/plugins/vim-go/.codecov.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -coverage: - status: - project: - default: - target: auto - threshold: 1 - base: auto - patch: off -comment: false -ignore: - - "!autoload/go/*.vim$" - - "autoload/go/*_test.vim$" diff --git a/vim-config/plugins/vim-go/.coveragerc b/vim-config/plugins/vim-go/.coveragerc deleted file mode 100644 index 8cddf91c..00000000 --- a/vim-config/plugins/vim-go/.coveragerc +++ /dev/null @@ -1,3 +0,0 @@ -[run] -plugins = covimerage -data_file = .coverage_covimerage diff --git a/vim-config/plugins/vim-go/.dockerignore b/vim-config/plugins/vim-go/.dockerignore deleted file mode 100644 index 1ab3866a..00000000 --- a/vim-config/plugins/vim-go/.dockerignore +++ /dev/null @@ -1,7 +0,0 @@ -.local/ -.config/ -.cache/ -.dlv/ -.git/ -.viminfo -issues/ diff --git a/vim-config/plugins/vim-go/.editorconfig b/vim-config/plugins/vim-go/.editorconfig deleted file mode 100644 index 2c222811..00000000 --- a/vim-config/plugins/vim-go/.editorconfig +++ /dev/null @@ -1,17 +0,0 @@ -# http://EditorConfig.org - -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -[*.go] -indent_style = tab -indent_size = 4 - -[Makefile] -indent_style = tab -indent_size = 8 diff --git a/vim-config/plugins/vim-go/.github/CONTRIBUTING.md b/vim-config/plugins/vim-go/.github/CONTRIBUTING.md deleted file mode 100644 index edabf915..00000000 --- a/vim-config/plugins/vim-go/.github/CONTRIBUTING.md +++ /dev/null @@ -1,12 +0,0 @@ -Thanks for improving vim-go! Before you dive in please read the following: - -1. Please read our - [Documentation](https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt), - it might have a solution to your problem. -2. If you add a new feature then please don't forget to update the documentation: - [doc/vim-go.txt](https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt). -3. If it's a breaking change or exceeds 100 lines of code then please open an - issue first and describe the changes you want to make. -4. See `:help go-development` for instructions on how to run and write tests. If - you add a new feature be sure you also include a test if feasible. - diff --git a/vim-config/plugins/vim-go/.github/FUNDING.yml b/vim-config/plugins/vim-go/.github/FUNDING.yml deleted file mode 100644 index 060026ef..00000000 --- a/vim-config/plugins/vim-go/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: bhcleek diff --git a/vim-config/plugins/vim-go/.github/ISSUE_TEMPLATE.md b/vim-config/plugins/vim-go/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 687b021b..00000000 --- a/vim-config/plugins/vim-go/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,47 +0,0 @@ - -### What did you do? (required: The issue will be **closed** when not provided) - - - -### What did you expect to happen? - -### What happened instead? - -### Configuration (**MUST** fill this out): - -#### vim-go version: - -#### `vimrc` you used to reproduce: - - -
vimrc
-
-
- -#### Vim version (first three lines from `:version`): - - -#### Go version (`go version`): - - -#### Go environment -
go env Output:
-
-
-
- -#### gopls version -
gopls version Output:
-
-
-
diff --git a/vim-config/plugins/vim-go/.github/workflows/test.yml b/vim-config/plugins/vim-go/.github/workflows/test.yml deleted file mode 100644 index d66b8d10..00000000 --- a/vim-config/plugins/vim-go/.github/workflows/test.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: test -on: [push, pull_request] -jobs: - lint: - name: lint - runs-on: ubuntu-18.04 - steps: - - name: set up python - uses: actions/setup-python@v1.2.0 - with: - python-version: 3.6 - - name: install vim-vint - run: | - python -m pip install --upgrade pip - pip install vim-vint pathlib - - name: checkout - uses: actions/checkout@v2.1.0 - - name: install vim - run: $GITHUB_WORKSPACE/scripts/install-vim vim-8.2 - - name: lint - run: $GITHUB_WORKSPACE/scripts/lint vim-8.2 - test: - name: test - runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - go: ['1.14'] - vim: ['vim-8.0', 'vim-8.2', 'nvim'] - steps: - - name: setup Go - uses: actions/setup-go@v2.0.3 - with: - go-version: ${{ matrix.go }} - - name: set up python - uses: actions/setup-python@v1.2.0 - with: - python-version: 3.6 - - name: install covimerage - run: | - python -m pip install --upgrade pip - pip install covimerage==0.2.1 codecov pathlib - - name: checkout - uses: actions/checkout@v2.1.0 - - name: install vim - run: $GITHUB_WORKSPACE/scripts/install-vim ${{ matrix.vim }} - - name: test - run: $GITHUB_WORKSPACE/scripts/test -c ${{ matrix.vim }} - - uses: codecov/codecov-action@v1 - with: - # token is not required for public repos - #token: ${{ secrets.CODECOV_TOKEN }} - file: $GITHUB_WORKSPACE/coverage.xml - flags: unittests - name: vim-go - fail_ci_if_error: false diff --git a/vim-config/plugins/vim-go/.gitignore b/vim-config/plugins/vim-go/.gitignore deleted file mode 100644 index 2f7d8333..00000000 --- a/vim-config/plugins/vim-go/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -*.pyc -.DS_Store -/.bash_history -/.cache -/.config -/.coverage.covimerage -/.local -/.viminfo -/coverage.xml -/doc/tags -/issues diff --git a/vim-config/plugins/vim-go/.vintrc.yaml b/vim-config/plugins/vim-go/.vintrc.yaml deleted file mode 100644 index 32d7decf..00000000 --- a/vim-config/plugins/vim-go/.vintrc.yaml +++ /dev/null @@ -1,7 +0,0 @@ -policies: - ProhibitUnnecessaryDoubleQuote: - enabled: false - ProhibitEqualTildeOperator: - enabled: false - ProhibitNoAbortFunction: - enabled: false diff --git a/vim-config/plugins/vim-go/CHANGELOG.md b/vim-config/plugins/vim-go/CHANGELOG.md deleted file mode 100644 index 00355de0..00000000 --- a/vim-config/plugins/vim-go/CHANGELOG.md +++ /dev/null @@ -1,1906 +0,0 @@ -## unplanned - -IMPROVEMENTS: -* Clarify how `g:go_imports_autosave` and `g:go_fmt_autosave` interact. - [[GH-2893]](https://github.com/fatih/vim-go/pull/2893) - - -BUG FIXES: - -## v1.23 - (May 16, 2020) - -BACKWARDS INCOMPATIBILITIES: -* Remove support for gocode. - [[GH-2686]](https://github.com/fatih/vim-go/pull/2686) -* Require at least Neovim >= 0.4.0 - [[GH-2853]](https://github.com/fatih/vim-go/pull/2853) - [[GH-2856]](https://github.com/fatih/vim-go/pull/2856) - [[GH-2863]](https://github.com/fatih/vim-go/pull/2863) - -IMPROVEMENTS: -* Make signs for breakpoints configurable. - [[GH-2676]](https://github.com/fatih/vim-go/pull/2676) - [[GH-2690]](https://github.com/fatih/vim-go/pull/2690) -* Enable g:go_gopls_complete_unimported by default to stay aligned with gopls' defaults. - [[GH-2695]](https://github.com/fatih/vim-go/pull/2695) -* Document mappings that were recently added. - [[GH-2699]](https://github.com/fatih/vim-go/pull/2699) -* Handle null arrays better in gopls responses. - [[GH-2703]](https://github.com/fatih/vim-go/pull/2703) -* Use `gopls` defaults by default when they're not otherwise specified in vim-go options. - [[GH-2696]](https://github.com/fatih/vim-go/pull/2696) -* Add support for `gomodifytags --skip-unexported` - [[GH-2660]](https://github.com/fatih/vim-go/pull/2660) -* Show problems that prevent golangci-lint from running linters. - [[GH-2706]](https://github.com/fatih/vim-go/pull/2706) - [[GH-2720]](https://github.com/fatih/vim-go/pull/2720) -* Support golangci-lint config file by not using `--disable-all` when - `g:go_metalinter_enable` or `g:go_metalinter_autosave_enabled` is set to an - empty array. - [[GH-2655]](https://github.com/fatih/vim-go/pull/2655) - [[GH-2715]](https://github.com/fatih/vim-go/pull/2715) -* Add support for Vim8 terminals. - [[GH-2639]](https://github.com/fatih/vim-go/pull/2639) - [[GH-2736]](https://github.com/fatih/vim-go/pull/2736) -* Replace `g:go_gopls_fuzzy_matching` with `g:go_gopls_matcher` in response to - `gopls` deprecation of its `fuzzyMatching` option. - [[GH-2728]](https://github.com/fatih/vim-go/pull/2728) -* Set statuses and progress messages consistently for code quality tools. - [[GH-2727]](https://github.com/fatih/vim-go/pull/2727) -* Add a new supported value to `g:go_fmt_command` to format with `gopls`. - [[GH-2729]](https://github.com/fatih/vim-go/pull/2729) - [[GH-2752]](https://github.com/fatih/vim-go/pull/2752) - [[GH-2852]](https://github.com/fatih/vim-go/pull/2852) -* Handle changes to `go test -v` output. - [[GH-2743]](https://github.com/fatih/vim-go/pull/2743) -* Add `g:go_gopls_mod_tempfile` to configure `gopls`' `tempModfile` - configuration. - [[GH-2747]](https://github.com/fatih/vim-go/pull/2747) -* Add `g:go_gopls_options` to configure `gopls`' commandline options. - [[GH-2747]](https://github.com/fatih/vim-go/pull/2747) -* Improve readability of gopls logs. - [[GH-2773]](https://github.com/fatih/vim-go/pull/2773) -* Introduce `g:go_implements_mode` to allow `:GoImplements` to be satisfied - with `gopls`. - [[GH-2741]](https://github.com/fatih/vim-go/pull/2741) - [[GH-2799]](https://github.com/fatih/vim-go/pull/2799) -* Introduce `g:go_imports_mode` to allow `:GoImports` to be satisfied with - `gopls`. - [[GH-2791]](https://github.com/fatih/vim-go/pull/2791) - [[GH-2794]](https://github.com/fatih/vim-go/pull/2794) - [[GH-2796]](https://github.com/fatih/vim-go/pull/2796) - [[GH-2848]](https://github.com/fatih/vim-go/pull/2848) -* Send LSP synchronization messages to `gopls` when the file does not yet exist - on disk as long as its directory exists. - [[GH-2805]](https://github.com/fatih/vim-go/pull/2805) -* Run `gogetdoc` in the buffer's directory so that it will work regardless of - the user's working directory in module-aware mode. - [[GH-2804]](https://github.com/fatih/vim-go/pull/2804) -* Add `g:go_gopls_analyses` to support `gopls`' analyses options. - [[GH-2820]](https://github.com/fatih/vim-go/pull/2820) -* Add `g:go_gopls_local` to support `gopls`' local option to control how third - party imports are organized. - [[GH-2821]](https://github.com/fatih/vim-go/pull/2821) -* Use gopls to get documentation and documentation links for identifiers under - the cursor. - [[GH-2822]](https://github.com/fatih/vim-go/pull/2822) - [[GH-2839]](https://github.com/fatih/vim-go/pull/2839) -* Clarify documentation for terminal options. - [[GH-2843]](https://github.com/fatih/vim-go/pull/2843) - -BUG FIXES: -* Use the discovered full path for gopls when renaming. - [[GH-2692]](https://github.com/fatih/vim-go/pull/2692) -* Execute commands correctly on windows when `'shell'` is not cmd.exe - [[GH-2713]](https://github.com/fatih/vim-go/pull/2713) - [[GH-2724]](https://github.com/fatih/vim-go/pull/2724) -* Always execute `errcheck` in the current package's directory. - [[GH-2726]](https://github.com/fatih/vim-go/pull/2726) -* Fix errors when highlighting diagnostics after a `:GoImports`. - [[GH-2746]](https://github.com/fatih/vim-go/pull/2746) -* Preserve errors from formatting when both formatting and metalinting happen - on save. - [[GH-2733]](https://github.com/fatih/vim-go/pull/2733) - [[GH-2810]](https://github.com/fatih/vim-go/pull/2810) -* Preserve ordering of gopls messages in the log. - [[GH-2753]](https://github.com/fatih/vim-go/pull/2753) -* Fix `:GoDef` on windows when `g:go_def_mode` is set to `gopls`. - [[GH-2768]](https://github.com/fatih/vim-go/pull/2768) -* Handle null values from `gopls`. - [[GH-2778]](https://github.com/fatih/vim-go/pull/2778) -* Preserve diagnostics highlights after formatting. - [[GH-2779]](https://github.com/fatih/vim-go/pull/2779) -* Fix the decoding and encoding of multi-byte file paths received from and sent - to `gopls`. - [[GH-2784]](https://github.com/fatih/vim-go/pull/2784) -* Fix `:GoRun` so that it works as expected when the current working directory - is neither in GOPATH nor within a module. - [[GH-2782]](https://github.com/fatih/vim-go/pull/2782) - [[GH-2818]](https://github.com/fatih/vim-go/pull/2818) - [[GH-2842]](https://github.com/fatih/vim-go/pull/2842) -* Use absolute file paths for `:GoRun`'s arguments in terminal mode. - [[GH-2844]](https://github.com/fatih/vim-go/pull/2844) -* Show the command executed by `:GoRun` when `g:go_debug` includes `'shell-commands'`. - [[GH-2785]](https://github.com/fatih/vim-go/pull/2785) - [[GH-2817]](https://github.com/fatih/vim-go/pull/2817) -* Clear the list for formatting errors when `g:go_fmt_command` is `gopls`. - [[GH-2790]](https://github.com/fatih/vim-go/pull/2790) -* Handle text edits from gopls that are only line insertions. - [[GH-2802]](https://github.com/fatih/vim-go/pull/2802) - [[GH-2803]](https://github.com/fatih/vim-go/pull/2803) -* Add `g:go_imports_autosave` so that imports can be adjusted on save when - `g:go_imports_mode` is set to `gopls`. - [[GH-2800]](https://github.com/fatih/vim-go/pull/2800) - [[GH-2858]](https://github.com/fatih/vim-go/pull/2858) -* Correct vim-go's help to correctly identify `g:go_referrer_mode`'s default. - [[GH-2832]](https://github.com/fatih/vim-go/pull/2832) -* Clear the quickfix list when `:GoLint` succeeds. - [[GH-2833]](https://github.com/fatih/vim-go/pull/2833) -* Respect arguments to `:GoDocBrowser`. - [[GH-2822]](https://github.com/fatih/vim-go/pull/2822) -* Use the correct path to documentation for struct fields with `:GoDocBrowser`. - [[GH-2822]](https://github.com/fatih/vim-go/pull/2822) -* Do not try parsing errors from terminal jobs when the working directory has - been removed. - [[GH-2824]](https://github.com/fatih/vim-go/pull/2824) -* Document that `g:go_jump_to_error` apples to running the metalinter on save, - too. - [[GH-2854]](https://github.com/fatih/vim-go/pull/2854) -* Ignore commented out import statements when executing `:GoImport`. - [[GH-2862]](https://github.com/fatih/vim-go/pull/2862) -* Interpret file paths in `go vet` errors relative to the current buffer's - directory. - [[GH-2882]](https://github.com/fatih/vim-go/pull/2882) - -## v1.22 - (January 30, 2020) - -BACKWARDS INCOMPATIBILITIES: -* Drop support for Vim 7.4. The minimum required version of Vim is now 8.0.1453. - [[GH-2495]](https://github.com/fatih/vim-go/pull/2495) - [[GH-2497]](https://github.com/fatih/vim-go/pull/2497) -* Drop support for `gometalinter` - [[GH-2494]](https://github.com/fatih/vim-go/pull/2494) - -IMPROVEMENTS: -* Highlight the `go` keyword in go.mod files. - [[GH-2473]](https://github.com/fatih/vim-go/pull/2473) -* Use echo functions consistently. - [[GH-2458]](https://github.com/fatih/vim-go/pull/2458) -* Add support for managing goroutines in debugger. - [[GH-2463]](https://github.com/fatih/vim-go/pull/2463) - [[GH-2527]](https://github.com/fatih/vim-go/pull/2527) -* Document `g:go_doc_popup_window`. - [[GH-2506]](https://github.com/fatih/vim-go/pull/2506) -* Make `g:go_doc_popup_window=1` work for Neovim, too. - [[GH-2451]](https://github.com/fatih/vim-go/pull/2451) - [[GH-2512]](https://github.com/fatih/vim-go/pull/2512) -* Handle errors jumping to a definition in a file open in another Vim process - better. - [[GH-2518]](https://github.com/fatih/vim-go/pull/2518) -* Improve the UX when the gopls binary is missing. - [[GH-2522]](https://github.com/fatih/vim-go/pull/2522) -* Use gopls instead of guru for `:GoSameIds`. - [[GH-2519]](https://github.com/fatih/vim-go/pull/2519) -* Use gopls instead of guru for `:GoReferrers`. - [[GH-2535]](https://github.com/fatih/vim-go/pull/2535) -* Update documentation for `g:go_addtags_transform`. - [[GH-2541]](https://github.com/fatih/vim-go/pull/2541) -* Install most helper tools in module aware mode. - [[GH-2545]](https://github.com/fatih/vim-go/pull/2545) -* Add a new option, `g:go_referrers_mode` to allow the user to choose whether - to use gopls or guru for finding references. - [[GH-2566]](https://github.com/fatih/vim-go/pull/2566) -* Add options to control how gopls responds to completion requests. - [[GH-2567]](https://github.com/fatih/vim-go/pull/2567) - [[GH-2568]](https://github.com/fatih/vim-go/pull/2568) -* Add syntax highlighting for binary literals. - [[GH-2557]](https://github.com/fatih/vim-go/pull/2557) -* Improve highlighting of invalid numeric literals. - [[GH-2571]](https://github.com/fatih/vim-go/pull/2571) - [[GH-2587]](https://github.com/fatih/vim-go/pull/2587) - [[GH-2589]](https://github.com/fatih/vim-go/pull/2589) - [[GH-2584]](https://github.com/fatih/vim-go/pull/2584) - [[GH-2597]](https://github.com/fatih/vim-go/pull/2597) - [[GH-2599]](https://github.com/fatih/vim-go/pull/2599) -* Add highlighting of sections reported by gopls diagnostics' errors - and warnings. - [[GH-2569]](https://github.com/fatih/vim-go/pull/2569) - [[GH-2643]](https://github.com/fatih/vim-go/pull/2643) -* Make the highlighting of fzf decls configurable. - [[GH-2572]](https://github.com/fatih/vim-go/pull/2572) - [[GH-2579]](https://github.com/fatih/vim-go/pull/2579) -* Support renaming with gopls. - [[GH-2577]](https://github.com/fatih/vim-go/pull/2577) - [[GH-2618]](https://github.com/fatih/vim-go/pull/2618) -* Add an option, `g:go_gopls_enabled`, to allow gopls integration to be - disabled. - [[GH-2605]](https://github.com/fatih/vim-go/pull/2605) - [[GH-2609]](https://github.com/fatih/vim-go/pull/2609) - [[GH-2638]](https://github.com/fatih/vim-go/pull/2638) - [[GH-2640]](https://github.com/fatih/vim-go/pull/2640) -* Add a buffer level option, `b:go_fmt_options`, to control formatting options - per buffer. - [[GH-2613]](https://github.com/fatih/vim-go/pull/2613) -* Use build tags when running `:GoVet`. - [[GH-2615]](https://github.com/fatih/vim-go/pull/2615) -* Add new snippets for UltiSnips. - [[GH-2623]](https://github.com/fatih/vim-go/pull/2623) - [[GH-2627]](https://github.com/fatih/vim-go/pull/2627) -* Expand completions as snippets when `g:go_gopls_use_placeholders` is set. - [[GH-2624]](https://github.com/fatih/vim-go/pull/2624) -* Add a new function, `:GoDiagnostics` and an associated mapping for seeing - `gopls` diagnostics. Because of the performance implications on large - projects, `g:go_diagnostics_enabled` controls whether all diagnostics are - processed or only the diagnostics for the current buffer. - [[GH-2612]](https://github.com/fatih/vim-go/pull/2612) -* Explain how to find and detect multiple copies of vim-go in the FAQ. - [[GH-2632]](https://github.com/fatih/vim-go/pull/2632) -* Update the issue template to ask for the gopls version and - `:GoReportGitHubIssue` to provide it. - [[GH-2630]](https://github.com/fatih/vim-go/pull/2630) -* Use text properties when possible for some highlighting cases. - [[GH-2652]](https://github.com/fatih/vim-go/pull/2652) - [[GH-2662]](https://github.com/fatih/vim-go/pull/2662) - [[GH-2663]](https://github.com/fatih/vim-go/pull/2663) - [[GH-2672]](https://github.com/fatih/vim-go/pull/2672) - [[GH-2678]](https://github.com/fatih/vim-go/pull/2678) - - -BUG FIXES: -* Fix removal of missing directories from gopls workspaces. - [[GH-2507]](https://github.com/fatih/vim-go/pull/2507) -* Change to original window before trying to change directories when term job - ends. - [[GH-2508]](https://github.com/fatih/vim-go/pull/2508) -* Swallow errors when the hover info cannot be determined. - [[GH-2515]](https://github.com/fatih/vim-go/pull/2515) -* Fix errors when trying to debug lsp and hover. - [[GH-2516]](https://github.com/fatih/vim-go/pull/2516) -* Reset environment variables on Vim <= 8.0.1831 . - [[GH-2523]](https://github.com/fatih/vim-go/pull/2523) -* Handle empty results from delve. - [[GH-2526]](https://github.com/fatih/vim-go/pull/2526) -* Do not overwrite `updatetime` when `g:go_auto_sameids` or - `g:go_auto_type_info` is set. - [[GH-2529]](https://github.com/fatih/vim-go/pull/2529) -* Fix example for `g:go_debug_log_output` in docs. - [[GH-2547]](https://github.com/fatih/vim-go/pull/2547) -* Use FileChangedShellPost instead of FileChangedShell so that reload messages - are not hidden. - [[GH-2549]](https://github.com/fatih/vim-go/pull/2549) -* Restore cwd after `:GoTest` when `g:go_term_enabled` is set. - [[GH-2556]](https://github.com/fatih/vim-go/pull/2556) -* Expand struct variable correctly in the variables debug window. - [[GH-2574]](https://github.com/fatih/vim-go/pull/2574) -* Show output from errcheck when there are failures other than problems it can - report. - [[GH-2667]](https://github.com/fatih/vim-go/pull/2667) - -## v1.21 - (September 11, 2019) - -BACKWARDS INCOMPATIBILITIES: -* `g:go_metalinter_disabled` has been removed. - [[GH-2375]](https://github.com/fatih/vim-go/pull/2375) - -IMPROVEMENTS: -* Add a new option, `g:go_code_completion_enabled`, to control whether omnifunc - is set. - [[GH-2229]](https://github.com/fatih/vim-go/pull/2229) -* Use build tags with golangci-lint. - [[GH-2261]](https://github.com/fatih/vim-go/pull/2261) -* Allow debugging of packages outside of GOPATH without a go.mod file. - [[GH-2269]](https://github.com/fatih/vim-go/pull/2269) -* Show which example failed when Example tests fail - [[GH-2277]](https://github.com/fatih/vim-go/pull/2277) -* Show function signature and return types in preview window when autocompleting functions and methods. - [[GH-2289]](https://github.com/fatih/vim-go/pull/2289) -* Improve the user experience when using null modules. - [[GH-2300]](https://github.com/fatih/vim-go/pull/2300) -* Modify `:GoReportGitHubIssue` to include vim-go configuration values - [[GH-2323]](https://github.com/fatih/vim-go/pull/2323) -* Respect `g:go_info_mode='gopls'` in go#complete#GetInfo. - [[GH-2313]](https://github.com/fatih/vim-go/pull/2313) -* Allow `:GoLint`, `:GoErrCheck`, and `:GoDebug` to work in null modules. - [[GH-2335]](https://github.com/fatih/vim-go/pull/2335) -* Change default value for `g:go_info_mode` and `g:go_def_mode` to `'gopls'`. - [[GH-2329]](https://github.com/fatih/vim-go/pull/2329) -* Add a new option, `g:go_doc_popup_window` to optionally use a popup window - for godoc in Vim 8.1.1513 and later. - [[GH-2347]](https://github.com/fatih/vim-go/pull/2347) -* Add `:GoAddWorkspace` function to support multiple workspaces with gopls. - [[GH-2356]](https://github.com/fatih/vim-go/pull/2356) -* Install gopls from its stable package. - [[GH-2360]](https://github.com/fatih/vim-go/pull/2360) -* Disambiguate progress message when initializing gopls. - [[GH-2369]](https://github.com/fatih/vim-go/pull/2369) -* Calculate LSP position correctly when on a line that contains multi-byte - characters before the position. - [[GH-2389]](https://github.com/fatih/vim-go/pull/2389) -* Calculate Vim position correctly from LSP text position. - [[GH-2395]](https://github.com/fatih/vim-go/pull/2395) -* Use the statusline to display gopls initialization status messages and only - echo the statuses when `g:go_echo_command_info` is set. - [[GH-2422]](https://github.com/fatih/vim-go/pull/2422) -* Send configuration to gopls so that build tags will be considered and hover - content won't have documentation. - [[GH-2429]](https://github.com/fatih/vim-go/pull/2429) -* Add a new option, `g:go_term_close_on_exit`, to control whether jobs run in a - terminal window will close the terminal window when the job exits. - [[GH-2409]](https://github.com/fatih/vim-go/pull/2409) -* Allow `g:go_template_file` and `g:go_template_test_files` to reside outside - of vim-go's template directory. - [[GH-2434]](https://github.com/fatih/vim-go/pull/2434) -* Add a new command, `:GoLSPDebugBrowser`, to open a browser to gopls debugging - view. - [[GH-2436]](https://github.com/fatih/vim-go/pull/2436) -* Restart gopls automatically when it is updated via `:GoUpdateBinaries`. - [[GH-2453]](https://github.com/fatih/vim-go/pull/2453) -* Reset `'more'` while installing binaries to avoid unnecessary more prompts. - [[GH-2457]](https://github.com/fatih/vim-go/pull/2457) -* Highlight `%w` as a format specifier (for Go 1.13). - [[GH-2433]](https://github.com/fatih/vim-go/pull/2433) -* Handle changes to Go 1.13's go vet output that gometalinter isn't expecting. - [[GH-2475]](https://github.com/fatih/vim-go/pull/2475) -* Make `golangci-lint` the default value for `g:go_metalinter_command`. - [[GH-2478]](https://github.com/fatih/vim-go/pull/2478) -* Parse compiler errors from Go 1.13 `go vet` correctly. - [[GH-2485]](https://github.com/fatih/vim-go/pull/2485) - -BUG FIXES: -* display info about function and function types whose parameters are - `interface{}` without truncating the function signature. - [[GH-2244]](https://github.com/fatih/vim-go/pull/2244) -* install tools that require GOPATH mode when in module mode. - [[GH-2253]](https://github.com/fatih/vim-go/pull/2253) -* Detect GOPATH when starting `gopls` - [[GH-2255]](https://github.com/fatih/vim-go/pull/2255) -* Handle `gopls` responses in the same window from which the respective request - originated. - [[GH-2266]](https://github.com/fatih/vim-go/pull/2266) -* Show completion matches from gocode. - [[GH-2267]](https://github.com/fatih/vim-go/pull/2267) -* Show the completion preview window. - [[GH-2268]](https://github.com/fatih/vim-go/pull/2268) -* Set the anchor for method documentation correctly. - [[GH-2276]](https://github.com/fatih/vim-go/pull/2276) -* Respect the LSP information for determining where candidate matches start. - [[GH-2291]](https://github.com/fatih/vim-go/pull/2291) -* Restore environment variables with backslashes correctly. - [[GH-2292]](https://github.com/fatih/vim-go/pull/2292) -* Modify handling of gopls output for `:GoInfo` to ensure the value will be - displayed. - [[GH-2311]](https://github.com/fatih/vim-go/pull/2311) -* Run `:GoLint` successfully in null modules. - [[GH-2318]](https://github.com/fatih/vim-go/pull/2318) -* Ensure actions on save work in new buffers that have not yet been persisted to disk. - [[GH-2319]](https://github.com/fatih/vim-go/pull/2319) -* Restore population of information in `:GoReportGitHubIssue`. - [[GH-2312]](https://github.com/fatih/vim-go/pull/2312) -* Do not jump back to the originating window when jumping to definitions with - `g:go_def_mode='gopls'`. - [[GH-2327]](https://github.com/fatih/vim-go/pull/2327) -* Fix getting information about a valid identifier for which gopls returns no - information (e.g. calling `:GoInfo` on a package identifier). - [[GH-2339]](https://github.com/fatih/vim-go/pull/2339) -* Fix tab completion of package names on the cmdline in null modules. - [[GH-2342]](https://github.com/fatih/vim-go/pull/2342) -* Display identifier info correctly when the identifier has no godoc. - [[GH-2373]](https://github.com/fatih/vim-go/pull/2373) -* Fix false positives when saving a buffer and `g:go_metalinter_command` is - `golangci-lint`. - [[GH-2367]](https://github.com/fatih/vim-go/pull/2367) -* Fix `:GoDebugRestart`. - [[GH-2390]](https://github.com/fatih/vim-go/pull/2390) -* Do not execute tests twice in terminal mode. - [[GH-2397]](https://github.com/fatih/vim-go/pull/2397) -* Do not open a new buffer in Neovim when there are compilation errors and - terminal mode is enabled. - [[GH-2401]](https://github.com/fatih/vim-go/pull/2401) -* Fix error due to typo in implementation of `:GoAddWorkspace`. - [[GH-2415]](https://github.com/fatih/vim-go/pull/2401) -* Do not format the file automatically when `g:go_format_autosave` is set and - the file being written is not the current file. - [[GH-2442]](https://github.com/fatih/vim-go/pull/2442) -* Fix `go-debug-stepout` mapping. - [[GH-2464]](https://github.com/fatih/vim-go/pull/2464) -* Handle paths with spaces correctly when executing jobs. - [[GH-2472]](https://github.com/fatih/vim-go/pull/2472) -* Remove a space in the default value for `g:go_debug_log_output`, so that - Delve will start on Windows. - [[GH-2480]](https://github.com/fatih/vim-go/pull/2480) - -## 1.20 - (April 22, 2019) - -FEATURES: -* ***gopls support!*** - * use gopls for autocompletion by default in Vim8 and Neovim. - * use gopls for `:GoDef` by setting `g:go_def_mode='gopls'`. - * use gopls for `:GoInfo` by setting `g:go_info_mode='gopls'`. -* Add support for golangci-lint. - * set `g:go_metalinter_command='golangci-lint'` to use golangci-lint instead - of gometalinter. -* New `:GoDefType` command to jump to a type definition from an instance of the - type. - -BACKWARDS INCOMPATIBILITIES: -* `g:go_highlight_function_arguments` is renamed to `g:go_highlight_function_parameters` - [[GH-2117]](https://github.com/fatih/vim-go/pull/2117) - -IMPROVEMENTS: -* Disable `g:go_gocode_propose_source` by default. - [[GH-2050]](https://github.com/fatih/vim-go/pull/2050) -* Don't spam users when Vim is run with vi compatibility. - [[GH-2055]](https://github.com/fatih/vim-go/pull/2055) -* Add bang support to lint commands to allow them to be run without jumping to - errors. - [[GH-2056]](https://github.com/fatih/vim-go/pull/2056) -* Use `go doc` for `:GoDoc` instead of `godoc`. - [[GH-2070]](https://github.com/fatih/vim-go/pull/2070) -* Detach from and shutdown dlv correctly. - [[GH-2075]](https://github.com/fatih/vim-go/pull/2075) -* Do not require `'autowrite'` or `'autowriteall'` to be set when using - autocompletion in module mode. - [[GH-2091]](https://github.com/fatih/vim-go/pull/2091) -* Fix use of `g:go_metalinter_command` _and_ apply it even when autosaving. - [[GH-2101]](https://github.com/fatih/vim-go/pull/2101) -* Report errors in quickfix when Delve fails to start (e.g. compiler errors). - [[GH-2111]](https://github.com/fatih/vim-go/pull/2111) -* Support `'undo_ftplugin'`, make most autocmds buffer-local, and only do the - bare minimum based on file names alone. - [[GH-2108]](https://github.com/fatih/vim-go/pull/2108) -* Write a message when `:GoInfo` can't display any results when `g:go_info_mode='gocode'`. - [[GH-2122]](https://github.com/fatih/vim-go/pull/2122) -* Highlight fields followed by an operator when `g:go_highlight_fields` is set. - [[GH-1907]](https://github.com/fatih/vim-go/pull/1907) -* Skip autosave actions when the buffer is not a readable file. - [[GH-2143]](https://github.com/fatih/vim-go/pull/2143) -* Run `godef` from the current buffer's directory to make sure it works with modules. - [[GH-2150]](https://github.com/fatih/vim-go/pull/2150) -* Add a function, `go#tool#DescribeBalloon`, to show information in a balloon - with `'balloonexpr'`. (Vim8 only). - [[GH-1975]](https://github.com/fatih/vim-go/pull/1975) -* Add initial support for `gopls`. - [[GH-2163]](https://github.com/fatih/vim-go/pull/2163). -* Add `:GoDefType` to jump to the type definition of the identifier under the - cursor. - [[GH-2165]](https://github.com/fatih/vim-go/pull/2165) -* Notify gopls about changes. - [[GH-2171]](https://github.com/fatih/vim-go/pull/2171) -* Respect `g:go_jump_to_error` when running `gometalinter` automatically on - save. [[GH-2176]](https://github.com/fatih/vim-go/pull/2176) -* Use gopls for code completion by default in Vim8 and Neovim. - [[GH-2172]](https://github.com/fatih/vim-go/pull/2172) -* Add support for golangci-lint. - [[GH-2182]](https://github.com/fatih/vim-go/pull/2182) -* Show hover balloon using gopls instead of gocode. - [[GH-2202]](https://github.com/fatih/vim-go/pull/2202) -* Add a new option, `g:go_debug_log_output`, to control logging with the - debugger. - [[GH-2203]](https://github.com/fatih/vim-go/pull/2203) -* Do not jump to quickfix or location list window when bang is used for async - jobs or linting. - [[GH-2205]](https://github.com/fatih/vim-go/pull/2205) -* Tab complete package names for commands from vendor directories and in - modules. - [[GH-2213]](https://github.com/fatih/vim-go/pull/2213) -* Add support for `gopls` to `g:go_info_mode`. - [[GH-2224]](https://github.com/fatih/vim-go/pull/2224) - -BUG FIXES: -* Fix opening of non-existent file from `:GoDeclsDir` when the current - directory is not the directory containing the current buffer. - [[GH-2048]](https://github.com/fatih/vim-go/pull/2048) -* Fix jumping to an identifier with godef from a modified buffer. - [[GH-2054]](https://github.com/fatih/vim-go/pull/2054) -* Fix errors when `g:go_debug` contains `debugger-commands`. - [[GH-2075]](https://github.com/fatih/vim-go/pull/2075) -* Fix errors from `:GoDebugStop` in Neovim. - [[GH-2075]](https://github.com/fatih/vim-go/pull/2075) -* Fix `:GoSameIdsToggle`. - [[GH-2086]](https://github.com/fatih/vim-go/pull/2086) -* Do not set fileencoding or fileformat options or populate from template when - the buffer is not modifiable. - [[GH-2097]](https://github.com/fatih/vim-go/pull/2097) -* Do not clear buffer-local autocmds of other buffers. - [[GH-2109]](https://github.com/fatih/vim-go/pull/2109) -* Highlight return parameter types when g:go_highlight_function_arguments is - set. [[GH-2116]](https://github.com/fatih/vim-go/pull/2116) -* Fix lockup in Neovim when trying to run `:GoDebugTest` when there are no - tests. [[GH-2125]](https://github.com/fatih/vim-go/pull/2125) -* Keep track of breakpoints correctly when buffer is edited after breakpoints - are set. - [[GH-2126]](https://github.com/fatih/vim-go/pull/2126) -* Fix race conditions in `:GoDebugStop`. - [[GH-2127]](https://github.com/fatih/vim-go/pull/2127) -* Fix jumping to module or package using godef. - [[GH-2141]](https://github.com/fatih/vim-go/pull/2141) -* Fix errors caused by redefining functions within functions. - [[GH-2189]](https://github.com/fatih/vim-go/pull/2189) -* Highlight pre-release and metadata in versions in go.mod. - [[GH-2192]](https://github.com/fatih/vim-go/pull/2192) -* Handle runtime panics from `:GoRun` when using Neovim's terminal. - [[GH-2209]](https://github.com/fatih/vim-go/pull/2209) -* Fix adding tag option when a tag is added. - [[GH-2227]](https://github.com/fatih/vim-go/pull/2227) - -## 1.19 - (November 4, 2018) - -FEATURES: - -* **go.mod file support!** This is the first feature for upcoming Go modules - support. The followings are added: - * Syntax highlighting for the `go.mod` file. - * A new `gomod` filetype is set if a `go.mod` file has been opened and starts - with the line `module ` - * New **:GoModFmt** command that formats the `go.mod` file - * Auto format on save feature for `:GoModFmt`, enabled automatically. Can be - toggled of with the setting `g:go_mod_fmt_autosave` or with the command: - `GoModFmtAutoSaveToggle` - [[GH-1931]](https://github.com/fatih/vim-go/pull/1931) - -IMPROVEMENTS: -* Unify async job handling for Vim8 and Neovim. - [[GH-1864]](https://github.com/fatih/vim-go/pull/1864) -* Document Vim and Neovim requirements in README.md and help file. - [[GH-1889]](https://github.com/fatih/vim-go/pull/1889) -* Highlight `context.Context` when `g:go_highlight_extra_types` is set. - [[GH-1903]](https://github.com/fatih/vim-go/pull/1903) -* Run gometalinter asynchronously in Neovim. - [[GH-1901]](https://github.com/fatih/vim-go/pull/1901) -* Run gorename asynchronously in Vim8 and Neovim. - [[GH-1894]](https://github.com/fatih/vim-go/pull/1894) -* Install keyify from its canonical import path. - [[GH-1924]](https://github.com/fatih/vim-go/pull/1924) -* Update the tested version of Neovim to v0.3.1. - [[GH-1923]](https://github.com/fatih/vim-go/pull/1923) -* Run autocompletion asynchronously in Vim8 and Neovim. - [[GH-1926]](https://github.com/fatih/vim-go/pull/1926) -* Show statusline update when running `:GoInfo` with `g:go_info_mode='gocode'`. - [[GH-1937]](https://github.com/fatih/vim-go/pull/1937) -* Do not update statusline when highlighting sameids or showing type info via - an autocmd. - [[GH-1937]](https://github.com/fatih/vim-go/pull/1937) -* Do not indent within a raw string literal. - [[GH-1858]](https://github.com/fatih/vim-go/pull/1858) -* Highlight Go's predeclared function identifiers (the functions in `builtins`) - using keyword groups and highlight them using the `Identifiers` group. - [[GH-1939]](https://github.com/fatih/vim-go/pull/1939) -* Add a new FAQ entry to instruct users how to modify the vim-go highlight - groups. - [[GH-1939]](https://github.com/fatih/vim-go/pull/1939) -* Improve use of statusline and progress messages. - [[GH-1948]](https://github.com/fatih/vim-go/pull/1948) -* Add `tt` snippet to create a table test boilerplate (see - https://github.com/golang/go/wiki/TableDrivenTests for more information on - how to use a table driven test). - [[GH-1956]](https://github.com/fatih/vim-go/pull/1956) -* Add `(go-decls)` and `(go-decls-dir)` mappings. - [[GH-1964]](https://github.com/fatih/vim-go/pull/1964) -* Handle go1.11 test output. - [[GH-1978]](https://github.com/fatih/vim-go/pull/1978) -* Internal: install tools by their custom names - [[GH-1984]](https://github.com/fatih/vim-go/pull/1984) -* Support the go-debugger features in Neovim. - [[GH-2007]](https://github.com/fatih/vim-go/pull/2007) -* color the statusline for termguicolors and Neovim. - [[GH-2014]](https://github.com/fatih/vim-go/pull/2014) -* add an option to disable highlighting of breakpoints and the current line - when debugging. - [[GH-2025]](https://github.com/fatih/vim-go/pull/2025) -* Update autocompletion to work with Go modules. - [[GH-1988]](https://github.com/fatih/vim-go/pull/1988) -* Add an option to search $GOPATH/bin or $GOBIN _after_ $PATH. - [[GH-2041]](https://github.com/fatih/vim-go/pull/2041) - -BUG FIXES: -* Fix `:GoRun %` on Windows. - [[GH-1900]](https://github.com/fatih/vim-go/pull/1900) -* Fix `go#complete#GetInfo()` to return a description of the identifier. - [[GH-1905]](https://github.com/fatih/vim-go/pull/1905) -* Restore support for running tests in the Neovim terminal. - [[GH-1895]](https://github.com/fatih/vim-go/pull/1895) -* Fix `:GoInfo` when `g:go_info_mode` is `gocode` - [[GH-1915]](https://github.com/fatih/vim-go/pull/1915) -* Fix highlighting of pointer type in var blocks. - [[GH-1794]](https://github.com/fatih/vim-go/pull/1794) -* Fix `:GoImport` when adding to an empty import block (i.e`import ()`) - [[GH-1938]](https://github.com/fatih/vim-go/pull/1938) -* Run shell commands with shellcmdflag set to `-c`. - [[GH-2006]](https://github.com/fatih/vim-go/pull/2006) -* Use the correct log output option for delve. - [[GH-1992]](https://github.com/fatih/vim-go/pull/1992) -* Pass empty arguments correctly in async jobs on Windows. - [[GH-2011]](https://github.com/fatih/vim-go/pull/2011) -* Don't close godoc scratch window when using arrow keys. - [[GH-2021]](https://github.com/fatih/vim-go/pull/2021) - -BACKWARDS INCOMPATIBILITIES: -* Bump minimum required version of Vim to 7.4.2009. - [[GH-1899]](https://github.com/fatih/vim-go/pull/1899) -* Switch gocode to github.com/mdempsky/gocode. Several gocode options have been - removed and a new one has been added. - [[GH-1853]](https://github.com/fatih/vim-go/pull/1853) - -## 1.18 - (July 18, 2018) - -FEATURES: - -* Add **:GoIfErr** command together with the `(go-iferr)` plug key to - create a custom mapping. This command generates an `if err != nil { return ... }` - automatically which infer the type of return values and the numbers. - For example: - - ``` - func doSomething() (string, error) { - f, err := os.Open("file") - } - ``` - - Becomes: - - ``` - func doSomething() (string, error) { - f, err := os.Open("file") - if err != nil { - return "", err - } - } - ``` - -* Two new text objects has been added: - * `ic` (inner comment) selects the content of the comment, excluding the start/end markers (i.e: `//`, `/*`) - * `ac` (a comment) selects the content of the whole commment block, including markers - To use this new feature, make sure you use use the latest version of - [motion](https://github.com/fatih/motion). You can update the tool from Vim - via `:GoUpdateBinaries` - [[GH-1779]](https://github.com/fatih/vim-go/pull/1779) -* Add `:GoPointsTo` to show all variables to which the pointer under the cursor - may point to. - [[GH-1751]](https://github.com/fatih/vim-go/pull/1751) -* Add `:GoReportGitHubIssue` to initialize a new GitHub issue with as much data - that our template requests as possible. - [[GH-1738]](https://github.com/fatih/vim-go/pull/1738) - -IMPROVEMENTS: - -* Add build tags (with `g:go_build_tags`) to all commands that support it. - [[GH-1705]](https://github.com/fatih/vim-go/pull/1705) -* Some command which operate on files (rather than Vim buffers) will now show a - warning if there are unsaved buffers, similar to Vim's `:make`. - [[GH-1754]](https://github.com/fatih/vim-go/pull/1754) -* Don't return an error from `:GoGuru` functions when the import path is - unknown and scope is unneeded. - [[GH-1826]](https://github.com/fatih/vim-go/pull/1826) -* Performance improvements for the `go.vim` syntax file. - [[GH-1799]](https://github.com/fatih/vim-go/pull/1799) -* Allow `GoDebugBreakpoint` and `GoDebugCurrent` highlight groups to be - overridden by user configuration. - [[GH-1850]](https://github.com/vim-go/pull/1850) -* Strip trailing carriage returns from quickfix errors that are parsed - manually. [[GH-1861]](https://github.com/fatih/vim-go/pull/1861). -* Cleanup title of terminal window. - [[GH-1861]](https://github.com/fatih/vim-go/pull/1861). -* Add `:GoImpl` is able to complete interfaces by their full import path in - addition to the current package name (i.e: `:GoImpl t *T github.com/BurntSushi/toml.Unmarshaller` - is now possible) - [[GH-1884]](https://github.com/fatih/vim-go/pull/1884) - -BUG FIXES: - -* Update the correct window's location list after a long running async job - completes, even when the user changes their window layout while the job is - running. - [[GH-1734]](https://github.com/fatih/vim-go/pull/1734) -* Apply debugger mappings only for Go buffers, and not all buffers. - [[GH-1696]](https://github.com/fatih/vim-go/pull/1696) -* The `gohtmltmpl` filetype will now highlight `{{ .. }}` syntax HTML attributes - and some other locations. - [[GH-1790]](https://github.com/fatih/vim-go/pull/1790) -* Use the correct logging flag argument for delve. - [[GH-1809]](https://github.com/fatih/vim-go/pull/1809) -* Fix gocode option string values that would cause gocode settings not to set - correctly - [[GH-1818]](https://github.com/fatih/vim-go/pull/1818) -* Fix Neovim handling of guru output. - [[GH-1846]](https://github.com/fatih/vim-go/pull/1846) -* Execute commands correctly when they are in $GOBIN but not $PATH. - [[GH-1866]](https://github.com/fatih/vim-go/pull/1866) -* Open files correctly with ctrlp. - [[GH-1878]](https://github.com/fatih/vim-go/pull/1878) -* Fix checking guru binary path - [[GH-1886]](https://github.com/fatih/vim-go/pull/1886) -* Add build tags to `:GoDef` if only it's present - [[GH-1882]](https://github.com/fatih/vim-go/pull/1882) - -## 1.17 - (March 27, 2018) - -FEATURES: - -* **Debugger support!** Add integrated support for the - [`delve`](https://github.com/go-delve/delve) debugger. Use - `:GoInstallBinaries` to install `dlv`, and see `:help go-debug` to get - started. - [[GH-1390]](https://github.com/fatih/vim-go/pull/1390) - -IMPROVEMENTS: - -* Add descriptions to neosnippet abbrevations. - [[GH-1639]](https://github.com/fatih/vim-go/pull/1639) -* Show messages in the location list instead of the quickfix list when - `gometalinter` is run automatically when saving a buffer. Whether the - location list or quickfix list is used can be customized in the usual ways. - [[GH-1652]](https://github.com/fatih/vim-go/pull/1652) -* Redraw the screen before executing blocking calls to gocode. - [[GH-1671]](https://github.com/fatih/vim-go/pull/1671) -* Add `fe` -> `fmt.Errorf()` snippet for NeoSnippet and UltiSnippets. - [[GH-1677]](https://github.com/fatih/vim-go/pull/1677) -* Use the async api when calling guru from neovim. - [[GH-1678]](https://github.com/fatih/vim-go/pull/1678) -* Use the async api when calling gocode to get type info. - [[GH-1697]](https://github.com/fatih/vim-go/pull/1697) -* Cache import path lookups to improve responsiveness. - [[GH-1713]](https://github.com/fatih/vim-go/pull/1713) - -BUG FIXES: - -* Create quickfix list correctly when tests timeout. - [[GH-1633]](https://github.com/fatih/vim-go/pull/1633) -* Apply `g:go_test_timeout` when running `:GoTestFunc`. - [[GH-1631]](https://github.com/fatih/vim-go/pull/1631) -* The user's configured `g:go_doc_url` variable wasn't working correctly in the - case when the "gogetdoc" command isn't installed. - [[GH-1629]](https://github.com/fatih/vim-go/pull/1629) -* Highlight format specifiers with an index (e.g. `%[2]d`). - [[GH-1634]](https://github.com/fatih/vim-go/pull/1634) -* Respect `g:go_test_show_name` change for `:GoTest` when it changes during a - Vim session. - [[GH-1641]](https://github.com/fatih/vim-go/pull/1641) -* Show `g:go_test_show_name` value for `:GoTest` failures if it's available. - [[GH-1641]](https://github.com/fatih/vim-go/pull/1641) -* Make sure linter errors for the file being saved are shown in vim74 and nvim. - [[GH-1640]](https://github.com/fatih/vim-go/pull/1640) -* Make sure only linter errors for the file being saved are shown in vim8. - Previously, all linter errors for all files in the current file's directory - were being shown. - [[GH-1640]](https://github.com/fatih/vim-go/pull/1640) -* Make sure gometalinter is run on the given directories when arguments are - given to :GoMetaLinter. - [[GH-1640]](https://github.com/fatih/vim-go/pull/1640) -* Do not run disabled linters with `gometalinter`. - [[GH-1648]](https://github.com/fatih/vim-go/pull/1648) -* Do not prompt user to press enter after when `gometalinter` is called in - autosave mode. - [[GH-1654]](https://github.com/fatih/vim-go/pull/1654) -* Fix potential race conditions when using vim8 jobs. - [[GH-1656]](https://github.com/fatih/vim-go/pull/1656) -* Treat `'autowriteall'` the same as `'autowrite'` when determining whether to - write a buffer before calling some commands. - [[GH-1653]](https://github.com/fatih/vim-go/pull/1653) -* Show the file location of test errors when the message is empty or begins - with a newline. - [[GH-1664]](https://github.com/fatih/vim-go/pull/1664) -* Fix minisnip on Windows. - [[GH-1698]](https://github.com/fatih/vim-go/pull/1698) -* Keep alternate filename when loading an autocreate template. - [[GH-1675]](https://github.com/fatih/vim-go/pull/1675) -* Parse the column number in errors correctly in vim8 and neovim. - [[GH-1716]](https://github.com/fatih/vim-go/pull/1716) -* Fix race conditions in the terminal handling for neovim. - [[GH-1721]](https://github.com/fatih/vim-go/pull/1721) -* Put the user back in the original window regardless of the value of - `splitright` after starting a neovim terminal window. - [[GH-1725]](https://github.com/fatih/vim-go/pull/1725) - -BACKWARDS INCOMPATIBILITIES: - -* Highlighting function and method declarations/calls is fixed. To fix it we - had to remove the meaning of the previous settings. The following setting is - removed: - - * `go_highlight_methods` - - in favor of the following settings and changes: - - * `go_highlight_functions`: This highlights now all function and method - declarations (whereas previously it would also highlight function and - method calls, not anymore) - * `go_highlight_function_calls`: This higlights now all all function and - method calls. - [[GH-1557]](https://github.com/fatih/vim-go/pull/1557) -* Rename g`g:go_metalinter_excludes` to `g:go_metalinter_disabled`. - [[GH-1648]](https://github.com/fatih/vim-go/pull/1648) -* `:GoBuild` doesn't append the `-i` flag anymore due the recent Go 1.10 - changes that introduced a build cache. - [[GH-1701]](https://github.com/fatih/vim-go/pull/1701) - -## 1.16 - (December 29, 2017) - -FEATURES: - -* Add `g:go_doc_url` to change the `godoc` server from `godoc.org` to a custom - private instance. Currently only `godoc -http` instances are supported. - [[GH-1957]](https://github.com/fatih/vim-go/pull/1957). -* New setting `g:go_test_prepend_name` (off by default) to add the failing test - name to the output of `:GoTest` - [[GH-1578]](https://github.com/fatih/vim-go/pull/1578). -* Support [denite.vim](https://github.com/Shougo/denite.nvim) for `:GoDecls[Dir]` - [[GH-1604]](https://github.com/fatih/vim-go/pull/1604). - -IMPROVEMENTS: - -* `:GoRename` is a bit smarter when automatically pre-filling values, and what - gets pre-filled can be configured with `g:go_gorename_prefill` option. - In addition `:GoRename ` now lists some common options. - [[GH-1465]](https://github.com/fatih/vim-go/pull/1465). -* Add support for `g:go_build_tags` to the `:GoTest` family of functions. - [[GH-1562]](https://github.com/fatih/vim-go/pull/1562). -* Pass `--tests` to gometalinter when autosaving and when a custom gometalinter - command has not been set. - [[GH-1563]](https://github.com/fatih/vim-go/pull/1563). -* Do not spam messages when command is run in a directory that does not exist. - [[GH-1527]](https://github.com/fatih/vim-go/pull/1527). -* Run `syntax sync fromstart` after `:GoFmt`; this should make syntax - highlighting break slightly less often after formatting code - [[GH-1582]](https://github.com/fatih/vim-go/pull/1582). -* `:GoDescribe` doesn't require a scope anymore - [[GH-1596]](https://github.com/fatih/vim-go/pull/1596). -* Add some standard snippets for - [vim-minisnip](https://github.com/joereynolds/vim-minisnip) - [[GH-1589]](https://github.com/fatih/vim-go/pull/1589). -* `g:go_snippet_engine` now defaults to `automatic` to use the first installed - snippet engine it can find. - [[GH-1589]](https://github.com/fatih/vim-go/pull/1589). -* Make sure temporary files created for `:GoFmt` end with `.go` suffix as this - is required by some Go formatting tools - [[GH-1601]](https://github.com/fatih/vim-go/pull/1601). - -BUG FIXES: - -* Fix compatibility with Vim version before 7.4.1546 - [[GH-1498]](https://github.com/fatih/vim-go/pull/1498). -* Don't resize godoc window if it's already visible - [[GH-1488]](https://github.com/fatih/vim-go/pull/1488). -* `:GoTestCompile` produces a test binary again. The test binary will be - written to a temporary directory to avoid polluting the user's working - directory. [[GH-1519]](https://github.com/fatih/vim-go/pull/1519) -* Fix incorrect `:GoSameIdsToggle` behavior when there were match groups - present, but none were goSameId. - [[GH-1538]](https://github.com/fatih/vim-go/pull/1538) -* Fix `gpl` snippet for UltiSnips. - [[GH-1535]](https://github.com/fatih/vim-go/pull/1535) -* Fix test output processing to correctly handle panics and log statements. - [[GH-1513]](https://github.com/fatih/vim-go/pull/1513) -* `:GoImpl` tab-completion would sometimes stop working - [[GH-1581]](https://github.com/fatih/vim-go/pull/1581). -* Add `g:go_highlight_function_arguments` to highlight function arguments. - [[GH-1587]](https://github.com/fatih/vim-go/pull/1587). -* Fix installation of `gocode` on MS-Windows. - [[GH-1606]](https://github.com/fatih/vim-go/pull/1606). -* Fix template creation for files in directories that don't exist yet. - [[GH-1618]](https://github.com/fatih/vim-go/pull/1618). -* Fix behavior of terminal windows and resize terminal windows correctly for - all valid `g:go_term_mode` values. - [[GH-1611]](https://github.com/fatih/vim-go/pull/1611). - -BACKWARDS INCOMPATIBILITIES: - -* Display a warning for Vim versions older than 7.4.1689. Older versions may - still work, but are not supported. You can use `let g:go_version_warning = 0` - to disable the warning. - [[GH-1524]](https://github.com/fatih/vim-go/pull/1524). -* `g:go_autodetect_gopath` is *disabled* by default, as support for `vendor` has - been in Go for a while.
- Also change the implementation for `g:go_autodetect_gopath`; instead of manually - setting it before every command it will now be set with the `BufEnter` event, - and reset with the `BufLeave` event. This means that `$GOPATH` will be - changed for all commands run from Vim. - [[GH-1461]](https://github.com/fatih/vim-go/pull/1461) and - [[GH-1525]](https://github.com/fatih/vim-go/pull/1525). -* Update `:GoFillStruct` to check the current line (vs. the exact cursor - position) for a struct literal to fill. To support this, fillstruct made - [backwards imcompatible - changes](https://github.com/davidrjenni/reftools/pull/8). - [[GH-1607]](https://github.com/fatih/vim-go/pull/1607). - -## 1.15 - (October 3, 2017) - -FEATURES: - -* Add `:GoFillStruct` to fill a struct with all fields; uses - [`fillstruct`](https://github.com/davidrjenni/reftools/tree/master/cmd/fillstruct) - [[GH-1443]](https://github.com/fatih/vim-go/pull/1443). - -IMPROVEMENTS: - -* `:GoAddTags` and `:GoRemoveTags` now continue to process if there are - malformed individual struct tags (run `:GoUpdateBinaries` to update - `gomodifiytags` binary) [[GH-1401]](https://github.com/fatih/vim-go/pull/1401) -* `:GoAddTags` and `:GoRemoveTags` now shows a location list if there are - malformed struct tags (run `:GoUpdateBinaries` to update `gomodifiytags` - binary) [[GH-1401]](https://github.com/fatih/vim-go/pull/1401) -* Add folding of the package-level comment (enabled by default) and/or any - other comments (disabled by default) [[GH-1377]](https://github.com/fatih/vim-go/pull/1377). - [[GH-1428]](https://github.com/fatih/vim-go/pull/1428). -* Allow using :GoImpl on the type and struct parts too. Makes it a wee bit - easier to use [[GH-1386]](https://github.com/fatih/vim-go/pull/1386) -* `:GoDef` sets the path of new buffers as relative to the current directory - when appropriate, instead of always using the full path [[GH-1277]](https://github.com/fatih/vim-go/pull/1277). -* Syntax highlighting for variable declarations and assignments (disabled by default) - [[GH-1426]](https://github.com/fatih/vim-go/pull/1426) and - [[GH-1458]](https://github.com/fatih/vim-go/pull/1458). -* Add support for `:GoDecls[Dir]` in [unite.vim](https://github.com/Shougo/unite.vim) - [[GH-1391]](https://github.com/fatih/vim-go/pull/1391). -* Add support for [fzf.vim](https://github.com/junegunn/fzf.vim) in - `GoDecls[Dir]`. - [[GH-1437]](https://github.com/fatih/vim-go/pull/1437). -* Support relative imports for `:GoImpl` [[GH-1322]](https://github.com/fatih/vim-go/pull/1322). -* A new `g:go_list_type_commands` setting is added to individually set the list type for each command [[GH-1415]](https://github.com/fatih/vim-go/pull/1415). As en example: - - let g:go_list_type_commands = {"GoBuild": "quickfix", "GoTest": "locationlist"} -* Show unexpected errors better by expanding newlines and tabs - [[GH-1456]](https://github.com/fatih/vim-go/pull/1456). -* `:GoInstallBinaries` and `:GoUpdateBinaries` can now install/update only the - selected binaries (e.g. `:GoUpdateBinaries guru golint`) - [[GH-1467]](https://github.com/fatih/vim-go/pull/1467). - -BUG FIXES: - -* `:GoFmt` now (again) uses `locationlist` to show formatting errors instead of - `quickfix`. To change back to `locationlist` you can change it with the - setting `let g:go_list_type_commands = { "GoFmt": locationlist" }` [[GH-1415]](https://github.com/fatih/vim-go/pull/1415) -* Include comments in import block when folding is enabled [[GH-1387]](https://github.com/fatih/vim-go/pull/1387) -* Fix opening definitions in tabs [[GH-1400]](https://github.com/fatih/vim-go/pull/1400) -* Fix accidentally closing quickfix window from other commands if :GoFmt or autosave format was called [[GH-1407]](https://github.com/fatih/vim-go/pull/1407) -* Fix entering into insert mode after for term mode in nvim [[GH-1411]](https://github.com/fatih/vim-go/pull/1411) -* When using :GoImpl on type foo struct{} it would work, but with: - - type foo struct{ - } - - or with a struct with fields, it would create the generated methods inside the - struct [[GH-1386]](https://github.com/fatih/vim-go/pull/1386) -* `:GoImpl` output would include extra newline, and error would include - trailing newline from shell command: `vim-go: invalid receiver: "} *}"<00>`. - Fixed with [[GH-1386]](https://github.com/fatih/vim-go/pull/1386) -* Run `:GoMetaLinter` against the package of the open file [[GH-1414]](https://github.com/fatih/vim-go/pull/1414). -* The `g:go_doc_command` and `g:go_doc_options` to configure the command for - `:GoDoc` were documented but never referenced [[GH-1420]](https://github.com/fatih/vim-go/pull/1420). -* `go#package#FromPath()` didn't work correctly [[GH-1435]](https://github.com/fatih/vim-go/pull/1435). -* Fix race condition for `guru` based commands [[GH-1439]](https://github.com/fatih/vim-go/pull/1439). -* The `gohtmltmpl` filetype now sources the `html` ftplugin, so that `matchit`, - completion, and some other things work better. - [[GH-1442]](https://github.com/fatih/vim-go/pull/1442) -* Fix `:GoBuild` shell escaping [[GH-1450]](https://github.com/fatih/vim-go/pull/1450). -* Ensure fmt list gets closed when title cannot be checked [[GH-1474]](https://github.com/fatih/vim-go/pull/1474). - -BACKWARDS INCOMPATIBILITIES: - -* `:GoMetaLinter` now runs against the package of the open file instead of the - current working directory. This is so all commands behave the same relative - to the current open buffer. [[GH-1414]](https://github.com/fatih/vim-go/pull/1414) - -* `:GoImpl` now requires [`impl`](https://github.com/josharian/impl) version - 3fb19c2c or newer (released June 13, 2017); use `:GoUpdateBinaries` to make - sure that you've got a recent version [[GH-1322]](https://github.com/fatih/vim-go/pull/1322) - -## 1.14 - (August 6, 2017) - -FEATURES: - -* We now have folding support based on Go syntax. To enable it you have to set - the following Vim setting: `set foldmethod=syntax`. Currently it folds blocks - (`{ }`), `import`, `var`, and `const` blocks, and package-level comments. - These can be individually disabled/enabled if desired. For more info please - read the documentation for the `g:go_fold_enable` setting. [[GH-1339]](https://github.com/fatih/vim-go/pull/1339) - [[GH-1377]](https://github.com/fatih/vim-go/pull/1377) -* `:GoFiles` accepts now an argument to change the type of files it can show. - By default it shows`.go source files` but now it can be changed to show - various kind of files. The full list can be seen via `go list --help` under - the `// Source Files` section [[GH-1372]](https://github.com/fatih/vim-go/pull/1372) i.e: - -``` -:GoFiles CgoFiles // shows .go sources files that import "C" -:GoFiles TestGoFiles // shows _test.go files in package -:GoFiles IgnoredGoFiles // shows .go sources ignored due to build constraints -etc.. -``` - -IMPROVEMENTS - -* Files created with `_test.go` extension have a new template with a ready to - go test function. The template can be changed with the - `g:go_template_test_file` setting. [[GH-1318]](https://github.com/fatih/vim-go/pull/1318) -* Improve performance for highly used operations by caching `go env` calls [[GH-1320]](https://github.com/fatih/vim-go/pull/1320) -* `:GoCoverage` can accept arguments now. i.e: `:GoCoverage -run TestFoo` [[GH-1326]](https://github.com/fatih/vim-go/pull/1326) -* `:GoDecls` and `:GoDeclsDir` shows a warning if [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) is not installed -* `:GoBuild` now compiles the package with the `-i` flag added. This means that subsequent calls are much more faster due caching of packages [[GH-1330]](https://github.com/fatih/vim-go/pull/1330) -* `:GoCoverage` echos now the progress if `g:go_echo_command_info` is enabled [[GH-1333]](https://github.com/fatih/vim-go/pull/1333) -* Add `g:go_doc_max_height` setting to control the maximum height of the window created by `:GoDoc` and `K` mapping [[GH-1335]](https://github.com/fatih/vim-go/pull/1335) -* The `af` text object is able to include the assignment variable for anonymous functions. Can be disabled with `g:go_textobj_include_variable = 0` [[GH-1345]](https://github.com/fatih/vim-go/pull/1345) -* Add `g:go_list_autoclose` setting to prevent closing the quickfix/location list after zero items [[GH-1361]](https://github.com/fatih/vim-go/pull/1361) -* Cursor is now adjusted and locked to the correct line when `goimports` is used for autosave [[GH-1367]](https://github.com/fatih/vim-go/pull/1367) -* Complement the path of command for different situations of Cygwin environment [[GH-1394]](https://github.com/fatih/vim-go/pull/1394) -* Show message when using :GoDef and opening a new buffer [[GH-1385]](https://github.com/fatih/vim-go/pull/1385) - - -BUG FIXES: - -* Fix obtaining package's import path for the current directory. This fixes some issues we had if the user was using multiple GOPATH's [[GH-1321]](https://github.com/fatih/vim-go/pull/1321) -* Fix documentation for vim-go & syntastic integration for errcheck using [[GH-1323]](https://github.com/fatih/vim-go/pull/1323) -* Fix showing an output if a test has finished when `:GoTest` is called [[GH-1327]](https://github.com/fatih/vim-go/pull/1327) -* Fix warning when goimports doesn't support srcdir [[GH-1344]](https://github.com/fatih/vim-go/pull/1344) -* Fix broken code folding with go_highlight_types [[GH-1338]](https://github.com/fatih/vim-go/pull/1338) -* Fix blocking the ui when swapfile is enabled and `:GoFmt` is called (either manually or via autosave) [[GH-1362]](https://github.com/fatih/vim-go/pull/1362) -* Fix getting bin paths for binaries if GOPATH was not set and Go version =>1.7 was used [[GH-1363]](https://github.com/fatih/vim-go/pull/1363) -* Fix picking up the correct list type for showing `:GoFmt` errors [[GH-1365]](https://github.com/fatih/vim-go/pull/1365) -* Fix auto detecting of GOPATH for import paths with string 'src' (i.e: `GOPATH/src/github.com/foo/src/bar`) [[GH-1366]](https://github.com/fatih/vim-go/pull/1366) -* Fix showing an empty window if `gogetdoc` was not found [[GH-1379]](https://github.com/fatih/vim-go/pull/1379) -* Fix commands not being executed if paths would include spaces (binary name, GOPATH, file itself, etc..) [[GH-1374]](https://github.com/fatih/vim-go/pull/1374) -* Fix showing correct message when editing a new file [[GH-1371]](https://github.com/fatih/vim-go/pull/1371) -* Fix filepaths in the quickfix list for :GoVet [[GH-1381]](https://github.com/fatih/vim-go/pull/1381) -* Run :GoLint against the package of the open file [[GH-1382]](https://github.com/fatih/vim-go/pull/1382) - -BACKWARDS INCOMPATIBILITIES: - -* `:GoFmt` now uses `quickfix` to show formatting errors instead of - `locationlist`. To change back to `locationlist` you can change it with the - setting `let g:go_list_type = "locationlist"` [[GH-1365]](https://github.com/fatih/vim-go/pull/1365) -* `:GoLint` now runs against the package of the open file instead of the - current working directory. This is so all commands behave the same relative - to the current open buffer. For more info check the [comment - here](https://github.com/fatih/vim-go/issues/1375#issuecomment-317535953) - [[GH-1382]](https://github.com/fatih/vim-go/pull/1382) - -## 1.13 - (June 6, 2017) - -FEATURES: - -* New `:GoKeyify` command that turns unkeyed struct literals into keyed struct literals. [[GH-1258]](https://github.com/fatih/vim-go/pull/1258). i.e: - -``` -Example{"foo", "bar", "qux"} -``` - -will be converted to: - -``` -Example{ - foo: "foo", - bar: "bar", - qux: "qux", -} -``` - -Checkout the demo here: https://twitter.com/fatih/status/860410299714764802 - - -* New `g:go_addtags_transform` setting to change the transform rule (snakecase, camelcase, etc..) for `:GoAddTags` command [[GH-1275]](https://github.com/fatih/vim-go/pull/1275) -* New snippet shortcut assigned to `ife` that expands to `if err := foo(); err != nil { ... }` [[GH-1268]](https://github.com/fatih/vim-go/pull/1268) - -IMPROVEMENTS - -* :GoMetaLinter can now exclude linters with the new `g:go_metalinter_excludes` option [[GH-1253]](https://github.com/fatih/vim-go/pull/1253) -* Override `` mapping so `:GoDef` is used by default (as we do the same for `CTRL-]`, `gd`, etc. [[GH-1264]](https://github.com/fatih/vim-go/pull/1264) -* add support for `go_list_type` setting in `:GoFmt` and `:GoImports` commands [[GH-1304]](https://github.com/fatih/vim-go/pull/1304) -* add support for `go_list_type` setting in `:GoMetaLinter` commands [[GH-1309]](https://github.com/fatih/vim-go/pull/1309) -* `go_fmt_options` can be now a dictionary to allow us to specifcy the - options for multiple binaries [[GH-1308]](https://github.com/fatih/vim-go/pull/1308). i.e: - -``` - let g:go_fmt_options = { - \ 'gofmt': '-s', - \ 'goimports': '-local mycompany.com', - \ } -``` -* If win-vim(x64) with Cygwin is used, `cygpath` is used for constructing the paths [[GH-1092]](https://github.com/fatih/vim-go/pull/1092) - -BUG FIXES: - -* job: fix race between channel close and job exit [[GH-1247]](https://github.com/fatih/vim-go/pull/1247) -* internal: fix system calls when using tcsh [[GH-1276]](https://github.com/fatih/vim-go/pull/1276) -* path: return the unmodified GOPATH if autodetect is disabled [[GH-1280]](https://github.com/fatih/vim-go/pull/1280) -* fix jumping to quickfix window when autom gometalinter on save was enabled [[GH-1293]](https://github.com/fatih/vim-go/pull/1293) -* fix highlighting for `interface` and `structs` words when `go_highlight_types` is enabled [[GH-1301]](https://github.com/fatih/vim-go/pull/1301) -* fix cwd for running `:GoRun` when used with neovim [[GH-1296]](https://github.com/fatih/vim-go/pull/1296) -* `:GoFmt` handles files that are symlinked into GOPATH better (note that this behaviour is discouraged, but we're trying our best to handle all edge case :)) [[GH-1310]](https://github.com/fatih/vim-go/pull/1310) -* `:GoTest` is able to parse error messages that include a colon `:` [[GH-1316]](https://github.com/fatih/vim-go/pull/1316) -* `:GoTestCompile` under the hood doesn't produces a test binary anymore. Sometimes a race condition would happen which would not delete the test binary. [[GH-1317]](https://github.com/fatih/vim-go/pull/1317) -* `:GoDef` jumps now to definition for build tags defined with `:GoBuildTags` (only guru) [[GH-1319]](https://github.com/fatih/vim-go/pull/1319) - -BACKWARDS INCOMPATIBILITIES: - -* `:GoLint` works on the whole directory instead of the current file. To use it for the current file give it as an argument, i.e `:GoLint foo.go` [[GH-1295]](https://github.com/fatih/vim-go/pull/1295) -* `go_snippet_case_type` is removed in favor of the new `go_addtags_transform` setting [[GH-1299]](https://github.com/fatih/vim-go/pull/1299) -* `go_imports_bin` is removed to avoid confusion as it would lead to race - conditions when set to `gofmt` along with the usage of `go_fmt_command` - [[GH-1212]](https://github.com/fatih/vim-go/pull/1212) [[GH-1308]](https://github.com/fatih/vim-go/pull/1308) -* commands such as `:GoTest` has been refactored for easy maintainability. If - you use any custom script that was using the function `go#cmd#Test`, it - should be renamed to `go#test#Test` - -## 1.12 - (March 29, 2017) - -FEATURES: - -* New `:GoAddTags` and `:GoRemoveTags` command based on the tool - [gomodifytags](https://github.com/fatih/gomodifytags). This fixes many old - bugs that were due prior regexp based implementation. For the usage please - read the docs and checkout the demo at: - https://github.com/fatih/vim-go/pull/1204 [[GH-1204]](https://github.com/fatih/vim-go/pull/1204) -* Add new `errl` snippet that expands to [[GH-1185]](https://github.com/fatih/vim-go/pull/1185): - -``` -if err != nil { - log.Fatal(err) -} -``` -* New `:GoBuildTags` command to change build tags for tools such as `guru`, - `gorename`, etc ... There is also a new setting called `g:go_build_tags` - [[GH-1232]](https://github.com/fatih/vim-go/pull/1232) - -IMPROVEMENTS: - -* vim-go works now even if GOPATH is not set (starting with Go 1.8) [[GH-1248]](https://github.com/fatih/vim-go/pull/1248) -* Lowercase `` in mappings examples for consistent documentation across the README [[GH-1192]](https://github.com/fatih/vim-go/pull/1192) -* All of files should be written in utf-8 if the file will be passed to external command. [[GH-1184]](https://github.com/fatih/vim-go/pull/1184) -* `:GoAddTags` is now able to add options to existing tags with the syntax - `:GoAddTags key,option`, i.e: `:GoAddTags json,omitempty` [[GH-985]](https://github.com/fatih/vim-go/pull/985) -* Document 'noshowmode' requirement for echo_go_info [[GH-1197]](https://github.com/fatih/vim-go/pull/1197) -* Improve godoc view for vertical splits [[GH-1195]](https://github.com/fatih/vim-go/pull/1195) -* Set GOPATH for both possible go guru execution paths (sync and async) [[GH-1193]](https://github.com/fatih/vim-go/pull/1193) -* Improve docs for :GoDef usage [[GH-1242]](https://github.com/fatih/vim-go/pull/1242) -* Highlight trimming syntax for Go templates [[GH-1235]](https://github.com/fatih/vim-go/pull/1235) - -BUG FIXES: - -* Honor `g:go_echo_command_info` when dispatching builds in neovim [[GH-1176]](https://github.com/fatih/vim-go/pull/1176) -* Fix `:GoBuild` error in neovim due to invalid jobcontrol handler function - signatures (`s:on_stdout`, `s:on_stderr`)[[GH-1176]](https://github.com/fatih/vim-go/pull/1176) -* Update statusline before and after `go#jobcontrol#Spawn` command is executed [[GH-1176]](https://github.com/fatih/vim-go/pull/1176) -* Correctly report the value of the 'g:go_guru_tags' variable [[GH-1177]](https://github.com/fatih/vim-go/pull/1177) -* Ensure no trailing `:` exist in GOPATH detection if initial GOPATH is not set [[GH-1194]](https://github.com/fatih/vim-go/pull/1194) -* Fix `:GoAddTags` to allow modifying existing comments [[GH-984]](https://github.com/fatih/vim-go/pull/984) -* Fix `:GoAddTags` to work with nested structs [[GH-990]](https://github.com/fatih/vim-go/pull/990) -* Fix `:GoAddTags` adding tags twice for existing tags [[GH-1064]](https://github.com/fatih/vim-go/pull/1064) -* Fix `:GoAddTags` not working for fields of types `interface{}` [[GH-1091]](https://github.com/fatih/vim-go/pull/1091) -* Fix `:GoAddTags` not working for fields with one line comments [[GH-1181]](https://github.com/fatih/vim-go/pull/1181) -* Fix `:GoAddTags` not working if any field comment would contain `{}` [[GH-1189]](https://github.com/fatih/vim-go/pull/1189) -* Respect go_fmt_options when running goimports [[GH-1211]](https://github.com/fatih/vim-go/pull/1211) -* Set the filename in the location-list when there is an error with :GoFmt [[GH-1199]](https://github.com/fatih/vim-go/pull/1199) -* Fix `:GoInstall` to accept additional arguments if async mode was enabled [[GH-1246]](https://github.com/fatih/vim-go/pull/1246) - -BACKWARDS INCOMPATIBILITIES: - -* The command `:GoGuruTags` is removed in favour of the new command - `:GoBuildTags`. This command will be used now not just for `guru`, also for - all new commands such as `gorename` [[GH-1232]](https://github.com/fatih/vim-go/pull/1232) -* The setting `g:go_guru_tags` is removed in favour of the new setting - `g:go_build_tags` [[GH-1232]](https://github.com/fatih/vim-go/pull/1232) - - -## 1.11 - (January 9, 2017) - -FEATURES: - -* Travis test integration has been added. Now any file that is added as - `_test.vim` will be automatically tested in for every Pull Request - (just like how we add tests to Go with `_test.go`). Going forward this will - tremendously increase the stability and decrease the maintenance burden of - vim-go. [[GH-1157]](https://github.com/fatih/vim-go/pull/1157) -* Add new `g:go_updatetime` setting to change the default updatetime (which was hardcoded previously) [[GH-1055]](https://github.com/fatih/vim-go/pull/1055) -* Add new `g:go_template_use_pkg` setting to enable to use cwd as package name instead of basic template file [[GH-1124]](https://github.com/fatih/vim-go/pull/1124) - -IMPROVEMENTS: - -* Add `statusline` support for `:GoMetaLinter` [[GH-1120]](https://github.com/fatih/vim-go/pull/1120) -* Quickfix and Location lists contain now a descriptive title (requires at least Vim `7.4.2200`)[[GH-1004]](https://github.com/fatih/vim-go/pull/1004) -* Check `go env GOPATH` as well for `:GoInstallBinaries` as Go has now a default path for GOPATH ("~/go")starting with 1.8 [[GH-1152]](https://github.com/fatih/vim-go/pull/1152) -* `:GoDocBrowser` now also works on import paths [[GH-1174]](https://github.com/fatih/vim-go/pull/1174) - -BUG FIXES: - -* Always use full path to detect packages to be shown in statusline [[GH-1121]](https://github.com/fatih/vim-go/pull/1121) -* Use `echom` to persist errors in case of multiple echos [[GH-1122]](https://github.com/fatih/vim-go/pull/1122) -* Fix a race condition where a quickfix window was not closed if a job has succeeded [[GH-1123]](https://github.com/fatih/vim-go/pull/1123) -* Do not expand coverage arguments for non job execution of `:GoCoverage` [[GH-1127]](https://github.com/fatih/vim-go/pull/1127) -* `:GoCoverage` doesn't mess up custom syntax anymore [[GH-1128]](https://github.com/fatih/vim-go/pull/1128) -* Disable autoformat for `asm` files as they might be non Go ASM format [[GH-1141]](https://github.com/fatih/vim-go/pull/1141) -* Fix indentation broken when using a action with a minus sign like `{{-` [[GH-1143]](https://github.com/fatih/vim-go/pull/1143) -* Fix breaking Neovim change of passing less arguments to callbacks [[GH-1145]](https://github.com/fatih/vim-go/pull/1145) -* Fix `guru` commands if custom build tags were set [[GH-1136]](https://github.com/fatih/vim-go/pull/1136) -* Fix referencing a non defined variable for async commands when bang (!) was used -* Fix `:GoDef` failing for a modified buffer if `hidden` was not set [[GH-1132]](https://github.com/fatih/vim-go/pull/1132) -* Fix `:GoDefStack` to allow popping from jump list when buffer is modified [[GH-1133]](https://github.com/fatih/vim-go/pull/1133) -* Improve internal defining of functions and referencing them for async operations [[GH-1155]](https://github.com/fatih/vim-go/pull/1155) -* Fix `:GoMetaLinter` failing if `go_metalinter_command` is set. [[GH-1160]](https://github.com/fatih/vim-go/pull/1160) -* Fix `:GoMetaLinter`'s `go_metalinter_deadline` setting for async mode [[GH-1146]](https://github.com/fatih/vim-go/pull/1146) - -BACKWARDS INCOMPATIBILITIES: - -* The following syntax options are now disabled by default. If you're using them be sure to set them in your .vimrc [[GH-1167]](https://github.com/fatih/vim-go/pull/1167) - -```viml -g:go_highlight_array_whitespace_error -g:go_highlight_chan_whitespace_error -g:go_highlight_extra_types -g:go_highlight_space_tab_error -g:go_highlight_trailing_whitespace_error -``` - - - -## 1.10 (November 24, 2016) - -FEATURES: - -* **Vim 8.0 support!** This is the initial version to add Vim 8.0 based support to - all basic commands (check out below for more information). With time we'll - going to extend it to other commands. All the features are only enabled if - you have at least Vim 8.0.0087. Backwards compatible with Vim 7.4.x. - If you see any problems, please open an issue. - -* We have now a [logo for vim-go](https://github.com/fatih/vim-go/blob/master/assets/vim-go.png)! Thanks to @egonelbre for his work on this. -* `:GoBuild`, `:GoTest`, `:GoTestCompile`, `:GoInstall` commands are now fully - async. Async means it doesn't block your UI anymore. If the command finished - it echoes the status. For a better experience use the statusline information - (more info below) - -* `:GoCoverage` and `:GoCoverageBrowser` commands are fully async. -* `:GoDef` is fully async if `guru` is used as command. -* `:GoRename` is fully async . - -* `:GoMetaLinter` is fully asnyc. Also works with the current autosave linting - feature. As a reminder, to enable auto linting on save either call - `:GoMetaLinterAutoSaveToggle` (temporary) or add `let - g:go_metalinter_autosave = 1` (persistent) to your virmc). - -* All `guru` commands run asynchronously if Vim 8.0 is being used. Current - Commands: - * GoImplements - * GoWhicherrs - * GoCallees - * GoDescribe - * GoCallers - * GoCallstack - * GoFreevars - * GoChannelPeers - * GoReferrers - -* `:GoSameIds` also runs asynchronously. This makes it useful especially for - auto sameids mode. In this mode it constantly evaluates the identifier under the - cursor whenever it's in hold position and then calls :GoSameIds. As a - reminder, to enable auto info either call `:GoSameIdsAutoToggle`(temporary) - or add `let g:go_auto_sameids = 1` (persistent) to your vimrc. - -* `:GoInfo` is now non blocking and works in async mode if `guru` is used in - `g:go_info_mode`. This makes it useful especially for autoinfo mode. In this - mode it constantly evaluates the identifier under the cursor whenever it's in - hold position and then calls :GoInfo. As a reminder, to enable auto info - either call `:GoAutoTypeInfoToggle`(temporary) or add `let - g:go_auto_type_info = 1` (persistent) to your vimrc. To use `guru` instead of - `gocode` add following to your vimrc: `let g:go_info_mode = 'guru'` - - The `guru` is more accurate and reliabed due the usage of `guru` describe. It - doesn't rely on `pkg/` folder like `gocode` does. However it's slower than - `gocode` as there is no caching mechanism in `guru` yet. - -* **New**: Statusline function: `go#statusline#Show()` which can be plugged into - the statusline bar. Works only with vim 8.0. It shows all asynchronously - called functions status real time. Checkout it in action: - https://twitter.com/fatih/status/800473735467847680. To enable it add the - following to your `vimrc`. If you use lightline, airline, .. check out their - respective documentation on how to add a custom function: - -```viml -" go command status (requires vim-go) -set statusline+=%#goStatuslineColor# -set statusline+=%{go#statusline#Show()} -set statusline+=%* -``` - -IMPROVEMENTS: - -* **:GoDocBrowser** is now capable to to understand the identifier under the cursor (just like :GoDoc) -* Function calls are now highlighted as well when `g:go_highlight_functions` is enabled [[GH-1048]](https://github.com/fatih/vim-go/pull/1048) -* Add completion support for un-imported packages. This allows to complete even - if the package is not imported. By default it's disabled, enable by adding - `let g:go_gocode_unimported_packages = 1` [[GH-1084]](https://github.com/fatih/vim-go/pull/1084) -* Tools that embeds GOROOT into their binaries do not work when people update - their Go version and the GOROOT contains the vesion as part of their path - (i.e: `/usr/local/Cellar/go/1.7.2/libexec`, [more - info](https://blog.filippo.io/stale-goroot-and-gorebuild/)) . This is now - fixed by introducing automatic GOROOT set/unset before each tool invoke. - [[GH-954]](https://github.com/fatih/vim-go/pull/954) -* Added new setting `g:go_echo_go_info` to enable/disable printing identifier - information when completion is done [[GH-1101]](https://github.com/fatih/vim-go/pull/1101) -* Added new `go_echo_command_info` setting is added, which is enabled by - default. It's just a switch for disabling messages of commands, such as - `:GoBuild`, `:GoTest`, etc.. Useful to *disable* if `go#statusline#Show()` is - being used in Statusline, to prevent to see duplicates notifications. -* goSameId highlighting is now linked to `Search`, which is much more clear as - it changes according to the users colorscheme -* Add plug mapping `(go-lint)` for :GoLint [[GH-1089]](https://github.com/fatih/vim-go/pull/1089) - - -BUG FIXES: - -* Change back nil and iota highlighting color to the old type [[GH-1049]](https://github.com/fatih/vim-go/pull/1049) -* Fix passing arguments to `:GoBuild` while using NeoVim [[GH-1062]](https://github.com/fatih/vim-go/pull/1062) -* Do not open a split if `:GoDef` is used on a modified file [[GH-1083]](https://github.com/fatih/vim-go/pull/1083) -* Highlight nested structs correctly [[GH-1075]](https://github.com/fatih/vim-go/pull/1075) -* Highlight builtin functions correctly if `g:go_highlight_functions` is enabled [[GH-1070]](https://github.com/fatih/vim-go/pull/1070) -* Fix `:GoSameIds` highlighting if a new buffer is opened in the same window [[GH-1067]](https://github.com/fatih/vim-go/pull/1067) -* Internal: add `abort` to all vim function to return in case of errors [[GH-1100]](https://github.com/fatih/vim-go/pull/1100) -* Fix `:GoCoverage` to be executed if working dir is not inside the test dir [[GH-1033]](https://github.com/fatih/vim-go/pull/1033) - -BACKWARDS INCOMPATIBILITIES: - -* remove vim-dispatch and vimproc.vim support. vim 8.0 has now the necessary - API to invoke async jobs and timers. Going forward we should use those. Also - this will remove the burden to maintain compatibility with those plugins. - -* `go#jobcontrol#Statusline()` is removed in favor of the new, global and - extensible `go#statusline#Show()` - -## 1.9 (September 13, 2016) - -IMPROVEMENTS: - -* **guru** uses now the `-modified` flag, which allows us use guru on modified - buffers as well. This affects all commands where `guru` is used. Such as - `:GoDef`, `:GoReferrers`, etc.. [[GH-944]](https://github.com/fatih/vim-go/pull/944) -* **:GoDoc** uses now the `-modified` flag under the hood (for `gogetdoc), which allows us to get documentation for the identifier under the cursor ina modified buffer. [[GH-1014]](https://github.com/fatih/vim-go/pull/1014) -* Cleanup and improve documentation [[GH-987]](https://github.com/fatih/vim-go/pull/987) -* Add new `g:go_gocode_socket_type` setting to change the underlying socket type passed to `gocode`. Useful to fallback to `tcp` on cases such as Bash on Windows [[GH-1000]](https://github.com/fatih/vim-go/pull/1000) -* `:GoSameIds` is now automatically re-evaluated in cases of buffer reloads (such as `:GoRename`) [[GH-998]](https://github.com/fatih/vim-go/pull/998) -* Improve docs about `go_auto_sameids` [[GH-1017]](https://github.com/fatih/vim-go/pull/1017) -* Improve error message by printing the full path if an incompatible `goimports` is being used [[GH-1006]](https://github.com/fatih/vim-go/pull/1006) -* `iota` and `nil` are now highlighted correctly and are not treated as booleans [[GH-1030]](https://github.com/fatih/vim-go/pull/1030) - -BUG FIXES: - -* Fix system calls on Windows [[GH-988]](https://github.com/fatih/vim-go/pull/988) -* Fix :GoSameIds and :GoCoverage for light background and after changing color schemes [[GH-983]](https://github.com/fatih/vim-go/pull/983) -* Fix TagBar and `GoCallers` for Windows user [[GH-999]](https://github.com/fatih/vim-go/pull/999) -* Set updatetime for for `auto_sameids` feature as well [[GH-1016]](https://github.com/fatih/vim-go/pull/1016) -* Update docs about missing `go_highlight_generate_tags` setting [[GH-1023]](https://github.com/fatih/vim-go/pull/1023) -* Fix updating the jumplist if `:GoDef` is used [[GH-1029]](https://github.com/fatih/vim-go/pull/1029) -* Fix highlighting literal percent sign (`%%`) in strings [[GH-1011]](https://github.com/fatih/vim-go/pull/1011) -* Fix highlighting of nested fields [[GH-1007]](https://github.com/fatih/vim-go/pull/1007) -* Fix checking for `exepath` feature for the upcoming vim 8.0 release [[GH-1046]](https://github.com/fatih/vim-go/pull/1046) - -BACKWARDS INCOMPATIBILITIES: - -* Rename `GoMetalinterAutoSaveToggle` to `GoMetaLinterAutoSaveToggle` to make it compatible with the existing `:GoMetaLinter` command [[GH-1020]](https://github.com/fatih/vim-go/pull/1020) - -## 1.8 (July 31, 2016) - -FEATURES: -* New **`:GoAddTags`** command that adds field tags for the fields of a struct automatically based on the field names. Checkout the demo to see it in action: https://twitter.com/fatih/status/759822857773907968 [[GH-971]](https://github.com/fatih/vim-go/pull/971) -* The snippet expansion `json` is now much more smarter. It pre populates the placeholder according to the first word and it also applies `snake_case` or `camelCase` conversion. Together with `:GoAddTags` it gives `vim-go` users flexible ways of populating a field tag. Checkout the demo to see it in action: https://twitter.com/fatih/status/754477622042689536 [[GH-927]](https://github.com/fatih/vim-go/pull/927) -* New **`:GoSameIds`** command. When called highlights all same identifiers in the current file. Can be also enabled to highlight identifiers automatically (with `:GoSameIdsAutoToggle` or `g:go_auto_sameids`). Checkout the demo to see it in action: https://twitter.com/fatih/status/753673709278339072. [[GH-936]](https://github.com/fatih/vim-go/pull/936) -* New **`:GoWhicherrs`** command. It shows all possible values of the selected error variable. [[GH-948]](https://github.com/fatih/vim-go/pull/948) -* Add new `errp` snippet to expand an `if err != nil { panic() }` clause [[GH-926]](https://github.com/fatih/vim-go/pull/926) -* If you open a new buffer with a Go filename it get automatically populated based on the directory. If there are no Go files a simple main package is created, otherwise the file will include the package declaration line based on the package in the current directory. Checkout the demo to see it in action: https://twitter.com/fatih/status/748333086643994624. This is enabled by default. Can be disabled with `let g:go_template_autocreate = 0`. You can use your own template with `let g:go_template_file = "foo.go"` and putting the file under the `templates/` folder. [[GH-918]](https://github.com/fatih/vim-go/pull/918) -* Added new toggle commands to enable/disable feature that run for your - automatic. For example if you have `let g:go_auto_type_info = 1` enabled, you - can now easily enable/disable it on the fly. Support added with the following - commands: `:GoAutoTypeInfoToggle`, `:GoFmtAutoSaveToggle`, - `:GoAsmFmtAutoSaveToggle`, `:GoMetalinterAutoSaveToggle`, - `:GoTemplateAutoCreateToggle` [[GH-945]](https://github.com/fatih/vim-go/pull/945) - - -IMPROVEMENTS: -* `:GoDoc` accepts arguments now which are passed directly to `godoc`. So usages like `:GoDoc flag` works again (it was changed in previous versions [[GH-894]](https://github.com/fatih/vim-go/pull/894) -* `:GoDef` works now for modified files as well [[GH-910]](https://github.com/fatih/vim-go/pull/910) -* Internal: pass filename to the `--srcdir` flag to enable upcoming `goimports` features [[GH-957]](https://github.com/fatih/vim-go/pull/957) -* Internal: fix indentations on all files to **2-spaces/no tabs**. This is now the default vim-go style across all VimL files [[GH-915]](https://github.com/fatih/vim-go/pull/915) -* Internal: autocmd settings can be now dynamically enabled/disabled [[GH-939]](https://github.com/fatih/vim-go/pull/939) -* Internal: automatically detect `GOPATH` for :GoInstall [[GH-980]](https://github.com/fatih/vim-go/pull/980) -* Internal: shell executions uses now by default `sh` and then resets it back to the user preference. [[GH-967]](https://github.com/fatih/vim-go/pull/967) -* Syntax: improved syntax highglighting performance for methods, fields, structs and interface type declarations [[GH-917]](https://github.com/fatih/vim-go/pull/917) -* Syntax: moved `:GoCoverage` highlight definition into go's syntax file for more customizability [[GH-962]](https://github.com/fatih/vim-go/pull/962) - - -BUG FIXES: - -* Escape `#` characters when opening URL's, as it's handled as alternative file in vim [[GH-895]](https://github.com/fatih/vim-go/pull/895) -* Fix typos in `doc/vim-go.txt` about usages of syntax highglightings [[GH-897]](https://github.com/fatih/vim-go/pull/897) -* Fix `:GoCoverage` not running for Neovim [[GH-899]](https://github.com/fatih/vim-go/pull/899) -* Fix `:GoFmt` not picking up `-srcdir` if the command was set to use `goimports` [[GH-904]](https://github.com/fatih/vim-go/pull/904) -* Fix `:GoTestCompile` to not leave behind artifacts if the cwd and the test files's directory do not match [[GH-909]](https://github.com/fatih/vim-go/pull/909) -* Fix `:GoDocBrowser` to not fail if godoc doesn't exist [[GH-920]](https://github.com/fatih/vim-go/pull/920) -* Fix `:GoFmt` to not change the permissions of saved file. Now original file permissions are restored [[GH-922]](https://github.com/fatih/vim-go/pull/922) - -BACKWARDS INCOMPATIBILITIES: - -* `g:go_highlight_structs` and `g:go_highlight_interface` are removed in favor of `g:go_highlight_types` [[GH-917]](https://github.com/fatih/vim-go/pull/917) - - -## 1.7.1 (June 7, 2016) - -BUG FIXES: -* Fixed typo in `syntax/go.vim` file from `go:go_highlight_fields` to `g:go_highlight_fields` - -## 1.7 (June 7, 2016) - -FEATURES: - -* New **`:GoImpl`** command that generates method stubs for implementing an interface. Checkout the [demo](https://twitter.com/fatih/status/729991365581545472) to see how it works. [[GH-846]](https://github.com/fatih/vim-go/pull/846) -* `godef` support is added back as an optional setting. By default `:GoDef` still uses `guru`, but can be changed to `godef` by adding the option: `let g:go_def_mode = 'godef'` [[GH-888]](https://github.com/fatih/vim-go/pull/888) -* New `` and `]>` shortcuts to split current window and jumpt to the identifier under cursor. [[GH-838]](https://github.com/fatih/vim-go/pull/838) -* New syntax setting" `g:go_highlight_fields` that highlights struct field references [[GH-854]](https://github.com/fatih/vim-go/pull/854) - -IMPROVEMENTS: - -* Invoking `:GoRename` now reloads all files to reflect new changes automatically [[GH-855]](https://github.com/fatih/vim-go/pull/855) -* Calling `:GoTestCompile` does not create any temporary binary file anymore [[GH-879]](https://github.com/fatih/vim-go/pull/879) -* Enable passing the `-tags` flag to `:GoDef`. Now you can pass build tags to `:GoDef` via `:GoGuruTags` or `g:go_guru_tags` -* Internal refactoring to use custom `system()` function that wraps both the standard `system()` call and `vimproc`. Now all system calls will take advantage and will use `vimproc` if installed. [[GH-801]](https://github.com/fatih/vim-go/pull/801) -* Completion enables now `gocode`'s `autobuild` and `propose-builtins` flags automatically. With these settings packages will be automatically build to get the freshest completion candidates and builtin keywords will be showed as well. By defaults these settings are enabled. Settings can be disabled/enabled via `g:go_gocode_autobuild` and `g:go_gocode_propose_builtins`. [[GH-815]](https://github.com/fatih/vim-go/pull/815) -* Added new `http.HandlerFunc` snippets with `hf` and `hhf` shortcuts [[GH-816]](https://github.com/fatih/vim-go/pull/816) -* Added new `Example` and `Benchmark` snippets with `example` and `benchmark` shortcuts [[GH-836]](https://github.com/fatih/vim-go/pull/836) -* Search tool binaries first in `GOBIN` and then in `PATH` as most of vim-go users installs it to `GOBIN` mostly [[GH-823]](https://github.com/fatih/vim-go/pull/823) -* Improve `guru` based commands by providing automatically detected GOPATHS, such as `gb`, `godep` to be used if possible [[GH-861]](https://github.com/fatih/vim-go/pull/861) -* Add `(go-imports)` mapping to make it assignable to other keys [[GH-878]](https://github.com/fatih/vim-go/pull/878) -* Increase compatibility with tcsh [[GH-869]](https://github.com/fatih/vim-go/pull/869) -* Improve `:GoInstallBinaries` for GOPATH's which don't have packages that work well with `go get -u`. We have a new `g:go_get_update` setting to disable it. By default it's enabled. [[GH-883]](https://github.com/fatih/vim-go/pull/883) - - - -BUG FIXES: -* Fix `(go-freevars)` plug mapping to work as in visual mode instead of noncompatible normal mode [[GH-832]](https://github.com/fatih/vim-go/pull/832) -* Commands based on guru now shows a more meaningful error message instead of just showing the exit status (-1) -* Fix `:GoCoverage` accidentally enabling syntax highlighting for users who don't use syntax (i.e syntax off) [[GH-827]](https://github.com/fatih/vim-go/pull/827) -* Fix `:GoCoverage` colors to work for xterm as well [[GH-863]](https://github.com/fatih/vim-go/pull/863) -* Fix commenting out block of texts for Go templates (filetype gothtmltmpl) [[GH-813]](https://github.com/fatih/vim-go/pull/813) -* Fix `:GoImplements` failing because of an empty scope definition. Now we default to current package to make it usable. -* Fix `:GoPlay` posting to non HTTPS url. [[GH-847]](https://github.com/fatih/vim-go/pull/847) -* Fix escaping the filenames for lint and motion commands [[GH-862]](https://github.com/fatih/vim-go/pull/862) -* Fix escaping the filename to `:GoDef` completely for tcsh [[GH-868]](https://github.com/fatih/vim-go/pull/868) -* Fix showing SUCCESS for `go test` related commands if no test files are available [[GH-859]](https://github.com/fatih/vim-go/pull/859) - - - -## 1.6 (April 25, 2016) - -FEATURES: - -* New `CHANGELOG.md` file (which you're reading now). This will make it easier - for me to track changes and release versions -* **`:GoCoverage`** is now highlighting the current source file for - covered/uncovered lines. If called again it runs the tests and updates the - annotation. Use `:GoCoverageClear` to clear the coverage annotation. - This is a pretty good addition to vim-go and I suggest to check out the gif - that shows it in action: https://twitter.com/fatih/status/716722650383564800 - [[GH-786]](https://github.com/fatih/vim-go/pull/786) -* **`:GoCoverageToggle`** just like `:GoCoverage` but acts as a toggle. If run - again it clears the annotation. -* **`:GoCoverageBrowser`** opens a new annotated HTML page. This is the old - `:GoCoverage` behavior [[GH-786]](https://github.com/fatih/vim-go/pull/786) -* **`:GoDoc`** uses now [gogetdoc](https://github.com/zmb3/gogetdoc) to - lookup and display the comment documentation for the identifier under the - cursor. This is more superior as it support looking up dot imports, named - imports and imports where package name and file name are different [[GH-782]](https://github.com/fatih/vim-go/pull/782) -* **`guru support`**: `oracle` is replaced by the new tool `guru`. `oracle.vim` - is therefore renamed to `guru.vim`. I've also refactored the code to make it - much more easier to maintain and add additional features in future (such as - upcoming JSON decoding). vim-go is now fully compatible with `guru`. Please - be sure you have installed `guru`. You can easily do it with - `:GoInstallBinaries`. -* **`:GoDef`** uses now `guru definition` under the hood instead of `godef`. - This fixes the following issues: 1. dot imports 2. vendor imports 3. folder - != package name imports. The tool `godef` is also deprecated and not used - anymore. -* **`:GoDef`** does have now history of the call stack. This means you can - easily jump back to your last entry. This can be done with the new command - `:GoDefPop` or the mapping `CTRL-t`. To see the stack and jump between entries - you can use the new command `:GoDefStack`, which shows the list of all stack - entries. To reset the stack list anytime you can call `:GoDefStackClear` - [[GH-776]](https://github.com/fatih/vim-go/pull/776) - -IMPROVEMENTS: - -* **`:GoCoverage`** is executed asynchronously when used within Neovim [[GH-686]](https://github.com/fatih/vim-go/pull/686) -* **`:GoTestFunc`** supports now testable examples [[GH-794]](https://github.com/fatih/vim-go/pull/794) -* **`:GoDef`** can jump to existing buffers instead of opening a new window - (split, vsplit or tab). By default it's disabled to not break the old - behavior, can be enabled with `let g:go_def_reuse_buffer = 1` - -BUG FIXES: - -* Fix not showing documentation for dot, named and package/file name being different imports [[GH-332]](https://github.com/fatih/vim-go/pull/332) -* Term mode: fix closing location list if result is successful after a failed attempt [[GH-768]](https://github.com/fatih/vim-go/pull/768) -* Syntax: fix gotexttmpl identifier highlighting [[GH-778]](https://github.com/fatih/vim-go/pull/778) -* Doc: fix wrong wording for `go-run` mapping. It's for the whole main package, - not for the current file - -BACKWARDS INCOMPATIBILITIES: - -* `:GoDef` doesn't accept any identifier as an argument. This is not suported - via `guru definition` and also was not widely used either. Also with this, we - significantly simplified the existing def.vim code -* `:GoOracleScope` and `:GoOracleTags` are deprecated in favor of - `:GoGuruScope` and `:GoGuruTags`. Also `g:go_oracle_scope` is renamed to - `g:go_guru_scope` -* `g:go_guru_scope` accepts a variable in type of `list` instead of `string`. - i.g: `let g:go_guru_scope = ["github.com/fatih/structs", "golang.org/x/tools/..."]` - - -## 1.5 (Mar 16, 2016) - -FEATURES: -* Introducing code name "motion". A new whole way of moving - around and navigating [[GH-765]](https://github.com/fatih/vim-go/pull/765). Checkout the following new changes: - * A vim-go specific tool, called [motion](https://github.com/fatih/motion) is being developed which - provides us the underlying foundation for the following and upcoming - new features. - * `]]` and `[[` motions can be used to jump between functions - * `if` and `af` are improved and implement from scratch. It has now - support for literal functions, comments of functions, better cursor - position support and more stable. - * New `:GoDecls` and `:GoDeclsDir` commands that are available if - `ctrlp.vim` is installed. Once called one can easily jump to any generic declaration available. - * I wrote two blog posts about these new features in more detail. I recommend you to read it: [Treating Go types as objects in Vim](https://medium.com/@farslan/treating-go-types-as-objects-in-vim-ed6b3fad9287#.mbwaisevp) and [Navigation between functions and types in vim-go](https://medium.com/@farslan/navigation-between-functions-and-types-in-vim-go-f9dd7de8ca37#.2sdf8tbbe) -* A new `:GoAlternate` command that toggles to the test - file of the current file. It also has new appropriate mappings to open the - alternate file in split or tabs. [[GH-704]](https://github.com/fatih/vim-go/pull/704) -* Now commands can choose whether they want to open a - `quickfix` or a `location list` via the setting `g:go_list_type`. Also all - the commands have now some sensible settings, some will open a qf window, - some will open a location list [[GH-700]](https://github.com/fatih/vim-go/pull/700) - -IMPROVEMENTS: - -* Add support for goimport's new `-srcdir`. Goimports now succesfully suports `vendor/` folders with this release. [[GH-735]](https://github.com/fatih/vim-go/pull/735) -* Add `g:go_gorename_prefill` setting which disabled pre filling the argument for `:GoRename` [[GH-711]](https://github.com/fatih/vim-go/pull/711) -* Improve `:GoRun` to complete to filenames [[GH-742]](https://github.com/fatih/vim-go/pull/742) -* Highlight `//go:generate` comment directives [[GH-757]](https://github.com/fatih/vim-go/pull/757) -* Indent code in Go HTML templates [[GH-709]](https://github.com/fatih/vim-go/pull/709) -* Improve negative numbers of all types, octals, imaginary numbers with exponents [[GH-752]](https://github.com/fatih/vim-go/pull/752) -* Improved internal usage of retrieving offsets [[GH-762]](https://github.com/fatih/vim-go/pull/762) -* Improve by substitute all backslashes to slashes for filename [[GH-703]](https://github.com/fatih/vim-go/pull/703) -* Improve internal Go package path function [[GH-702]](https://github.com/fatih/vim-go/pull/702) -* Improved typo and grammar errors in docs [[GH-714]](https://github.com/fatih/vim-go/pull/714) -* Improved internal `:GoInfo` automatic call [[GH-759]](https://github.com/fatih/vim-go/pull/759) - -BUG FIXES: - -* Fix oracle scope not working if trailing slash exists in scope [[GH-751]](https://github.com/fatih/vim-go/pull/751) -* Fix `:GoErrCheck` checking abspath [[GH-671]](https://github.com/fatih/vim-go/pull/671) -* Fix `:GoInstall` correctly parsing errors [[GH-692]](https://github.com/fatih/vim-go/pull/692) -* Fix `:GoInstall` correctly parsing errors [[GH-692]](https://github.com/fatih/vim-go/pull/692) -* Fix `:GoTestFunc` for neovim [[GH-695]](https://github.com/fatih/vim-go/pull/695) -* Fix `:GoRun` accepting arguments for neovim [[GH-730]](https://github.com/fatih/vim-go/pull/730) -* Fix `go run` mappings not working [[GH-542]](https://github.com/fatih/vim-go/pull/542) -* Fix autodetect gopath picking up non existing GB vendor folder -* Fix gofmt errors showing per buffer instead of per script [[GH-721]](https://github.com/fatih/vim-go/pull/721) -* Fix some of the neosnippet snippets - -## 1.4 (Jan 18, 2016) - -FEATURES: - -* You waited for it for a long time. And here you have it: **Neovim support!** - This is a huge feature. It's fully compatible with Vim and kicks only in if - vim-go is being used within Neovim. Checkout the full list of changes - [[GH-607]](https://github.com/fatih/vim-go/pull/607): - * An async launcher and base foundation was implemented for the `go` command. - This will be used in the future for all upcoming subcommands of the `go` - tool. - * `:GoBuild` is now called asynchronously (it doesn't block the UI anymore). - * A new `go#jobcontrol#Statusline()` can be used to plug into the statusline. - This will show the status of the job running asynchronously. The statusline - is improved to show the status per package instead of file. Assume you have - three files open, all belonging to the same package, if the package build - (`:GoBuild`) is successful, all statusline's will be empty (means SUCCESS), - if it fails all files statusline's will show `FAILED`. - * `:GoRun` opens a new vertical terminal emulator inside Neovim and runs the - command there. The terminal mode can be changed with `g:go_term_mode`, - which is by default `vsplit`. Current options are `vsplit, split or tab`. - We also have three new mappings to open `:GoRun` command in different - terminal split modes: `(go-run-vertical)`, `(go-run-split)` - and `(go-run-tab)` - * `:GoTest`, `:GoTestFunc` and `:GoTestCompile` opens and runs in a new - terminal. The view mode (split,vertical, tab) is defined with - `g:go_term_mode`. The `g:go_term_enabled` setting can be use to change the - behavior of `:GoTestXXX` commands .If set to `1`, it opens the test - commands inside a terminal, if not it runs them in background just like - `:GoBuild` and displays the result in the statusline. - * We have two settings for terminal sizes: `g:go_term_height` and - `g:go_term_width`. By default a vertical or horizontal view is equally - splitted by vim automatically. However with these settings we can for - example have a terminal with a smaller height when we split it - horizontally. - * If a command inside the term fails (such as `go run`, `go test` ...) we - parse now the errors and list them inside a location list. -* Instead of quickfix window, vim-go now uses the `location list` feature of - Vim. These are associated with each window independently of each other. This - enables us to have multiple, independent location lists per window (example - usages: `:GoBuild` with errors that needs to be fixed, `:GoLint` with - warnings that we want to check, `:GoReferrers` with a list of referred - identifiers) [[GH-626]](https://github.com/fatih/vim-go/pull/626) -* a new **`:AsmFmt`** command which is integrated to work with [asmfmt](https://github.com/klauspost/asmfmt) [[GH-673]](https://github.com/fatih/vim-go/pull/673) -* the full identifier information of a completed identifier is echoed in - statusline. This is very useful to see a function signatures arguments. - [[GH-685]](https://github.com/fatih/vim-go/pull/685) - -IMPROVEMENTS: - -* Improve `:GoFmt` by checking if the binary is indeed installed on the system [[GH-617]](https://github.com/fatih/vim-go/pull/617) -* Improve `:GoMetaLinter` by adding the option to run the metalinter on save - and adding the option to limit the output to the currently active buffer. Set - `let g:go_metalinter_autosave = 1` to enable autosave and use `let - g:go_metalinter_autosave_enabled = ['vet', 'golint']` to change your options. - [[GH-631]](https://github.com/fatih/vim-go/pull/631) -* Improved `:GoDef`. If `vimproc` is installed `godef` will make use of it [[GH-670]](https://github.com/fatih/vim-go/pull/670) -* Improve completion of godoce when vimproc is used [[GH-620]](https://github.com/fatih/vim-go/pull/620) -* Improve internal error matching prodecure to not match false positives [[GH-618]](https://github.com/fatih/vim-go/pull/618) -* A new option to highlight interface variables with `go_highlight_interfaces` [[GH-681]](https://github.com/fatih/vim-go/pull/681) - -BUG FIXES - -* Fix `:GoFmt` changing the fileformat of the current buffer [[GH-615]](https://github.com/fatih/vim-go/pull/615) -* Fix `:GoRename` to output the original error if parsing fails [[GH-675]](https://github.com/fatih/vim-go/pull/675) -* Fix `:GoTest` to output the original error if parsing fails [[GH-676]](https://github.com/fatih/vim-go/pull/676) -* Fixed `fmt.Fprintln` not to highlight as builtin [[GH-628]](https://github.com/fatih/vim-go/pull/628) -* Fixed wrong highlighting of channels of channels [[GH-678]](https://github.com/fatih/vim-go/pull/678) - -## 1.3 (Nov 22, 2015) - -FEATURES: - -* A new `:GoOracleTags` command was added to pass build tags to Oracle's `-tags` flag. [[GH-573]](https://github.com/fatih/vim-go/pull/573) - -IMPROVEMENTS: - -* Change `:GoTest` command to timeout after 10 seconds. Vim UI is blocking and - tests with large running times makes Vim blocking for a long time. This is - also customizable with the new option `g:go_test_timeout`. [[GH-578]](https://github.com/fatih/vim-go/pull/578) -* Improve `:GoRename` to collect and populate quickfix window with errors. - [[GH-577]](https://github.com/fatih/vim-go/pull/577) -* Improve `:GoRun` by dropping bad filenames from quickfix window. This allows - us to have only valid entries which can be jumped to [[GH-547]](https://github.com/fatih/vim-go/pull/547) -* Improve `:GoMetaLinter` quickfix output by using absolute paths. This enables - us to jump to errors for all cases. [[GH-565]](https://github.com/fatih/vim-go/pull/565) -* Improve `:GoMetaLinter` command by adding a new option - `g:go_metalinter_deadline` which cancels the linters after 5 seconds - (previous default). [[GH-576]](https://github.com/fatih/vim-go/pull/576) -* Improve `:GoMetaLinter` by jumping to the first encountered error from the quickfix window. -* Automatically resize quickfix window based on the number of errors [[GH-602]](https://github.com/fatih/vim-go/pull/602) -* Improve build constraints to show invalid cases (such as `// +buildfoo`, not - having an empty line between the package statement, etc..). Also add missing - `GOARCH` values sucha s `arm64`. There are many other useful improvements, - for more detail please have a look at - [[GH-589]](https://github.com/fatih/vim-go/pull/589) -* Add support for all values of `GOARCH` [[GH-601]](https://github.com/fatih/vim-go/pull/601) -* Add note about Syntastic usage as this problem comes up a lot [[GH-580]](https://github.com/fatih/vim-go/pull/580) -* Add note about `:GoUpdateBinaries` [[GH-606]](https://github.com/fatih/vim-go/pull/606) - -BUG FIXES: - -* Fixed `:GoErrCheck` showing the correct output when executed inside the source folder [[GH-564]](https://github.com/fatih/vim-go/pull/564) -* Fixed `:GoBuild` by not using `/dev/null` anymore for build output (not - supported by `go`). We pass a temporary file now. [[GH-567]](https://github.com/fatih/vim-go/pull/567) -* Fixed `:GoFmt` passing `g:go_fmt_options` options to `goimports`. This option - is only valid with `gofmt`. [[GH-590]](https://github.com/fatih/vim-go/pull/590) -* Fix vim-go for `cygwin` users. [[GH-575]](https://github.com/fatih/vim-go/pull/575) -* Fixed identifier in template files to be highlighted correctly [[GH-559]](https://github.com/fatih/vim-go/pull/559) -* Fixed character region in template files to be highlighted correctly [[GH-603]](https://github.com/fatih/vim-go/pull/603) -* Fixed variables in template files to be highlighted correctly [[GH-611]](https://github.com/fatih/vim-go/pull/611) -* Do not treat builtins as keywords. Now `make` will not highlighted but - `make()` will be highlighted (gh-605) - -## 1.2 (Oct 2, 2015) - -FEATURES: - -* A new `:GoMetaLinter` command which invokes [gometalinter](https://github.com/alecthomas/gometalinter). Please check the PR [[GH-553]](https://github.com/fatih/vim-go/pull/553) for more detail on customizing and usage of `:GoMetaLinter`. - -IMPROVEMENTS: - -* Improve `:GoImport` to trim spaces when including import paths of form `"fmt "` -* Avoid setting `filetype` twice. Previously it was doing it twice, which was expensive -* Improve handling of GOPATH's with trailing `/` characters, such as `/home/user/go/` -* Add a new `g:go_highlight_string_spellcheck` feature, which is enabled by feature. Now if spell is enabled, go strings are also checked. -* Specify our limited but functional [gb](http://getgb.io/) support - -BUG FIXES: -* Fixed `:GoRun` to display errors when `g:go_dispatch_enabled` was enabled -* Fixed `:GoDrop` displaying "Not enough arguments" (regression) -* Fixed `:GoErrCheck` not showing `PASS` message if the command was successful -* Fixed `:GoErrCheck` not executing in the directory of the currently edited file -* Close quickfix window after a successful second round of `:GoInstall` -* Fix passing files rather than packages to certain oracle commands. -* Escape files passed to oracle command. This could lead to some serious things. -* Clear `g:go_oracle_scope` when the scope was reseted. Previously it was set to empty string, which was causing false positives. -* Correct various misspellings. - -## 1.1 (Jul 25, 2015) - -With this release the version will now increase in `minor` levels. So the next -release will be `1.2`, the other one `1.3`, etc.. This provides us more -flexibility (like releasing patch versions if needed). - -FEATURES: -* A new `:GoGenerate` command is now available which can be used to invoke `go generate` within vim -* Vim-go didn't had any license, now we use BSD 3-Clause License (the same as Go). This is needed for Linux distributions to package vim-go and is also something that people asked for. - -IMPROVEMENTS: -* Improve commands `GoRun, GoTest{,Func,Compile}, GoCoverage, - GoGenerate, GoErrcheck, GoLint, and GoVet` to handle multiple arguments. - Previously this feature was limited to only certain commands. What this means - is, for example `:GoVet . -all` will invoke `go tool vet . -all` - automatically instead of plan `go vet`. This is one of the big changes in - this release, so give it a try :) -* Improved `:GoFmt` command, which now uses the `-w` flag to - write to the source code directly, instead of outputting it to stdout. This - makes `:GoFmt` much more faster than the current implementation. This is one - of the big changes in this release, so feedback is welcome! -* Improve `:GoImport` to have a `!` feature. Now when when called - with a `!` appended it will go get it. i.e: `:GoImport! - github.com/fatih/color`. Useful if `:GoImport` fails and you want to download - it. -* Automatic GOPATH detections can now detect `gb` vendored folders. Some commands should now work without any problem when invoked on a `gb` project. -* All command arguments are now properly escaped for shell invocation. -* Added the `-f` flag to :GoInstallBinaries command to support `git url..insteadOf` configuration -* Improve width and precision highlighting, such as `%s %5s %-5s %5.5f %.5f` -* Show an error if a region is not selected when `:GoFreeVars` is called - -BUG FIXES: -* Fix`:GoDef` for files containing spaces. We know escape the files before passing to `:GoDef` -* Fix `:GoFmt` not picking up the correct GOPATH when the fmt command was set to `goimports` -* Fix and simplify README.md, add Wiki reference -* Fixed tagbar integration to show correct imports. - - -## 1.0.5 (May 26, 2015) - -FEATURES: -* A new `:GoOracleScope` is added to change the oracle scope on-the-fly. It - accepts import paths as arguments. If no arguments are passed it prints the - current custom oracle scope. `:GoOracleScope` also supports completion of - import paths, so it's very fast and handy to use. `:GoOracleScope ""` clears - the current custom scope. -* A new `:GoPath` command that displays the current `GOPATH`. A path can be - passed to change the `GOPATH` (i.e `:GoPath ~/foo/src`). `:GoPath ""` clears - and resets the `GOPATH` to the initial value. -* A new "autodetect GOPATH" feature is added. This automatically detects if the - project is using `godep` or is under a `src` root directory which is not in - `GOPATH` and changes/modifies the `GOPATH` so all commands work based on this - GOPATH. What this means is, commands such as `:GoDef`, `:GoBuild`, etc.. will - include the Godeps folder. For example any go-to-definition via `:GoDef` will - jump to the source code inside Godeps. This is enabled by default, but can - disabled with `let g:go_autodetect_gopath = 0`. This new feature is also the - foundation for other tools such as `gb` or `wgo`. - -IMPROVEMENTS: -* Improve `:GoFmt` (gofmt and goimports) speed. Now it's 2x faster than the previous implementation. -* Add Dispatch support for `:GoBuild` and `:GoRun`. For more info about - dispatch see https://github.com/tpope/vim-dispatch . By default it's - disabled, to enable it add `let g:go_dispatch_enabled = 1` to your vimrc. -* Add support for the bang `!` attribute for all `go` tool commands. What this - does it, if `:GoBuild` is called it will jump to the error. But `:GoBuild!` - will not jump to any error. This has the same behavior as the internal - `:make` command in vim. We had this feature already for `:GoBuild` and - `:GoRun`. But not for `:GoInstall`, `:GoTest`, etc.. Now all commands are - unified. -* Add autojump to error for `:GoInstall`. -* Add autowrite feature for `:GoInstall`, `:GoTestXXX` functions and `:GoVet` -* Support `git url..insteadOf` and custom import paths of binaries. This - improves the commands `:GoInstallBinaries` and `:GoUpdateBinaries`. -* Add support for highlighting go templates with `*.tmpl` extensions. Based on - the work from @cespare from https://github.com/cespare/vim-go-templates - -BUG FIXES: -* Fix clearing the status bar when `:GoErrCheck` is called -* Fix godocNotFound to not match 'os' pkg contents. This improves the command - `:GoDoc` -* Fix parsing and jumping to error locations when used Vim from a different - directory than the current buffer's directory -* Fix completion showing duplicates paths for completion results, such as - github.com/fatih/color and github.com/fatih/color/. - -## 1.0.4 (Apr 28, 2015) - -FEATURES: - -* A new `:GoTestFunc` command (with appropriate - mappings) is added. Run tests function which surrounds the current cursor - location. Useful to test single tests. -* Highlight all Go operators. Previously not all - operators were highlighted. As previously, to highlight options, enable it - with by setting `g:go_highlight_operators` to 1 in your vimrc. - -IMPROVEMENTS: - -* Improved certain `:GoDoc` usages to show a better error message -* Improved `:GoRename` to have a default value for rename input. Avoids retyping similar words. -* Synced with latest Oracle version. `callgraph` is removed. -* Removed our custom referrers mode. New version of oracle now displays the matching lines. - -BUG FIXES: - -* Fixed the internal `executeInDir` function which was failing when ignorelist was not set properly. -* Fixed trailing slash for package completion with `:GoImport` -* Fixed paths in error list for Windows users. -* Fixed not showing "import cycle not allowed" error message when called `:GoBuild` or `:GoRun` -* Fixed users using vimproc requiring arguments to functions to be escaped. -* Fixed depth for test snippets -* Fixed neosnippet support loading snippet files the second time if necessary. - -## 1.0.3 (Mar 7, 2015) - -FEATURES: -* A new `:GoTestCompile` command (with appropriate mappings) is added. Useful to compile a test binary or show/fix compile errors in quickfix window - -IMPROVEMENTS: -* `referrer` mode is improved to show referring lines in the quickfix window -* A new `errt` snippet is added, which expands to `if err != nil { t.Fatal(err) }` -* A new `errh` snippet is added, useful to be used in a `http.Handler` -* UltiSnips snippets are improved to take advance of Vim's `Visual` mode. For example selecting a block and typing `if` will create an if scope around the block. -* Cleanup README.md - -BUG FIXES: -* Fix trimming brackets if completion was invoked on a previous completion -* Fix Oracle scope settings. Added docs about usage. -* Fixed previously broken `var` and `vars` snippets -* Fix duplicate docs -* Fix fallback binary path for Windows users. The fallback mechanism is used to discover the necessary Go tools, such as `godef`, `gocode`, etc... - -## 1.0.2 (Feb 17, 2015) - -FEATURES: - -* New snippets are added, mostly for testing ( [changes](https://github.com/fatih/vim-go/pull/321/files)) - -IMPROVEMENTS: - -* Enable all Oracle commands. Docs, mappings and commands are also added. It uses Quickfix list instead of a custom UI. -* Clarify installation process in Readme, add instructions for vim-plug, NeoBundle and manual. - -BUG FIXES: - -* Fix shiftwidth parsing, it was broken in the previous release for old Vim versions -* Fix experimantal mode - - -## 1.0.1 (Feb 9, 2015) - -FEATURES: - -* New feature to highlight build constraints (disabled by default) - -IMPROVEMENTS: - -* Updated godef import path -* Updated Readme for possible problems with `csh` -* Documentation for text objects are updated, typo fixes are merged -* If vimproc is installed, Windows users will use it for autocompletion -* Improve UltiSnips snippets to pick Visual selection (demo: http://quick.as/0dvigz5) -* Packages with extensions, like "gopkg.in/yaml.v2" can be now displayed -* Packages with different import paths, like "github.com/bitly/go-simplejson" can be now displayed - -BUG FIXES: - -* Fatal errors are now parsed successfully and populated to quickfix list -* Shiftwidth is changed to use shiftwidth() function. Fixes usage with plugins like vim-sleuth and possible mis usage (like setting shiftwidth to zero) -* Added a new [Donation](https://github.com/fatih/vim-go#donations) section to Readme, for those who ask for it. -* Fix parsing of errcheck error syntax -* Fix consistency between Neosnippet and UltiSnips snippets - - -## 1.0 (Dec 24, 2014) - -We don't tag any changes or releases, so let's start with `1.0`. Our Windows -support is now in a good shape, tons of bugs are fixed, many new features and -improvements is being added and it's getting better with each day (thanks to -the community contributions). - -## 0.0 (Mar 24, 2014) - -Initial commit: https://github.com/fatih/vim-go/commit/78c5caa82c111c50e9c219f222d65b07694f8f5a - - diff --git a/vim-config/plugins/vim-go/Dockerfile b/vim-config/plugins/vim-go/Dockerfile deleted file mode 100644 index cacf54f8..00000000 --- a/vim-config/plugins/vim-go/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM golang:1.14.0-buster - -RUN apt-get update -y && \ - apt-get install -y build-essential curl git libncurses5-dev python3-pip && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN pip3 install vim-vint - -RUN useradd -ms /bin/bash -d /vim-go vim-go -USER vim-go - -COPY . /vim-go/ -WORKDIR /vim-go - -RUN scripts/install-vim vim-8.0 -RUN scripts/install-vim vim-8.2 -RUN scripts/install-vim nvim - -ENTRYPOINT ["make"] diff --git a/vim-config/plugins/vim-go/LICENSE b/vim-config/plugins/vim-go/LICENSE deleted file mode 100644 index d9493d4f..00000000 --- a/vim-config/plugins/vim-go/LICENSE +++ /dev/null @@ -1,60 +0,0 @@ -Copyright (c) 2015, Fatih Arslan -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of vim-go nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This software includes some portions from Go. Go is used under the terms of the -BSD like license. - -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The Go gopher was designed by Renee French. http://reneefrench.blogspot.com/ The design is licensed under the Creative Commons 3.0 Attributions license. Read this article for more details: https://blog.golang.org/gopher diff --git a/vim-config/plugins/vim-go/Makefile b/vim-config/plugins/vim-go/Makefile deleted file mode 100644 index aab49dab..00000000 --- a/vim-config/plugins/vim-go/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -VIMS ?= vim-8.0 vim-8.2 nvim - -all: install lint test - -install: - @echo "==> Installing Vims: $(VIMS)" - @for vim in $(VIMS); do \ - ./scripts/install-vim $$vim; \ - done - -test: - @echo "==> Running tests for $(VIMS)" - @for vim in $(VIMS); do \ - ./scripts/test $$vim; \ - done - -lint: - @echo "==> Running linting tools" - @./scripts/lint vim-8.2 - -docker: - @echo "==> Building/starting Docker container" - @./scripts/docker-test - -clean: - @echo "==> Cleaning /tmp/vim-go-test" - @rm -rf /tmp/vim-go-test - -.PHONY: all test install clean lint docker diff --git a/vim-config/plugins/vim-go/README.md b/vim-config/plugins/vim-go/README.md deleted file mode 100644 index 157bbeaa..00000000 --- a/vim-config/plugins/vim-go/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# vim-go [![Build Status](http://img.shields.io/travis/fatih/vim-go.svg?style=flat-square)](https://travis-ci.org/fatih/vim-go) [![GitHub Actions Status](https://github.com/fatih/vim-go/workflows/test/badge.svg)](https://github.com/fatih/vim-go/actions) - - - -

- Vim-go logo -

- -## Features - -This plugin adds Go language support for Vim, with the following main features: - -* Compile your package with `:GoBuild`, install it with `:GoInstall` or test it - with `:GoTest`. Run a single test with `:GoTestFunc`). -* Quickly execute your current file(s) with `:GoRun`. -* Improved syntax highlighting and folding. -* Debug programs with integrated `delve` support with `:GoDebugStart`. -* Completion and many other features support via `gopls`. -* formatting on save keeps the cursor position and undo history. -* Go to symbol/declaration with `:GoDef`. -* Look up documentation with `:GoDoc` or `:GoDocBrowser`. -* Easily import packages via `:GoImport`, remove them via `:GoDrop`. -* Precise type-safe renaming of identifiers with `:GoRename`. -* See which code is covered by tests with `:GoCoverage`. -* Add or remove tags on struct fields with `:GoAddTags` and `:GoRemoveTags`. -* Call `golangci-lint` with `:GoMetaLinter` to invoke all possible linters - (`golint`, `vet`, `errcheck`, `deadcode`, etc.) and put the result in the - quickfix or location list. -* Lint your code with `:GoLint`, run your code through `:GoVet` to catch static - errors, or make sure errors are checked with `:GoErrCheck`. -* Advanced source analysis tools utilizing `guru`, such as `:GoImplements`, - `:GoCallees`, and `:GoReferrers`. -* ... and many more! Please see [doc/vim-go.txt](doc/vim-go.txt) for more - information. -* The `gopls` instance can be shared with other Vim plugins. -* Vim-go's use of `gopls` can be disabled. - -## Install - -vim-go requires at least Vim 8.0.1453 or Neovim 0.4.0. - -The [**latest stable release**](https://github.com/fatih/vim-go/releases/latest) is the -recommended version to use. If you choose to use the master branch instead, -please do so with caution; it is a _development_ branch. - - -vim-go follows the standard runtime path structure. Below are some helper lines -for popular package managers: - -* [Vim 8 packages](http://vimhelp.appspot.com/repeat.txt.html#packages) - * `git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go` -* [Pathogen](https://github.com/tpope/vim-pathogen) - * `git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go` -* [vim-plug](https://github.com/junegunn/vim-plug) - * `Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }` -* [Vundle](https://github.com/VundleVim/Vundle.vim) - * `Plugin 'fatih/vim-go'` - -You will also need to install all the necessary binaries. vim-go makes it easy -to install all of them by providing a command, `:GoInstallBinaries`, which will -`go get` all the required binaries. - -Check out the Install section in [the documentation](doc/vim-go.txt) for more -detailed instructions (`:help go-install`). - -## Usage - -The full documentation can be found at [doc/vim-go.txt](doc/vim-go.txt). You can -display it from within Vim with `:help vim-go`. - -Depending on your installation method, you may have to generate the plugin's -[`help tags`](http://vimhelp.appspot.com/helphelp.txt.html#%3Ahelptags) -manually (e.g. `:helptags ALL`). - -We also have an [official vim-go tutorial](https://github.com/fatih/vim-go/wiki). - -## FAQ and troubleshooting - -The FAQ and troubleshooting tips are in the documentation and can be quickly -accessed using `:help go-troubleshooting`. If you believe you've found a bug or -shortcoming in vim-go that is neither addressed by help nor in [existing -issues](https://github.com/fatih/vim-go/issues), please open an issue with -clear reproduction steps. `:GoReportGitHubIssue` can be used pre-populate a lot -of the information needed when creating a new issue. - -## Contributing - -All PRs are welcome. If you are planning to contribute a large patch or to -integrate a new tool, please create an issue first to get any upfront questions -or design decisions out of the way first. - -You can run the tests locally by running `make`. It will lint the VimL for you, -lint the documentation, and run the tests against the minimum required version -of Vim, other versions of Vim that may be critical to support, and Neovim. - -## License - -The BSD 3-Clause License - see [`LICENSE`](LICENSE) for more details - diff --git a/vim-config/plugins/vim-go/addon-info.json b/vim-config/plugins/vim-go/addon-info.json deleted file mode 100644 index 145d961c..00000000 --- a/vim-config/plugins/vim-go/addon-info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vim-go", - "description": "Full featured Go (golang) support for Vim.", - "author": "Fatih Arslan ", - "repository" : {"type": "git", "url": "https://github.com/fatih/vim-go.git"} -} diff --git a/vim-config/plugins/vim-go/assets/vim-go.png b/vim-config/plugins/vim-go/assets/vim-go.png deleted file mode 100644 index cb26e2c0..00000000 Binary files a/vim-config/plugins/vim-go/assets/vim-go.png and /dev/null differ diff --git a/vim-config/plugins/vim-go/assets/vim-go.svg b/vim-config/plugins/vim-go/assets/vim-go.svg deleted file mode 100644 index 8471db59..00000000 --- a/vim-config/plugins/vim-go/assets/vim-go.svg +++ /dev/null @@ -1,821 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vim-config/plugins/vim-go/autoload/ctrlp/decls.vim b/vim-config/plugins/vim-go/autoload/ctrlp/decls.vim deleted file mode 100644 index 5d652998..00000000 --- a/vim-config/plugins/vim-go/autoload/ctrlp/decls.vim +++ /dev/null @@ -1,154 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:go_decls_var = { - \ 'init': 'ctrlp#decls#init()', - \ 'exit': 'ctrlp#decls#exit()', - \ 'enter': 'ctrlp#decls#enter()', - \ 'accept': 'ctrlp#decls#accept', - \ 'lname': 'declarations', - \ 'sname': 'decls', - \ 'type': 'tabs', - \} - -if exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) - let g:ctrlp_ext_vars = add(g:ctrlp_ext_vars, s:go_decls_var) -else - let g:ctrlp_ext_vars = [s:go_decls_var] -endif - -function! ctrlp#decls#init() abort - cal s:enable_syntax() - return s:decls -endfunction - -function! ctrlp#decls#exit() abort - unlet! s:decls s:target -endfunction - -" The action to perform on the selected string -" Arguments: -" a:mode the mode that has been chosen by pressing or -" the values are 'e', 'v', 't' and 'h', respectively -" a:str the selected string -function! ctrlp#decls#accept(mode, str) abort - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - let vals = matchlist(a:str, '|\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)|') - - " i.e: main.go - let filename = vals[1] - let line = vals[2] - let col = vals[3] - - " i.e: /Users/fatih/vim-go/main.go - let filepath = fnamemodify(filename, ":p") - - " acceptile is a very versatile method, - call ctrlp#acceptfile(a:mode, filepath) - call cursor(line, col) - silent! norm! zvzz - endtry -endfunction - -function! ctrlp#decls#enter() abort - let s:decls = [] - - let l:cmd = ['motion', - \ '-format', 'vim', - \ '-mode', 'decls', - \ '-include', go#config#DeclsIncludes(), - \ ] - - call go#cmd#autowrite() - - if s:mode == 0 - " current file mode - let l:fname = expand("%:p") - if exists('s:target') - let l:fname = s:target - endif - - let cmd += ['-file', l:fname] - else - " all functions mode - let l:dir = expand("%:p:h") - if exists('s:target') - let l:dir = s:target - endif - - let cmd += ['-dir', l:dir] - endif - - let [l:out, l:err] = go#util#Exec(l:cmd) - if l:err - call go#util#EchoError(l:out) - return - endif - - let result = eval(out) - if type(result) != 4 || !has_key(result, 'decls') - return - endif - - let decls = result.decls - - " find the maximum function name - let max_len = 0 - for decl in decls - if len(decl.ident)> max_len - let max_len = len(decl.ident) - endif - endfor - - for decl in decls - " paddings - let space = " " - for i in range(max_len - len(decl.ident)) - let space .= " " - endfor - - call add(s:decls, printf("%s\t%s |%s:%s:%s|\t%s", - \ decl.ident . space, - \ decl.keyword, - \ fnamemodify(decl.filename, ":p"), - \ decl.line, - \ decl.col, - \ decl.full, - \)) - endfor -endfunc - -function! s:enable_syntax() abort - if !(has('syntax') && exists('g:syntax_on')) - return - endif - - syntax match CtrlPIdent '\zs\h\+\ze\s' - syntax match CtrlPKeyword '\zs[^\t|]\+\ze|[^|]\+:\d\+:\d\+|' - syntax match CtrlPFilename '|\zs[^|]\+:\d\+:\d\+\ze|' - syntax match CtrlPSignature '\zs\t.*\ze$' contains=CtrlPKeyWord,CtrlPFilename - - highlight link CtrlPIdent Function - highlight link CtrlPKeyword Keyword - highlight link CtrlPFilename SpecialComment - highlight link CtrlPSignature Comment -endfunction - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) - -function! ctrlp#decls#cmd(mode, ...) abort - let s:mode = a:mode - if a:0 && !empty(a:1) - let s:target = a:1 - endif - return s:id -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/fzf/decls.vim b/vim-config/plugins/vim-go/autoload/fzf/decls.vim deleted file mode 100644 index 02bf462a..00000000 --- a/vim-config/plugins/vim-go/autoload/fzf/decls.vim +++ /dev/null @@ -1,157 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! s:code(group, attr) abort - let code = synIDattr(synIDtrans(hlID(a:group)), a:attr, "cterm") - if code =~ '^[0-9]\+$' - return code - endif -endfunction - -function! s:color(str, group) abort - let fg = s:code(a:group, "fg") - let bg = s:code(a:group, "bg") - let bold = s:code(a:group, "bold") - let italic = s:code(a:group, "italic") - let reverse = s:code(a:group, "reverse") - let underline = s:code(a:group, "underline") - let color = (empty(fg) ? "" : ("38;5;".fg)) . - \ (empty(bg) ? "" : (";48;5;".bg)) . - \ (empty(bold) ? "" : ";1") . - \ (empty(italic) ? "" : ";3") . - \ (empty(reverse) ? "" : ";7") . - \ (empty(underline) ? "" : ";4") - return printf("\x1b[%sm%s\x1b[m", color, a:str) -endfunction - -function! s:sink(str) abort - if len(a:str) < 2 - return - endif - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - " we jump to the file directory so we can get the fullpath via fnamemodify - " below - execute cd . fnameescape(s:current_dir) - - let vals = matchlist(a:str[1], '|\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)|') - - " i.e: main.go - let filename = vals[1] - let line = vals[2] - let col = vals[3] - - " i.e: /Users/fatih/vim-go/main.go - let filepath = fnamemodify(filename, ":p") - - let cmd = get({'ctrl-x': 'split', - \ 'ctrl-v': 'vertical split', - \ 'ctrl-t': 'tabe'}, a:str[0], 'e') - execute cmd fnameescape(filepath) - call cursor(line, col) - silent! norm! zvzz - finally - "jump back to old dir - execute cd . fnameescape(dir) - endtry -endfunction - -function! s:source(mode,...) abort - let s:current_dir = expand('%:p:h') - let ret_decls = [] - - let l:cmd = ['motion', - \ '-format', 'vim', - \ '-mode', 'decls', - \ '-include', go#config#DeclsIncludes(), - \ ] - - call go#cmd#autowrite() - - if a:mode == 0 - " current file mode - let l:fname = expand("%:p") - if a:0 && !empty(a:1) - let l:fname = a:1 - endif - - let cmd += ['-file', l:fname] - else - " all functions mode - if a:0 && !empty(a:1) - let s:current_dir = a:1 - endif - - let l:cmd += ['-dir', s:current_dir] - endif - - let [l:out, l:err] = go#util#Exec(l:cmd) - if l:err - call go#util#EchoError(l:out) - return - endif - - let result = eval(out) - if type(result) != 4 || !has_key(result, 'decls') - return ret_decls - endif - - let decls = result.decls - - " find the maximum function name - let max_len = 0 - for decl in decls - if len(decl.ident)> max_len - let max_len = len(decl.ident) - endif - endfor - - for decl in decls - " paddings - let space = " " - for i in range(max_len - len(decl.ident)) - let space .= " " - endfor - - let pos = printf("|%s:%s:%s|", - \ fnamemodify(decl.filename, ":t"), - \ decl.line, - \ decl.col - \) - call add(ret_decls, printf("%s\t%s %s\t%s", - \ s:color(decl.ident . space, "goDeclsFzfFunction"), - \ s:color(decl.keyword, "goDeclsFzfKeyword"), - \ s:color(pos, "goDeclsFzfSpecialComment"), - \ s:color(decl.full, "goDeclsFzfComment"), - \)) - endfor - - return ret_decls -endfunc - -function! fzf#decls#cmd(...) abort - let normal_fg = s:code("Normal", "fg") - let normal_bg = s:code("Normal", "bg") - let cursor_fg = s:code("CursorLine", "fg") - let cursor_bg = s:code("CursorLine", "bg") - let colors = printf(" --color %s%s%s%s%s", - \ &background, - \ empty(normal_fg) ? "" : (",fg:".normal_fg), - \ empty(normal_bg) ? "" : (",bg:".normal_bg), - \ empty(cursor_fg) ? "" : (",fg+:".cursor_fg), - \ empty(cursor_bg) ? "" : (",bg+:".cursor_bg), - \) - call fzf#run(fzf#wrap('GoDecls', { - \ 'source': call('source', a:000), - \ 'options': '-n 1 --ansi --prompt "GoDecls> " --expect=ctrl-t,ctrl-v,ctrl-x'.colors, - \ 'sink*': function('s:sink') - \ })) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/alternate.vim b/vim-config/plugins/vim-go/autoload/go/alternate.vim deleted file mode 100644 index a0671905..00000000 --- a/vim-config/plugins/vim-go/autoload/go/alternate.vim +++ /dev/null @@ -1,35 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" Test alternates between the implementation of code and the test code. -function! go#alternate#Switch(bang, cmd) abort - let file = expand('%') - if empty(file) - call go#util#EchoError("no buffer name") - return - elseif file =~# '^\f\+_test\.go$' - let l:root = split(file, '_test.go$')[0] - let l:alt_file = l:root . ".go" - elseif file =~# '^\f\+\.go$' - let l:root = split(file, ".go$")[0] - let l:alt_file = l:root . '_test.go' - else - call go#util#EchoError("not a go file") - return - endif - if !filereadable(alt_file) && !bufexists(alt_file) && !a:bang - call go#util#EchoError("couldn't find ".alt_file) - return - elseif empty(a:cmd) - execute ":" . go#config#AlternateMode() . " " . alt_file - else - execute ":" . a:cmd . " " . alt_file - endif -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/asmfmt.vim b/vim-config/plugins/vim-go/autoload/go/asmfmt.vim deleted file mode 100644 index 9aa5f470..00000000 --- a/vim-config/plugins/vim-go/autoload/go/asmfmt.vim +++ /dev/null @@ -1,76 +0,0 @@ -" asmfmt.vim: Vim command to format Go asm files with asmfmt -" (github.com/klauspost/asmfmt). -" -" This filetype plugin adds new commands for asm buffers: -" -" :Fmt -" -" Filter the current asm buffer through asmfmt. -" It tries to preserve cursor position and avoids -" replacing the buffer with stderr output. -" -" Options: -" -" g:go_asmfmt_autosave [default=0] -" -" Flag to automatically call :Fmt when file is saved. - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:got_fmt_error = 0 - -" This is a trimmed-down version of the logic in fmt.vim. - -function! go#asmfmt#Format() abort - " Save state. - let l:curw = winsaveview() - - " Write the current buffer to a tempfile. - let l:tmpname = tempname() - call writefile(go#util#GetLines(), l:tmpname) - - " Run asmfmt. - let [l:out, l:err] = go#util#Exec(['asmfmt', '-w', l:tmpname]) - if l:err - call go#util#EchoError(l:out) - return - endif - - " Remove undo point caused by BufWritePre. - try | silent undojoin | catch | endtry - - " Replace the current file with the temp file; then reload the buffer. - let old_fileformat = &fileformat - - " save old file permissions - let original_fperm = getfperm(expand('%')) - call rename(l:tmpname, expand('%')) - - " restore old file permissions - call setfperm(expand('%'), original_fperm) - silent edit! - let &fileformat = old_fileformat - let &syntax = &syntax - - " Restore the cursor/window positions. - call winrestview(l:curw) -endfunction - -function! go#asmfmt#ToggleAsmFmtAutoSave() abort - if go#config#AsmfmtAutosave() - call go#config#SetAsmfmtAutosave(1) - call go#util#EchoProgress("auto asmfmt enabled") - return - end - - call go#config#SetAsmfmtAutosave(0) - call go#util#EchoProgress("auto asmfmt disabled") -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/auto.vim b/vim-config/plugins/vim-go/autoload/go/auto.vim deleted file mode 100644 index abf8dba7..00000000 --- a/vim-config/plugins/vim-go/autoload/go/auto.vim +++ /dev/null @@ -1,192 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#auto#template_autocreate() - if !go#config#TemplateAutocreate() || !&modifiable - return - endif - - " create new template from scratch - call go#template#create() -endfunction - -function! go#auto#complete_done() - call s:echo_go_info() - call s:ExpandSnippet() -endfunction - -function! s:ExpandSnippet() abort - if !exists('v:completed_item') || empty(v:completed_item) || !go#config#GoplsUsePlaceholders() - return - endif - - - let l:engine = go#config#SnippetEngine() - - if l:engine is 'ultisnips' - if !get(g:, 'did_plugin_ultisnips', 0) - return - endif - " the snippet may have a '{\}' in it. For UltiSnips, that should be spelled - " \{}. fmt.Printf is such a snippet that can be used to demonstrate. - let l:snippet = substitute(v:completed_item.word, '{\\}', '\{}', 'g') - call UltiSnips#Anon(l:snippet, v:completed_item.word, '', 'i') -" elseif l:engine is 'neosnippet' -" " TODO(bc): make the anonymous expansion for neosnippet work -" -" if !get(g:, 'loaded_neosnippet') is 1 -" return -" endif -" -" " neosnippet#anonymous doesn't need a trigger, so replace the -" " completed_item.word with an empty string before calling neosnippet#anonymous -" let l:snippet = substitute(v:completed_item.word, '{\\}', '\{\}', 'g') -" call setline('.', substitute(getline('.'), substitute(v:completed_item.word, '\', '\\', 'g'), '', '')) -" call neosnippet#anonymous(l:snippet) - endif -endfunction - -function! s:echo_go_info() - if !go#config#EchoGoInfo() - return - endif - - if !exists('v:completed_item') || empty(v:completed_item) - return - endif - let item = v:completed_item - - if !has_key(item, "info") - return - endif - - if empty(item.info) - return - endif - - redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None -endfunction - -let s:timer_id = 0 - -" go#auto#update_autocmd() will be called on BufEnter,CursorHold. This -" configures the augroup according to conditions below. -" -" | # | has_timer | should_enable | do | -" |---|-----------|---------------|------------------------------------| -" | 1 | false | false | return early | -" | 2 | true | true | return early | -" | 3 | true | false | clear the group and stop the timer | -" | 4 | false | true | configure the group | -function! go#auto#update_autocmd() - let has_timer = get(b:, 'has_timer') - let should_enable = go#config#AutoTypeInfo() || go#config#AutoSameids() - if (!has_timer && !should_enable) || (has_timer && should_enable) - return - endif - - if has_timer - augroup vim-go-buffer-auto - autocmd! * - augroup END - let b:has_timer = 0 - call s:timer_stop() - return - endif - - augroup vim-go-buffer-auto - autocmd! * - autocmd CursorMoved call s:timer_restart() - autocmd BufLeave call s:timer_stop() - augroup END - let b:has_timer = 1 - call s:timer_start() -endfunction - -function! s:timer_restart() - if isdirectory(expand('%:p:h')) - call s:timer_stop() - call s:timer_start() - endif -endfunction - -function! s:timer_stop() - if s:timer_id - call timer_stop(s:timer_id) - let s:timer_id = 0 - endif -endfunction - -function! s:timer_start() - let s:timer_id = timer_start(go#config#Updatetime(), function('s:handler')) -endfunction - -function! s:handler(timer_id) - if go#config#AutoTypeInfo() - call go#tool#Info(0) - endif - if go#config#AutoSameids() - call go#guru#SameIds(0) - endif - let s:timer_id = 0 -endfunction - -function! go#auto#fmt_autosave() - if !(isdirectory(expand('%:p:h')) && expand(':p') == expand('%:p')) - return - endif - - if !(go#config#FmtAutosave() || go#config#ImportsAutosave()) - return - endif - - if go#config#ImportsAutosave() && !(go#config#FmtAutosave() && go#config#FmtCommand() == 'goimports') - call go#fmt#Format(1) - - " return early when the imports mode is goimports, because there's no need - " to format again when goimports was run - if go#config#ImportsMode() == 'goimports' - return - endif - endif - - if !go#config#FmtAutosave() - return - endif - - call go#fmt#Format(-1) -endfunction - -function! go#auto#metalinter_autosave() - if !go#config#MetalinterAutosave() || !isdirectory(expand('%:p:h')) - return - endif - - " run gometalinter on save - call go#lint#Gometa(!g:go_jump_to_error, 1) -endfunction - -function! go#auto#modfmt_autosave() - if !(go#config#ModFmtAutosave() && isdirectory(expand('%:p:h')) && expand(':p') == expand('%:p')) - return - endif - - " go.mod code formatting on save - call go#mod#Format() -endfunction - -function! go#auto#asmfmt_autosave() - if !(go#config#AsmfmtAutosave() && isdirectory(expand('%:p:h')) && expand(':p') == expand('%:p')) - return - endif - - " Go asm formatting on save - call go#asmfmt#Format() -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/cmd.vim b/vim-config/plugins/vim-go/autoload/go/cmd.vim deleted file mode 100644 index 88671662..00000000 --- a/vim-config/plugins/vim-go/autoload/go/cmd.vim +++ /dev/null @@ -1,384 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#cmd#autowrite() abort - if &autowrite == 1 || &autowriteall == 1 - silent! wall - else - for l:nr in range(0, bufnr('$')) - if buflisted(l:nr) && getbufvar(l:nr, '&modified') - " Sleep one second to make sure people see the message. Otherwise it is - " often immediately overwritten by the async messages (which also - " doesn't invoke the "hit ENTER" prompt). - call go#util#EchoWarning('[No write since last change]') - sleep 1 - return - endif - endfor - endif -endfunction - -" Build builds the source code without producing any output binary. We live in -" an editor so the best is to build it to catch errors and fix them. By -" default it tries to call simply 'go build', but it first tries to get all -" dependent files for the current folder and passes it to go build. -function! go#cmd#Build(bang, ...) abort - " Create our command arguments. go build discards any results when it - " compiles multiple packages. So we pass the `errors` package just as an - " placeholder with the current folder (indicated with '.'). - let l:args = - \ ['build', '-tags', go#config#BuildTags()] + - \ map(copy(a:000), "expand(v:val)") + - \ [".", "errors"] - - " Vim and Neovim async - if go#util#has_job() - call s:cmd_job({ - \ 'cmd': ['go'] + args, - \ 'bang': a:bang, - \ 'for': 'GoBuild', - \ 'statustype': 'build' - \}) - - " Vim without async - else - let l:status = { - \ 'desc': 'current status', - \ 'type': 'build', - \ 'state': "started", - \ } - call go#statusline#Update(expand('%:p:h'), l:status) - - let default_makeprg = &makeprg - let &makeprg = "go " . join(go#util#Shelllist(args), ' ') - - let l:listtype = go#list#Type("GoBuild") - " execute make inside the source folder so we can parse the errors - " correctly - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd . fnameescape(expand("%:p:h")) - if l:listtype == "locationlist" - silent! exe 'lmake!' - else - silent! exe 'make!' - endif - redraw! - finally - execute cd . fnameescape(dir) - let &makeprg = default_makeprg - endtry - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) - if !empty(errors) && !a:bang - call go#list#JumpToFirst(l:listtype) - let l:status.state = 'failed' - else - let l:status.state = 'success' - if go#config#EchoCommandInfo() - call go#util#EchoSuccess("[build] SUCCESS") - endif - endif - call go#statusline#Update(expand('%:p:h'), l:status) - endif - -endfunction - - -" BuildTags sets or shows the current build tags used for tools -function! go#cmd#BuildTags(bang, ...) abort - if a:0 - let v = a:1 - if v == '""' || v == "''" - let v = "" - endif - call go#config#SetBuildTags(v) - let tags = go#config#BuildTags() - if empty(tags) - call go#util#EchoSuccess("build tags are cleared") - else - call go#util#EchoSuccess("build tags are changed to: " . tags) - endif - - return - endif - - let tags = go#config#BuildTags() - if empty(tags) - call go#util#EchoSuccess("build tags are not set") - else - call go#util#EchoSuccess("current build tags: " . tags) - endif -endfunction - - -" Run runs the current file (and their dependencies if any) in a new terminal. -function! go#cmd#RunTerm(bang, mode, files) abort - let cmd = ["go", "run"] - if len(go#config#BuildTags()) > 0 - call extend(cmd, ["-tags", go#config#BuildTags()]) - endif - - if empty(a:files) - call extend(cmd, go#tool#Files()) - else - call extend(cmd, map(copy(a:files), funcref('s:expandRunArgs'))) - endif - call go#term#newmode(a:bang, cmd, s:runerrorformat(), a:mode) -endfunction - -" Run runs the current file (and their dependencies if any) and outputs it. -" This is intended to test small programs and play with them. It's not -" suitable for long running apps, because vim is blocking by default and -" calling long running apps will block the whole UI. -function! go#cmd#Run(bang, ...) abort - if go#config#TermEnabled() - call go#cmd#RunTerm(a:bang, '', a:000) - return - endif - - if go#util#has_job() - " NOTE(arslan): 'term': 'open' case is not implement for +jobs. This means - " executions waiting for stdin will not work. That's why we don't do - " anything. Once this is implemented we're going to make :GoRun async - endif - - let l:status = { - \ 'desc': 'current status', - \ 'type': 'run', - \ 'state': "started", - \ } - - call go#statusline#Update(expand('%:p:h'), l:status) - - let l:cmd = ['go', 'run'] - let l:tags = go#config#BuildTags() - if len(l:tags) > 0 - let l:cmd = l:cmd + ['-tags', l:tags] - endif - - if a:0 == 0 - let l:files = go#tool#Files() - else - let l:files = map(copy(a:000), funcref('s:expandRunArgs')) - endif - - let l:cmd = l:cmd + l:files - - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let l:dir = getcwd() - - if go#util#IsWin() - try - if go#util#HasDebug('shell-commands') - call go#util#EchoInfo(printf('shell command: %s', string(l:cmd))) - endif - - execute l:cd . fnameescape(expand("%:p:h")) - exec printf('!%s', go#util#Shelljoin(l:cmd, 1)) - finally - execute l:cd . fnameescape(l:dir) - endtry - - let l:status.state = 'success' - if v:shell_error - let l:status.state = 'failed' - if go#config#EchoCommandInfo() - redraws! - call go#util#EchoError('[run] FAILED') - endif - else - if go#config#EchoCommandInfo() - redraws! - call go#util#EchoSuccess('[run] SUCCESS') - endif - endif - - call go#statusline#Update(expand('%:p:h'), l:status) - return - endif - - " :make expands '%' and '#' wildcards, so they must also be escaped - let l:default_makeprg = &makeprg - let &makeprg = go#util#Shelljoin(l:cmd, 1) - - let l:listtype = go#list#Type("GoRun") - - let l:status.state = 'success' - - try - " backup user's errorformat, will be restored once we are finished - let l:old_errorformat = &errorformat - let &errorformat = s:runerrorformat() - - if go#util#HasDebug('shell-commands') - call go#util#EchoInfo('shell command: ' . l:cmd) - endif - - execute l:cd . fnameescape(expand("%:p:h")) - if l:listtype == "locationlist" - exe 'lmake!' - else - exe 'make!' - endif - finally - "restore the working directory, errformat, and makeprg - execute cd . fnameescape(l:dir) - let &errorformat = l:old_errorformat - let &makeprg = l:default_makeprg - endtry - - let l:errors = go#list#Get(l:listtype) - - call go#list#Window(l:listtype, len(l:errors)) - if !empty(l:errors) - let l:status.state = 'failed' - if !a:bang - call go#list#JumpToFirst(l:listtype) - endif - endif - call go#statusline#Update(expand('%:p:h'), l:status) -endfunction - -" Install installs the package by simple calling 'go install'. If any argument -" is given(which are passed directly to 'go install') it tries to install -" those packages. Errors are populated in the location window. -function! go#cmd#Install(bang, ...) abort - " use vim's job functionality to call it asynchronously - if go#util#has_job() - " expand all wildcards(i.e: '%' to the current file name) - let goargs = map(copy(a:000), "expand(v:val)") - - call s:cmd_job({ - \ 'cmd': ['go', 'install', '-tags', go#config#BuildTags()] + goargs, - \ 'bang': a:bang, - \ 'for': 'GoInstall', - \ 'statustype': 'install' - \}) - return - endif - - let default_makeprg = &makeprg - - " :make expands '%' and '#' wildcards, so they must also be escaped - let goargs = go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1) - let &makeprg = "go install " . goargs - - let l:listtype = go#list#Type("GoInstall") - " execute make inside the source folder so we can parse the errors - " correctly - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd . fnameescape(expand("%:p:h")) - if l:listtype == "locationlist" - silent! exe 'lmake!' - else - silent! exe 'make!' - endif - redraw! - finally - execute cd . fnameescape(dir) - let &makeprg = default_makeprg - endtry - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) - if !empty(errors) && !a:bang - call go#list#JumpToFirst(l:listtype) - else - call go#util#EchoSuccess("installed to ". go#path#Default()) - endif -endfunction - -" Generate runs 'go generate' in similar fashion to go#cmd#Build() -function! go#cmd#Generate(bang, ...) abort - let default_makeprg = &makeprg - - " :make expands '%' and '#' wildcards, so they must also be escaped - let goargs = go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1) - if go#util#ShellError() != 0 - let &makeprg = "go generate " . goargs - else - let gofiles = go#util#Shelljoin(go#tool#Files(), 1) - let &makeprg = "go generate " . goargs . ' ' . gofiles - endif - - let l:status = { - \ 'desc': 'current status', - \ 'type': 'generate', - \ 'state': "started", - \ } - call go#statusline#Update(expand('%:p:h'), l:status) - - if go#config#EchoCommandInfo() - call go#util#EchoProgress('generating ...') - endif - - let l:listtype = go#list#Type("GoGenerate") - - try - if l:listtype == "locationlist" - silent! exe 'lmake!' - else - silent! exe 'make!' - endif - finally - redraw! - let &makeprg = default_makeprg - endtry - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) - if !empty(errors) - let l:status.status = 'failed' - if !a:bang - call go#list#JumpToFirst(l:listtype) - endif - else - let l:status.status = 'success' - if go#config#EchoCommandInfo() - redraws! - call go#util#EchoSuccess('[generate] SUCCESS') - endif - endif - call go#statusline#Update(expand(':%:p:h'), l:status) -endfunction - -function! s:runerrorformat() - let l:panicaddress = "%\\t%#%f:%l +0x%[0-9A-Fa-f]%\\+" - let l:errorformat = '%A' . l:panicaddress . "," . &errorformat - return l:errorformat -endfunction - -" s:expandRunArgs expands arguments for go#cmd#Run according to the -" documentation of :GoRun. When val is a readable file, it is expanded to the -" full path so that go run can be executed in the current buffer's directory. -" val is return unaltered otherwise to support non-file arguments to go run. -function! s:expandRunArgs(idx, val) abort - let l:val = expand(a:val) - if !filereadable(l:val) - return l:val - endif - - return fnamemodify(l:val, ':p')") -endfunction -" --------------------- -" | Vim job callbacks | -" --------------------- - -function! s:cmd_job(args) abort - " autowrite is not enabled for jobs - call go#cmd#autowrite() - - call go#job#Spawn(a:args.cmd, a:args) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/cmd_test.vim b/vim-config/plugins/vim-go/autoload/go/cmd_test.vim deleted file mode 100644 index 708a3ab9..00000000 --- a/vim-config/plugins/vim-go/autoload/go/cmd_test.vim +++ /dev/null @@ -1,38 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_GoBuildErrors() - try - let l:filename = 'cmd/bad.go' - let l:tmp = gotest#load_fixture(l:filename) - exe 'cd ' . l:tmp . '/src/cmd' - - " set the compiler type so that the errorformat option will be set - " correctly. - compiler go - - let expected = [{'lnum': 4, 'bufnr': bufnr('%'), 'col': 2, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'undefined: notafunc'}] - " clear the quickfix lists - call setqflist([], 'r') - - call go#cmd#Build(1) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, l:expected) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/complete.vim b/vim-config/plugins/vim-go/autoload/go/complete.vim deleted file mode 100644 index b256e8cf..00000000 --- a/vim-config/plugins/vim-go/autoload/go/complete.vim +++ /dev/null @@ -1,67 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" go#complete#GoInfo returns the description of the identifier under the -" cursor. -function! go#complete#GetInfo() abort - return go#lsp#GetInfo() -endfunction - -function! go#complete#Complete(findstart, base) abort - if !go#config#GoplsEnabled() - return -3 - endif - - let l:state = {'done': 0, 'matches': [], 'start': -1} - - function! s:handler(state, start, matches) abort dict - let a:state.start = a:start - let a:state.matches = a:matches - let a:state.done = 1 - endfunction - - "findstart = 1 when we need to get the start of the match - if a:findstart == 1 - let [l:line, l:col] = getpos('.')[1:2] - let [l:line, l:col] = go#lsp#lsp#Position(l:line, l:col) - let l:completion = go#lsp#Completion(expand('%:p'), l:line, l:col, funcref('s:handler', [l:state])) - if l:completion - return -3 - endif - - while !l:state.done - sleep 10m - endwhile - - if len(l:state.matches) == 0 - " no matches. cancel and leave completion mode. - call go#util#EchoInfo("no matches") - return -3 - endif - - let s:completions = l:state.matches - - return go#lsp#lsp#PositionOf(getline(l:line+1), l:state.start-1) - - else "findstart = 0 when we need to return the list of completions - return s:completions - endif -endfunction - -function! go#complete#ToggleAutoTypeInfo() abort - if go#config#AutoTypeInfo() - call go#config#SetAutoTypeInfo(0) - call go#util#EchoProgress("auto type info disabled") - else - call go#config#SetAutoTypeInfo(1) - call go#util#EchoProgress("auto type info enabled") - endif - call go#auto#update_autocmd() -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/complete_test.vim b/vim-config/plugins/vim-go/autoload/go/complete_test.vim deleted file mode 100644 index ee00056c..00000000 --- a/vim-config/plugins/vim-go/autoload/go/complete_test.vim +++ /dev/null @@ -1,29 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_GetInfo_gopls() - let g:go_info_mode = 'gopls' - call s:getinfo() - unlet g:go_info_mode -endfunction - -func! s:getinfo() - let l:filename = 'complete/complete.go' - let l:tmp = gotest#load_fixture(l:filename) - try - call cursor(8, 3) - - let expected = 'func Example(s string)' - let actual = go#complete#GetInfo() - call assert_equal(expected, actual) - finally - call delete(l:tmp, 'rf') - endtry -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/config.vim b/vim-config/plugins/vim-go/autoload/go/config.vim deleted file mode 100644 index f6c28fc0..00000000 --- a/vim-config/plugins/vim-go/autoload/go/config.vim +++ /dev/null @@ -1,579 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#config#AutodetectGopath() abort - return get(g:, 'go_autodetect_gopath', 0) -endfunction - -function! go#config#ListTypeCommands() abort - return get(g:, 'go_list_type_commands', {}) -endfunction - -function! go#config#VersionWarning() abort - return get(g:, 'go_version_warning', 1) -endfunction - -function! go#config#BuildTags() abort - return get(g:, 'go_build_tags', '') -endfunction - -function! go#config#SetBuildTags(value) abort - if a:value is '' - silent! unlet g:go_build_tags - call go#lsp#ResetWorkspaceDirectories() - return - endif - - let g:go_build_tags = a:value - call go#lsp#ResetWorkspaceDirectories() -endfunction - -function! go#config#TestTimeout() abort - return get(g:, 'go_test_timeout', '10s') -endfunction - -function! go#config#TestShowName() abort - return get(g:, 'go_test_show_name', 0) -endfunction - -function! go#config#TermHeight() abort - return get(g:, 'go_term_height', winheight(0)) -endfunction - -function! go#config#TermWidth() abort - return get(g:, 'go_term_width', winwidth(0)) -endfunction - -function! go#config#TermMode() abort - return get(g:, 'go_term_mode', 'vsplit') -endfunction - -function! go#config#TermCloseOnExit() abort - return get(g:, 'go_term_close_on_exit', 1) -endfunction - -function! go#config#SetTermCloseOnExit(value) abort - let g:go_term_close_on_exit = a:value -endfunction - -function! go#config#TermEnabled() abort - " nvim always support - " vim will support if terminal feature exists - let l:support = has('nvim') || has('terminal') - return support && get(g:, 'go_term_enabled', 0) -endfunction - -function! go#config#SetTermEnabled(value) abort - let g:go_term_enabled = a:value -endfunction - -function! go#config#TemplateUsePkg() abort - return get(g:, 'go_template_use_pkg', 0) -endfunction - -function! go#config#TemplateTestFile() abort - return get(g:, 'go_template_test_file', "hello_world_test.go") -endfunction - -function! go#config#TemplateFile() abort - return get(g:, 'go_template_file', "hello_world.go") -endfunction - -function! go#config#StatuslineDuration() abort - return get(g:, 'go_statusline_duration', 60000) -endfunction - -function! go#config#SnippetEngine() abort - let l:engine = get(g:, 'go_snippet_engine', 'automatic') - if l:engine is? "automatic" - if get(g:, 'did_plugin_ultisnips') is 1 - let l:engine = 'ultisnips' - elseif get(g:, 'loaded_neosnippet') is 1 - let l:engine = 'neosnippet' - elseif get(g:, 'loaded_minisnip') is 1 - let l:engine = 'minisnip' - endif - endif - - return l:engine -endfunction - -function! go#config#PlayBrowserCommand() abort - if go#util#IsWin() - let go_play_browser_command = '!start rundll32 url.dll,FileProtocolHandler %URL%' - elseif go#util#IsMac() - let go_play_browser_command = 'open %URL%' - elseif executable('xdg-open') - let go_play_browser_command = 'xdg-open %URL%' - elseif executable('firefox') - let go_play_browser_command = 'firefox %URL% &' - elseif executable('chromium') - let go_play_browser_command = 'chromium %URL% &' - else - let go_play_browser_command = '' - endif - - return get(g:, 'go_play_browser_command', go_play_browser_command) -endfunction - -function! go#config#MetalinterDeadline() abort - " gometalinter has a default deadline of 5 seconds only when asynchronous - " jobs are not supported. - - let deadline = '5s' - if go#util#has_job() && has('lambda') - let deadline = '' - endif - - return get(g:, 'go_metalinter_deadline', deadline) -endfunction - -function! go#config#ListType() abort - return get(g:, 'go_list_type', '') -endfunction - -function! go#config#ListAutoclose() abort - return get(g:, 'go_list_autoclose', 1) -endfunction - -function! go#config#InfoMode() abort - return get(g:, 'go_info_mode', 'gopls') -endfunction - -function! go#config#GuruScope() abort - let scope = get(g:, 'go_guru_scope', []) - - if !empty(scope) - " strip trailing slashes for each path in scope. bug: - " https://github.com/golang/go/issues/14584 - let scopes = go#util#StripTrailingSlash(scope) - endif - - return scope -endfunction - -function! go#config#SetGuruScope(scope) abort - if empty(a:scope) - if exists('g:go_guru_scope') - unlet g:go_guru_scope - endif - else - let g:go_guru_scope = a:scope - endif -endfunction - -function! go#config#EchoCommandInfo() abort - return get(g:, 'go_echo_command_info', 1) -endfunction - -function! go#config#DocUrl() abort - let godoc_url = get(g:, 'go_doc_url', 'https://godoc.org') - if godoc_url isnot 'https://godoc.org' - " strip last '/' character if available - let last_char = strlen(godoc_url) - 1 - if godoc_url[last_char] == '/' - let godoc_url = strpart(godoc_url, 0, last_char) - endif - " custom godoc installations expect /pkg before package names - let godoc_url .= "/pkg" - endif - return godoc_url -endfunction - -function! go#config#DocPopupWindow() abort - return get(g:, 'go_doc_popup_window', 0) -endfunction -function! go#config#DefReuseBuffer() abort - return get(g:, 'go_def_reuse_buffer', 0) -endfunction - -function! go#config#DefMode() abort - return get(g:, 'go_def_mode', 'gopls') -endfunction - -function! go#config#DeclsIncludes() abort - return get(g:, 'go_decls_includes', 'func,type') -endfunction - -function! go#config#Debug() abort - return get(g:, 'go_debug', []) -endfunction - -function! go#config#DebugWindows() abort - return get(g:, 'go_debug_windows', { - \ 'vars': 'leftabove 30vnew', - \ 'stack': 'leftabove 20new', - \ 'goroutines': 'botright 10new', - \ 'out': 'botright 5new', - \ } - \ ) - -endfunction - -function! go#config#DebugAddress() abort - return get(g:, 'go_debug_address', '127.0.0.1:8181') -endfunction - -function! go#config#DebugCommands() abort - " make sure g:go_debug_commands is set so that it can be added to easily. - let g:go_debug_commands = get(g:, 'go_debug_commands', []) - return g:go_debug_commands -endfunction - -function! go#config#DebugLogOutput() abort - return get(g:, 'go_debug_log_output', 'debugger,rpc') -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 - -function! go#config#AutoSameids() abort - return get(g:, 'go_auto_sameids', 0) -endfunction - -function! go#config#SetAutoSameids(value) abort - let g:go_auto_sameids = a:value -endfunction - -function! go#config#AddtagsTransform() abort - return get(g:, 'go_addtags_transform', "snakecase") -endfunction - -function! go#config#AddtagsSkipUnexported() abort - return get(g:, 'go_addtags_skip_unexported', 0) -endfunction - -function! go#config#TemplateAutocreate() abort - return get(g:, "go_template_autocreate", 1) -endfunction - -function! go#config#SetTemplateAutocreate(value) abort - let g:go_template_autocreate = a:value -endfunction - -function! go#config#MetalinterCommand() abort - return get(g:, "go_metalinter_command", "golangci-lint") -endfunction - -function! go#config#MetalinterAutosaveEnabled() abort - 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 - 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#GolintBin() abort - return get(g:, "go_golint_bin", "golint") -endfunction - -function! go#config#ErrcheckBin() abort - return get(g:, "go_errcheck_bin", "errcheck") -endfunction - -function! go#config#MetalinterAutosave() abort - return get(g:, "go_metalinter_autosave", 0) -endfunction - -function! go#config#SetMetalinterAutosave(value) abort - let g:go_metalinter_autosave = a:value -endfunction - -function! go#config#ListHeight() abort - return get(g:, "go_list_height", 0) -endfunction - -function! go#config#FmtAutosave() abort - return get(g:, "go_fmt_autosave", 1) -endfunction - -function! go#config#ImportsAutosave() abort - return get(g:, 'go_imports_autosave', 0) -endfunction - -function! go#config#SetFmtAutosave(value) abort - let g:go_fmt_autosave = a:value -endfunction - -function! go#config#AsmfmtAutosave() abort - return get(g:, "go_asmfmt_autosave", 0) -endfunction - -function! go#config#SetAsmfmtAutosave(value) abort - let g:go_asmfmt_autosave = a:value -endfunction - -function! go#config#ModFmtAutosave() abort - return get(g:, "go_mod_fmt_autosave", 1) -endfunction - -function! go#config#SetModFmtAutosave(value) abort - let g:go_mod_fmt_autosave = a:value -endfunction - -function! go#config#DocMaxHeight() abort - return get(g:, "go_doc_max_height", 20) -endfunction - -function! go#config#AutoTypeInfo() abort - return get(g:, "go_auto_type_info", 0) -endfunction - -function! go#config#SetAutoTypeInfo(value) abort - let g:go_auto_type_info = a:value -endfunction - -function! go#config#AlternateMode() abort - return get(g:, "go_alternate_mode", "edit") -endfunction - -function! go#config#DeclsMode() abort - return get(g:, "go_decls_mode", "") -endfunction - -function! go#config#FmtCommand() abort - return get(g:, "go_fmt_command", "gofmt") -endfunction - -function! go#config#ImportsMode() abort - return get(g:, "go_imports_mode", "goimports") -endfunction - -function! go#config#FmtOptions() abort - return get(b:, "go_fmt_options", get(g:, "go_fmt_options", {})) -endfunction - -function! go#config#FmtFailSilently() abort - return get(g:, "go_fmt_fail_silently", 0) -endfunction - -function! go#config#FmtExperimental() abort - return get(g:, "go_fmt_experimental", 0 ) -endfunction - -function! go#config#PlayOpenBrowser() abort - return get(g:, "go_play_open_browser", 1) -endfunction - -function! go#config#RenameCommand() abort - " delegate to go#config#GorenameBin for backwards compatability. - return get(g:, "go_rename_command", go#config#GorenameBin()) -endfunction - -function! go#config#GorenameBin() abort - return get(g:, "go_gorename_bin", "gorename") -endfunction - -function! go#config#GorenamePrefill() abort - return get(g:, "go_gorename_prefill", 'expand("") =~# "^[A-Z]"' . - \ '? go#util#pascalcase(expand(""))' . - \ ': go#util#camelcase(expand(""))') -endfunction - -function! go#config#TextobjIncludeFunctionDoc() abort - return get(g:, "go_textobj_include_function_doc", 1) -endfunction - -function! go#config#TextobjIncludeVariable() abort - return get(g:, "go_textobj_include_variable", 1) -endfunction - -function! go#config#BinPath() abort - return get(g:, "go_bin_path", "") -endfunction - -function! go#config#SearchBinPathFirst() abort - return get(g:, 'go_search_bin_path_first', 1) -endfunction - -function! go#config#HighlightArrayWhitespaceError() abort - return get(g:, 'go_highlight_array_whitespace_error', 0) -endfunction - -function! go#config#HighlightChanWhitespaceError() abort - return get(g:, 'go_highlight_chan_whitespace_error', 0) -endfunction - -function! go#config#HighlightExtraTypes() abort - return get(g:, 'go_highlight_extra_types', 0) -endfunction - -function! go#config#HighlightSpaceTabError() abort - return get(g:, 'go_highlight_space_tab_error', 0) -endfunction - -function! go#config#HighlightTrailingWhitespaceError() abort - return get(g:, 'go_highlight_trailing_whitespace_error', 0) -endfunction - -function! go#config#HighlightOperators() abort - return get(g:, 'go_highlight_operators', 0) -endfunction - -function! go#config#HighlightFunctions() abort - return get(g:, 'go_highlight_functions', 0) -endfunction - -function! go#config#HighlightFunctionParameters() abort - " fallback to highlight_function_arguments for backwards compatibility - return get(g:, 'go_highlight_function_parameters', get(g:, 'go_highlight_function_arguments', 0)) -endfunction - -function! go#config#HighlightFunctionCalls() abort - return get(g:, 'go_highlight_function_calls', 0) -endfunction - -function! go#config#HighlightFields() abort - return get(g:, 'go_highlight_fields', 0) -endfunction - -function! go#config#HighlightTypes() abort - return get(g:, 'go_highlight_types', 0) -endfunction - -function! go#config#HighlightBuildConstraints() abort - return get(g:, 'go_highlight_build_constraints', 0) -endfunction - -function! go#config#HighlightStringSpellcheck() abort - return get(g:, 'go_highlight_string_spellcheck', 1) -endfunction - -function! go#config#HighlightFormatStrings() abort - return get(g:, 'go_highlight_format_strings', 1) -endfunction - -function! go#config#HighlightGenerateTags() abort - return get(g:, 'go_highlight_generate_tags', 0) -endfunction - -function! go#config#HighlightVariableAssignments() abort - return get(g:, 'go_highlight_variable_assignments', 0) -endfunction - -function! go#config#HighlightVariableDeclarations() abort - return get(g:, 'go_highlight_variable_declarations', 0) -endfunction - -function! go#config#HighlightDiagnosticErrors() abort - return get(g:, 'go_highlight_diagnostic_errors', 1) -endfunction - -function! go#config#HighlightDiagnosticWarnings() abort - return get(g:, 'go_highlight_diagnostic_warnings', 1) -endfunction - -function! go#config#HighlightDebug() abort - return get(g:, 'go_highlight_debug', 1) -endfunction - -function! go#config#DebugBreakpointSignText() abort - return get(g:, 'go_debug_breakpoint_sign_text', '>') -endfunction - -function! go#config#FoldEnable(...) abort - if a:0 > 0 - return index(go#config#FoldEnable(), a:1) > -1 - endif - return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment']) -endfunction - -function! go#config#EchoGoInfo() abort - return get(g:, "go_echo_go_info", 1) -endfunction - -function! go#config#CodeCompletionEnabled() abort - return get(g:, "go_code_completion_enabled", 1) -endfunction - -function! go#config#Updatetime() abort - let go_updatetime = get(g:, 'go_updatetime', 800) - return go_updatetime == 0 ? &updatetime : go_updatetime -endfunction - -function! go#config#ReferrersMode() abort - return get(g:, 'go_referrers_mode', 'gopls') -endfunction - -function! go#config#ImplementsMode() abort - return get(g:, 'go_implements_mode', 'guru') -endfunction - -function! go#config#GoplsCompleteUnimported() abort - return get(g:, 'go_gopls_complete_unimported', v:null) -endfunction - -function! go#config#GoplsDeepCompletion() abort - return get(g:, 'go_gopls_deep_completion', v:null) -endfunction - -function! go#config#GoplsMatcher() abort - if !exists('g:go_gopls_matcher') && get(g:, 'g:go_gopls_fuzzy_matching', v:null) is 1 - return 'fuzzy' - endif - return get(g:, 'go_gopls_matcher', v:null) -endfunction - -function! go#config#GoplsStaticCheck() abort - return get(g:, 'go_gopls_staticcheck', v:null) -endfunction - -function! go#config#GoplsUsePlaceholders() abort - return get(g:, 'go_gopls_use_placeholders', v:null) -endfunction - -function! go#config#GoplsTempModfile() abort - return get(g:, 'go_gopls_temp_modfile', v:null) -endfunction - -function! go#config#GoplsAnalyses() abort - return get(g:, 'go_gopls_analyses', v:null) -endfunction - -function! go#config#GoplsLocal() abort - return get(g:, 'go_gopls_local', v:null) -endfunction - -function! go#config#GoplsEnabled() abort - return get(g:, 'go_gopls_enabled', 1) -endfunction - -function! go#config#DiagnosticsEnabled() abort - return get(g:, 'go_diagnostics_enabled', 0) -endfunction - -function! go#config#GoplsOptions() abort - return get(g:, 'go_gopls_options', []) -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 - unlet g:go_gorename_prefill -endif - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/config_test.vim b/vim-config/plugins/vim-go/autoload/go/config_test.vim deleted file mode 100644 index 6ac3eedd..00000000 --- a/vim-config/plugins/vim-go/autoload/go/config_test.vim +++ /dev/null @@ -1,107 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -func! Test_SetBuildTags() abort - if !go#util#has_job() - return - endif - - try - let g:go_def_mode = 'gopls' - let l:dir = 'test-fixtures/config/buildtags' - let l:jumpstart = [0, 4, 2, 0] - - execute 'e ' . printf('%s/buildtags.go', l:dir) - let l:jumpstartbuf = bufnr('') - - call setpos('.', [l:jumpstartbuf, l:jumpstart[1], l:jumpstart[2], 0]) - - let l:expectedfilename = printf('%s/foo.go', l:dir) - - let l:expected = [0, 5, 1, 0] - call assert_notequal(l:expected, l:jumpstart) - - call go#def#Jump('', 0) - - let l:start = reltime() - while getpos('.') != l:expected && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - call assert_equal(l:expectedfilename, bufname("%")) - call assert_equal(l:expected, getpos('.')) - - execute 'e ' . printf('%s/buildtags.go', l:dir) - - " prepare to wait for the workspace/configuration request - let g:go_debug=['lsp'] - - " set the build constraint - call go#config#SetBuildTags('constrained') - - " wait for the workspace/configuration request - let l:lsplog = getbufline('__GOLSP_LOG__', 1, '$') - let l:start = reltime() - while match(l:lsplog, 'workspace/configuration') == -1 && reltimefloat(reltime(l:start)) < 10 - sleep 50m - let l:lsplog = getbufline('__GOLSP_LOG__', 1, '$') - endwhile - unlet g:go_debug - " close the __GOLSP_LOG__ window - only - - " verify the cursor position within buildtags.go - call setpos('.', [l:jumpstartbuf, l:jumpstart[1], l:jumpstart[2], 0]) - call assert_equal(l:jumpstart, getpos('.')) - - let l:expectedfilename = printf('%s/constrainedfoo.go', l:dir) - let l:expected = [0, 6, 1, 0] - call assert_notequal(l:expected, l:jumpstart) - - call go#def#Jump('', 0) - - let l:start = reltime() - while getpos('.') != l:expected && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - call assert_equal(l:expectedfilename, bufname("%")) - call assert_equal(l:expected, getpos('.')) - - let l:lsplog = getbufline('__GOLSP_LOG__', 1, '$') - - finally - call go#config#SetBuildTags('') - unlet g:go_def_mode - endtry -endfunc - -func! Test_GoplsEnabled_Clear() abort - if !go#util#has_job() - return - endif - - try - let g:go_gopls_enabled = 0 - - let l:tmp = gotest#write_file('gopls_disabled.go', [ - \ 'package example', - \ '', - \ 'func Example() {', - \ "\tprintln(" . '"hello, world!")', - \ '}', - \ ] ) - - finally - unlet g:go_gopls_enabled - call delete(l:tmp, 'rf') - endtry -endfunc -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/coverage.vim b/vim-config/plugins/vim-go/autoload/go/coverage.vim deleted file mode 100644 index 01456e59..00000000 --- a/vim-config/plugins/vim-go/autoload/go/coverage.vim +++ /dev/null @@ -1,297 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:toggle = 0 - -" Buffer creates a new cover profile with 'go test -coverprofile' and changes -" the current buffers highlighting to show covered and uncovered sections of -" the code. If run again it clears the annotation. -function! go#coverage#BufferToggle(bang, ...) abort - if s:toggle - call go#coverage#Clear() - return - endif - - if a:0 == 0 - return call(function('go#coverage#Buffer'), [a:bang]) - endif - - return call(function('go#coverage#Buffer'), [a:bang] + a:000) -endfunction - -" Buffer creates a new cover profile with 'go test -coverprofile' and changes -" the current buffers highlighting to show covered and uncovered sections of -" the code. Calling it again reruns the tests and shows the last updated -" coverage. -function! go#coverage#Buffer(bang, ...) abort - - " check if the version of Vim being tested supports matchaddpos() - if !exists("*matchaddpos") - call go#util#EchoError("GoCoverage is not supported by your version of Vim.") - return -1 - endif - - " check if there is any test file, if not we just return - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd . fnameescape(expand("%:p:h")) - if empty(glob("*_test.go")) - call go#util#EchoError("no test files available") - return - endif - finally - execute cd . fnameescape(dir) - endtry - - let s:toggle = 1 - let l:tmpname = tempname() - - if go#util#has_job() - call s:coverage_job({ - \ 'cmd': ['go', 'test', '-tags', go#config#BuildTags(), '-coverprofile', l:tmpname] + a:000, - \ 'complete': function('s:coverage_callback', [l:tmpname]), - \ 'bang': a:bang, - \ 'for': 'GoTest', - \ 'statustype': 'coverage', - \ }) - return - endif - - if go#config#EchoCommandInfo() - call go#util#EchoProgress("testing...") - endif - - let args = [a:bang, 0, "-coverprofile", l:tmpname] - if a:0 - call extend(args, a:000) - endif - - let id = call('go#test#Test', args) - - if go#util#ShellError() == 0 - call go#coverage#overlay(l:tmpname) - endif - - call delete(l:tmpname) -endfunction - -" Clear clears and resets the buffer annotation matches -function! go#coverage#Clear() abort - call clearmatches() - - if exists("s:toggle") | let s:toggle = 0 | endif - - " remove the autocmd we defined - augroup vim-go-coverage - autocmd! * - augroup end -endfunction - -" Browser creates a new cover profile with 'go test -coverprofile' and opens -" a new HTML coverage page from that profile in a new browser -function! go#coverage#Browser(bang, ...) abort - let l:tmpname = tempname() - if go#util#has_job() - call s:coverage_job({ - \ 'cmd': ['go', 'test', '-tags', go#config#BuildTags(), '-coverprofile', l:tmpname], - \ 'complete': function('s:coverage_browser_callback', [l:tmpname]), - \ 'bang': a:bang, - \ 'for': 'GoTest', - \ 'statustype': 'coverage', - \ }) - return - endif - - let args = [a:bang, 0, "-coverprofile", l:tmpname] - if a:0 - call extend(args, a:000) - endif - - let id = call('go#test#Test', args) - - if go#util#ShellError() == 0 - call go#util#ExecInDir(['go', 'tool', 'cover', '-html=' . l:tmpname]) - endif - - call delete(l:tmpname) -endfunction - -" Parses a single line from the cover file generated via go test -coverprofile -" and returns a single coverage profile block. -function! go#coverage#parsegocoverline(line) abort - " file:startline.col,endline.col numstmt count - let mx = '\([^:]\+\):\(\d\+\)\.\(\d\+\),\(\d\+\)\.\(\d\+\)\s\(\d\+\)\s\(\d\+\)' - let tokens = matchlist(a:line, mx) - let ret = {} - let ret.file = tokens[1] - let ret.startline = str2nr(tokens[2]) - let ret.startcol = str2nr(tokens[3]) - let ret.endline = str2nr(tokens[4]) - let ret.endcol = str2nr(tokens[5]) - let ret.numstmt = tokens[6] - let ret.cnt = tokens[7] - return ret -endfunction - -" Generates matches to be added to matchaddpos for the given coverage profile -" block -function! go#coverage#genmatch(cov) abort - let color = 'goCoverageCovered' - if a:cov.cnt == 0 - let color = 'goCoverageUncover' - endif - - let matches = [] - - " if start and end are the same, also specify the byte length - " example: foo.go:92.2,92.65 1 0 - if a:cov.startline == a:cov.endline - call add(matches, { - \ 'group': color, - \ 'pos': [[a:cov.startline, a:cov.startcol, a:cov.endcol - a:cov.startcol]], - \ 'priority': 2, - \ }) - return matches - endif - - " add start columns. Because we don't know the length of the of - " the line, we assume it is at maximum 200 bytes. I know this is hacky, - " but that's only way of fixing the issue - call add(matches, { - \ 'group': color, - \ 'pos': [[a:cov.startline, a:cov.startcol, 200]], - \ 'priority': 2, - \ }) - - " and then the remaining lines - let start_line = a:cov.startline - while start_line < a:cov.endline - let start_line += 1 - call add(matches, { - \ 'group': color, - \ 'pos': [[start_line]], - \ 'priority': 2, - \ }) - endwhile - - " finally end columns - call add(matches, { - \ 'group': color, - \ 'pos': [[a:cov.endline, a:cov.endcol-1]], - \ 'priority': 2, - \ }) - - return matches -endfunction - -" Reads the given coverprofile file and annotates the current buffer -function! go#coverage#overlay(file) abort - if !filereadable(a:file) - return - endif - let lines = readfile(a:file) - - " cover mode, by default it's 'set'. Just here for debugging purposes - let mode = lines[0] - - " contains matches for matchaddpos() - let matches = [] - - " first mark all lines as goCoverageNormalText. We use a custom group to not - " interfere with other buffers highlightings. Because the priority is - " lower than the cover and uncover matches, it'll be overridden. - let cnt = 1 - while cnt <= line('$') - call add(matches, {'group': 'goCoverageNormalText', 'pos': [cnt], 'priority': 1}) - let cnt += 1 - endwhile - - let fname = expand('%') - - " when called for a _test.go file, run the coverage for the actuall file - " file - if fname =~# '^\f\+_test\.go$' - let l:root = split(fname, '_test.go$')[0] - let fname = l:root . ".go" - - if !filereadable(fname) - call go#util#EchoError("couldn't find ".fname) - return - endif - - " open the alternate file to show the coverage - exe ":edit ". fnamemodify(fname, ":p") - endif - - " cov.file includes only the filename itself, without full path - let fname = fnamemodify(fname, ":t") - - for line in lines[1:] - let cov = go#coverage#parsegocoverline(line) - - " TODO(arslan): for now only include the coverage for the current - " buffer - if fname != fnamemodify(cov.file, ':t') - continue - endif - - call extend(matches, go#coverage#genmatch(cov)) - endfor - - " clear the matches if we leave the buffer - augroup vim-go-coverage - autocmd! * - autocmd BufWinLeave call go#coverage#Clear() - augroup end - - for m in matches - call matchaddpos(m.group, m.pos) - endfor -endfunction - - -" --------------------- -" | Vim job callbacks | -" --------------------- -" -function s:coverage_job(args) - " autowrite is not enabled for jobs - call go#cmd#autowrite() - - let disabled_term = 0 - if go#config#TermEnabled() - let disabled_term = 1 - call go#config#SetTermEnabled(0) - endif - - call go#job#Spawn(a:args.cmd, a:args) - - if disabled_term - call go#config#SetTermEnabled(1) - endif -endfunction - -" coverage_callback is called when the coverage execution is finished -function! s:coverage_callback(coverfile, job, exit_status, data) - if a:exit_status == 0 - call go#coverage#overlay(a:coverfile) - endif - - call delete(a:coverfile) -endfunction - -function! s:coverage_browser_callback(coverfile, job, exit_status, data) - if a:exit_status == 0 - call go#util#ExecInDir(['go', 'tool', 'cover', '-html=' . a:coverfile]) - endif - - call delete(a:coverfile) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/debug.vim b/vim-config/plugins/vim-go/autoload/go/debug.vim deleted file mode 100644 index 065b3332..00000000 --- a/vim-config/plugins/vim-go/autoload/go/debug.vim +++ /dev/null @@ -1,1126 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -if !exists('s:state') - let s:state = { - \ 'rpcid': 1, - \ 'running': 0, - \ 'currentThread': {}, - \ 'localVars': {}, - \ 'functionArgs': {}, - \ 'message': [], - \} - - if go#util#HasDebug('debugger-state') - call go#config#SetDebugDiag(s:state) - endif -endif - -if !exists('s:start_args') - let s:start_args = [] -endif - -function! s:goroutineID() abort - return s:state['currentThread'].goroutineID -endfunction - -function! s:complete(job, exit_status, data) abort - let l:gotready = get(s:state, 'ready', 0) - " copy messages to a:data _only_ when dlv exited non-zero and it was never - " detected as ready (e.g. there was a compiler error). - if a:exit_status > 0 && !l:gotready - " copy messages to data so that vim-go's usual handling of errors from - " async jobs will occur. - call extend(a:data, s:state['message']) - endif - - " return early instead of clearing any variables when the current job is not - " a:job - if has_key(s:state, 'job') && s:state['job'] != a:job - return - endif - - if has_key(s:state, 'job') - call remove(s:state, 'job') - endif - - if has_key(s:state, 'ready') - call remove(s:state, 'ready') - endif - - if has_key(s:state, 'ch') - call remove(s:state, 'ch') - endif - - call s:clearState() -endfunction - -function! s:logger(prefix, ch, msg) abort - let l:cur_win = bufwinnr('') - let l:log_win = bufwinnr(bufnr('__GODEBUG_OUTPUT__')) - if l:log_win == -1 - return - endif - exe l:log_win 'wincmd w' - - try - setlocal modifiable - if getline(1) == '' - call setline('$', a:prefix . a:msg) - else - call append('$', a:prefix . a:msg) - endif - normal! G - setlocal nomodifiable - finally - exe l:cur_win 'wincmd w' - endtry -endfunction - -function! s:call_jsonrpc(method, ...) abort - if go#util#HasDebug('debugger-commands') - call go#util#EchoInfo('sending to dlv ' . a:method) - endif - - let l:args = a:000 - let s:state['rpcid'] += 1 - let l:req_json = json_encode({ - \ 'id': s:state['rpcid'], - \ 'method': a:method, - \ 'params': l:args, - \}) - - try - let l:ch = s:state['ch'] - if has('nvim') - call chansend(l:ch, l:req_json) - while len(s:state.data) == 0 - sleep 50m - if get(s:state, 'ready', 0) == 0 - return - endif - endwhile - let resp_json = s:state.data[0] - let s:state.data = s:state.data[1:] - else - call ch_sendraw(l:ch, req_json) - let l:resp_raw = ch_readraw(l:ch) - let resp_json = json_decode(l:resp_raw) - endif - - if go#util#HasDebug('debugger-commands') - let g:go_debug_commands = add(go#config#DebugCommands(), { - \ 'request': l:req_json, - \ 'response': l:resp_json, - \ }) - endif - - if type(l:resp_json) == v:t_dict && has_key(l:resp_json, 'error') && !empty(l:resp_json.error) - throw l:resp_json.error - endif - return l:resp_json - catch - throw substitute(v:exception, '^Vim', '', '') - endtry -endfunction - -" Update the location of the current breakpoint or line we're halted on based on -" response from dlv. -function! s:update_breakpoint(res) abort - if type(a:res) ==# type(v:null) - return - endif - - let state = a:res.result.State - if !has_key(state, 'currentThread') - return - endif - - let s:state['currentThread'] = state.currentThread - let bufs = filter(map(range(1, winnr('$')), '[v:val,bufname(winbufnr(v:val))]'), 'v:val[1]=~"\.go$"') - if len(bufs) == 0 - return - endif - - exe bufs[0][0] 'wincmd w' - let filename = state.currentThread.file - let linenr = state.currentThread.line - let oldfile = fnamemodify(expand('%'), ':p:gs!\\!/!') - if oldfile != filename - silent! exe 'edit' filename - endif - silent! exe 'norm!' linenr.'G' - silent! normal! zvzz - silent! sign unplace 9999 - silent! exe 'sign place 9999 line=' . linenr . ' name=godebugcurline file=' . filename -endfunction - -" Populate the stacktrace window. -function! s:show_stacktrace(res) abort - if type(a:res) isnot type({}) || !has_key(a:res, 'result') || empty(a:res.result) - return - endif - - let l:stack_win = bufwinnr(bufnr('__GODEBUG_STACKTRACE__')) - if l:stack_win == -1 - return - endif - - let l:cur_win = bufwinnr('') - exe l:stack_win 'wincmd w' - - try - setlocal modifiable - silent %delete _ - for i in range(len(a:res.result.Locations)) - let loc = a:res.result.Locations[i] - call setline(i+1, printf('%s - %s:%d', loc.function.name, fnamemodify(loc.file, ':p'), loc.line)) - endfor - finally - setlocal nomodifiable - exe l:cur_win 'wincmd w' - endtry -endfunction - -" Populate the variable window. -function! s:show_variables() abort - let l:var_win = bufwinnr(bufnr('__GODEBUG_VARIABLES__')) - if l:var_win == -1 - return - endif - - let l:cur_win = bufwinnr('') - exe l:var_win 'wincmd w' - - try - setlocal modifiable - silent %delete _ - - let v = [] - let v += ['# Local Variables'] - if type(get(s:state, 'localVars', [])) is type([]) - for c in s:state['localVars'] - let v += split(s:eval_tree(c, 0), "\n") - endfor - endif - - let v += [''] - let v += ['# Function Arguments'] - if type(get(s:state, 'functionArgs', [])) is type([]) - for c in s:state['functionArgs'] - let v += split(s:eval_tree(c, 0), "\n") - endfor - endif - - call setline(1, v) - finally - setlocal nomodifiable - exe l:cur_win 'wincmd w' - endtry -endfunction - -function! s:clearState() abort - let s:state['currentThread'] = {} - let s:state['localVars'] = {} - let s:state['functionArgs'] = {} - let s:state['message'] = [] - - silent! sign unplace 9999 -endfunction - -function! s:stop() abort - let l:res = s:call_jsonrpc('RPCServer.Detach', {'kill': v:true}) - - if has_key(s:state, 'job') - call go#job#Wait(s:state['job']) - - " while waiting, the s:complete may have already removed job from s:state. - if has_key(s:state, 'job') - call remove(s:state, 'job') - endif - endif - - if has_key(s:state, 'ready') - call remove(s:state, 'ready') - endif - - if has_key(s:state, 'ch') - call remove(s:state, 'ch') - endif - - call s:clearState() -endfunction - -function! go#debug#Stop() abort - " Remove all commands and add back the default commands. - for k in map(split(execute('command GoDebug'), "\n")[1:], 'matchstr(v:val, "^\\s*\\zs\\S\\+")') - exe 'delcommand' k - endfor - command! -nargs=* -complete=customlist,go#package#Complete GoDebugStart call go#debug#Start(0, ) - command! -nargs=* -complete=customlist,go#package#Complete GoDebugTest call go#debug#Start(1, ) - command! -nargs=? GoDebugBreakpoint call go#debug#Breakpoint() - - " Remove all mappings. - for k in map(split(execute('map (go-debug-'), "\n")[1:], 'matchstr(v:val, "^n\\s\\+\\zs\\S\\+")') - exe 'unmap' k - endfor - - call s:stop() - - let bufs = filter(map(range(1, winnr('$')), '[v:val,bufname(winbufnr(v:val))]'), 'v:val[1]=~"\.go$"') - if len(bufs) > 0 - exe bufs[0][0] 'wincmd w' - else - wincmd p - endif - silent! exe bufwinnr(bufnr('__GODEBUG_STACKTRACE__')) 'wincmd c' - silent! exe bufwinnr(bufnr('__GODEBUG_VARIABLES__')) 'wincmd c' - silent! exe bufwinnr(bufnr('__GODEBUG_OUTPUT__')) 'wincmd c' - silent! exe bufwinnr(bufnr('__GODEBUG_GOROUTINES__')) 'wincmd c' - - if has('balloon_eval') - let &ballooneval=s:ballooneval - let &balloonexpr=s:balloonexpr - endif - - augroup vim-go-debug - autocmd! - augroup END - augroup! vim-go-debug -endfunction - -function! s:goto_file() abort - let m = matchlist(getline('.'), ' - \(.*\):\([0-9]\+\)$') - if m[1] == '' - return - endif - let bufs = filter(map(range(1, winnr('$')), '[v:val,bufname(winbufnr(v:val))]'), 'v:val[1]=~"\.go$"') - if len(bufs) == 0 - return - endif - exe bufs[0][0] 'wincmd w' - let filename = m[1] - let linenr = m[2] - let oldfile = fnamemodify(expand('%'), ':p:gs!\\!/!') - if oldfile != filename - silent! exe 'edit' filename - endif - silent! exe 'norm!' linenr.'G' - silent! normal! zvzz -endfunction - -function! s:delete_expands() - let nr = line('.') - while 1 - let l = getline(nr+1) - if empty(l) || l =~ '^\S' - return - endif - silent! exe (nr+1) . 'd _' - endwhile - silent! exe 'norm!' nr.'G' -endfunction - -function! s:expand_var() abort - " Get name from struct line. - let name = matchstr(getline('.'), '^[^:]\+\ze: \*\?[a-zA-Z0-9-_/\.]\+\({\.\.\.}\)\?$') - " Anonymous struct - if name == '' - let name = matchstr(getline('.'), '^[^:]\+\ze: \*\?struct {.\{-}}$') - endif - - if name != '' - setlocal modifiable - let not_open = getline(line('.')+1) !~ '^ ' - let l = line('.') - call s:delete_expands() - - if not_open - call append(l, split(s:eval(name), "\n")[1:]) - endif - silent! exe 'norm!' l.'G' - setlocal nomodifiable - return - endif - - " Expand maps - let m = matchlist(getline('.'), '^[^:]\+\ze: map.\{-}\[\(\d\+\)\]$') - if len(m) > 0 && m[1] != '' - setlocal modifiable - let not_open = getline(line('.')+1) !~ '^ ' - let l = line('.') - call s:delete_expands() - if not_open - " TODO: Not sure how to do this yet... Need to get keys of the map. - " let vs = '' - " for i in range(0, min([10, m[1]-1])) - " let vs .= ' ' . s:eval(printf("%s[%s]", m[0], )) - " endfor - " call append(l, split(vs, "\n")) - endif - - silent! exe 'norm!' l.'G' - setlocal nomodifiable - return - endif - - " Expand string. - let m = matchlist(getline('.'), '^\([^:]\+\)\ze: \(string\)\[\([0-9]\+\)\]\(: .\{-}\)\?$') - if len(m) > 0 && m[1] != '' - setlocal modifiable - let not_open = getline(line('.')+1) !~ '^ ' - let l = line('.') - call s:delete_expands() - - if not_open - let vs = '' - for i in range(0, min([10, m[3]-1])) - let vs .= ' ' . s:eval(m[1] . '[' . i . ']') - endfor - call append(l, split(vs, "\n")) - endif - - silent! exe 'norm!' l.'G' - setlocal nomodifiable - return - endif - - " Expand slice. - let m = matchlist(getline('.'), '^\([^:]\+\)\ze: \(\[\]\w\{-}\)\[\([0-9]\+\)\]$') - if len(m) > 0 && m[1] != '' - setlocal modifiable - let not_open = getline(line('.')+1) !~ '^ ' - let l = line('.') - call s:delete_expands() - - if not_open - let vs = '' - for i in range(0, min([10, m[3]-1])) - let vs .= ' ' . s:eval(m[1] . '[' . i . ']') - endfor - call append(l, split(vs, "\n")) - endif - silent! exe 'norm!' l.'G' - setlocal nomodifiable - return - endif -endfunction - -function! s:start_cb() abort - let l:winid = win_getid() - silent! only! - - let winnum = bufwinnr(bufnr('__GODEBUG_STACKTRACE__')) - if winnum != -1 - return - endif - - let debugwindows = go#config#DebugWindows() - if has_key(debugwindows, "vars") && debugwindows['vars'] != '' - exe 'silent ' . debugwindows['vars'] - silent file `='__GODEBUG_VARIABLES__'` - setlocal buftype=nofile bufhidden=wipe nomodified nobuflisted noswapfile nowrap nonumber nocursorline - setlocal filetype=godebugvariables - call append(0, ["# Local Variables", "", "# Function Arguments"]) - nmap :call expand_var() - nmap q (go-debug-stop) - endif - - if has_key(debugwindows, "stack") && debugwindows['stack'] != '' - exe 'silent ' . debugwindows['stack'] - silent file `='__GODEBUG_STACKTRACE__'` - setlocal buftype=nofile bufhidden=wipe nomodified nobuflisted noswapfile nowrap nonumber nocursorline - setlocal filetype=godebugstacktrace - nmap :call goto_file() - nmap q (go-debug-stop) - endif - - if has_key(debugwindows, "goroutines") && debugwindows['goroutines'] != '' - exe 'silent ' . debugwindows['goroutines'] - silent file `='__GODEBUG_GOROUTINES__'` - setlocal buftype=nofile bufhidden=wipe nomodified nobuflisted noswapfile nowrap nonumber nocursorline - setlocal filetype=godebugvariables - call append(0, ["# Goroutines"]) - nmap :call go#debug#Goroutine() - endif - - if has_key(debugwindows, "out") && debugwindows['out'] != '' - exe 'silent ' . debugwindows['out'] - silent file `='__GODEBUG_OUTPUT__'` - setlocal buftype=nofile bufhidden=wipe nomodified nobuflisted noswapfile nowrap nonumber nocursorline - setlocal filetype=godebugoutput - nmap q (go-debug-stop) - endif - call win_gotoid(l:winid) - - silent! delcommand GoDebugStart - silent! delcommand GoDebugTest - command! -nargs=0 GoDebugContinue call go#debug#Stack('continue') - command! -nargs=0 GoDebugNext call go#debug#Stack('next') - command! -nargs=0 GoDebugStep call go#debug#Stack('step') - command! -nargs=0 GoDebugStepOut call go#debug#Stack('stepOut') - command! -nargs=0 GoDebugRestart call go#debug#Restart() - command! -nargs=0 GoDebugStop call go#debug#Stop() - command! -nargs=* GoDebugSet call go#debug#Set() - command! -nargs=1 GoDebugPrint call go#debug#Print() - - nnoremap (go-debug-breakpoint) :call go#debug#Breakpoint() - nnoremap (go-debug-next) :call go#debug#Stack('next') - nnoremap (go-debug-step) :call go#debug#Stack('step') - nnoremap (go-debug-stepout) :call go#debug#Stack('stepOut') - nnoremap (go-debug-continue) :call go#debug#Stack('continue') - nnoremap (go-debug-stop) :call go#debug#Stop() - nnoremap (go-debug-print) :call go#debug#Print(expand('')) - - if has('balloon_eval') - let s:balloonexpr=&balloonexpr - let s:ballooneval=&ballooneval - - set balloonexpr=go#debug#BalloonExpr() - set ballooneval - endif - - augroup vim-go-debug - autocmd! * - autocmd FileType go nmap (go-debug-continue) - autocmd FileType go nmap (go-debug-print) - autocmd FileType go nmap (go-debug-breakpoint) - autocmd FileType go nmap (go-debug-next) - autocmd FileType go nmap (go-debug-step) - augroup END - doautocmd vim-go-debug FileType go -endfunction - -function! s:err_cb(ch, msg) abort - if get(s:state, 'ready', 0) != 0 - call s:logger('ERR: ', a:ch, a:msg) - return - endif - - let s:state['message'] += [a:msg] -endfunction - -function! s:out_cb(ch, msg) abort - if get(s:state, 'ready', 0) != 0 - call s:logger('OUT: ', a:ch, a:msg) - return - endif - - let s:state['message'] += [a:msg] - - if stridx(a:msg, go#config#DebugAddress()) != -1 - if has('nvim') - let s:state['data'] = [] - let l:state = {'databuf': ''} - - " explicitly bind callback to state so that within it, self will - " always refer to state. See :help Partial for more information. - let l:state.on_data = function('s:on_data', [], l:state) - let l:ch = sockconnect('tcp', go#config#DebugAddress(), {'on_data': l:state.on_data, 'state': l:state}) - if l:ch == 0 - call go#util#EchoError("could not connect to debugger") - call go#job#Stop(s:state['job']) - return - endif - else - let l:ch = ch_open(go#config#DebugAddress(), {'mode': 'raw', 'timeout': 20000}) - if ch_status(l:ch) !=# 'open' - call go#util#EchoError("could not connect to debugger") - call go#job#Stop(s:state['job']) - return - endif - endif - - let s:state['ch'] = l:ch - - " After this block executes, Delve will be running with all the - " breakpoints setup, so this callback doesn't have to run again; just log - " future messages. - let s:state['ready'] = 1 - - " replace all the breakpoints set before delve started so that the ids won't overlap. - let l:breakpoints = s:list_breakpoints() - for l:bt in s:list_breakpoints() - exe 'sign unplace '. l:bt.id - call go#debug#Breakpoint(l:bt.line, l:bt.file) - endfor - - call s:start_cb() - endif -endfunction - -function! s:on_data(ch, data, event) dict abort - let l:data = self.databuf - for l:msg in a:data - let l:data .= l:msg - endfor - - try - let l:res = json_decode(l:data) - let s:state['data'] = add(s:state['data'], l:res) - let self.databuf = '' - catch - " there isn't a complete message in databuf: buffer l:data and try - " again when more data comes in. - let self.databuf = l:data - finally - endtry -endfunction - -" Start the debug mode. The first argument is the package name to compile and -" debug, anything else will be passed to the running program. -function! go#debug#Start(is_test, ...) abort - call go#cmd#autowrite() - - if !go#util#has_job() - call go#util#EchoError('This feature requires either Vim 8.0.0087 or newer with +job or Neovim.') - return - endif - - " It's already running. - if has_key(s:state, 'job') - return s:state['job'] - endif - - let s:start_args = [a:is_test] + a:000 - - if go#util#HasDebug('debugger-state') - call go#config#SetDebugDiag(s:state) - endif - - let dlv = go#path#CheckBinPath("dlv") - if empty(dlv) - return - endif - - try - let l:cmd = [ - \ dlv, - \ (a:is_test ? 'test' : 'debug'), - \] - - " append the package when it's given. - if len(a:000) > 0 - let l:pkgname = a:1 - if l:pkgname[0] == '.' - let l:pkgabspath = fnamemodify(l:pkgname, ':p') - - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd' - let l:dir = getcwd() - execute l:cd fnameescape(expand('%:p:h')) - - try - let l:pkgname = go#package#FromPath(l:pkgabspath) - if type(l:pkgname) == type(0) - call go#util#EchoError('could not determine package name') - return - endif - finally - execute l:cd fnameescape(l:dir) - endtry - endif - - let l:cmd += [l:pkgname] - endif - - let l:cmd += [ - \ '--output', tempname(), - \ '--headless', - \ '--api-version', '2', - \ '--listen', go#config#DebugAddress(), - \] - let l:debugLogOutput = go#config#DebugLogOutput() - if l:debugLogOutput != '' - let cmd += ['--log', '--log-output', l:debugLogOutput] - endif - - let l:buildtags = go#config#BuildTags() - if buildtags isnot '' - let l:cmd += ['--build-flags', '--tags=' . buildtags] - endif - - if len(a:000) > 1 - let l:cmd += ['--'] + a:000[1:] - endif - - let s:state['message'] = [] - let l:opts = { - \ 'for': 'GoDebug', - \ 'statustype': 'debug', - \ 'complete': function('s:complete'), - \ } - let l:opts = go#job#Options(l:opts) - let l:opts.out_cb = function('s:out_cb') - let l:opts.err_cb = function('s:err_cb') - let l:opts.stoponexit = 'kill' - - let s:state['job'] = go#job#Start(l:cmd, l:opts) - catch - call go#util#EchoError(v:exception) - endtry - - return s:state['job'] -endfunction - -" Translate a reflect kind constant to a human string. -function! s:reflect_kind(k) - " Kind constants from Go's reflect package. - return [ - \ 'Invalid Kind', - \ 'Bool', - \ 'Int', - \ 'Int8', - \ 'Int16', - \ 'Int32', - \ 'Int64', - \ 'Uint', - \ 'Uint8', - \ 'Uint16', - \ 'Uint32', - \ 'Uint64', - \ 'Uintptr', - \ 'Float32', - \ 'Float64', - \ 'Complex64', - \ 'Complex128', - \ 'Array', - \ 'Chan', - \ 'Func', - \ 'Interface', - \ 'Map', - \ 'Ptr', - \ 'Slice', - \ 'String', - \ 'Struct', - \ 'UnsafePointer', - \ ][a:k] -endfunction - -function! s:eval_tree(var, nest) abort - if a:var.name =~ '^\~' - return '' - endif - let nest = a:nest - let v = '' - let kind = s:reflect_kind(a:var.kind) - if !empty(a:var.name) - let v .= repeat(' ', nest) . a:var.name . ': ' - - if kind == 'Bool' - let v .= printf("%s\n", a:var.value) - - elseif kind == 'Struct' - " Anonymous struct - if a:var.type[:8] == 'struct { ' - let v .= printf("%s\n", a:var.type) - else - let v .= printf("%s{...}\n", a:var.type) - endif - - elseif kind == 'String' - let v .= printf("%s[%d]%s\n", a:var.type, a:var.len, - \ len(a:var.value) > 0 ? ': ' . a:var.value : '') - - elseif kind == 'Slice' || kind == 'String' || kind == 'Map' || kind == 'Array' - let v .= printf("%s[%d]\n", a:var.type, a:var.len) - - elseif kind == 'Chan' || kind == 'Func' || kind == 'Interface' - let v .= printf("%s\n", a:var.type) - - elseif kind == 'Ptr' - " TODO: We can do something more useful here. - let v .= printf("%s\n", a:var.type) - - elseif kind == 'Complex64' || kind == 'Complex128' - let v .= printf("%s%s\n", a:var.type, a:var.value) - - " Int, Float - else - let v .= printf("%s(%s)\n", a:var.type, a:var.value) - endif - else - let nest -= 1 - endif - - if index(['Chan', 'Complex64', 'Complex128'], kind) == -1 && a:var.type != 'error' - for c in a:var.children - let v .= s:eval_tree(c, nest+1) - endfor - endif - return v -endfunction - -function! s:eval(arg) abort - try - let l:res = s:call_jsonrpc('RPCServer.State') - let l:res = s:call_jsonrpc('RPCServer.Eval', { - \ 'expr': a:arg, - \ 'scope': {'GoroutineID': l:res.result.State.currentThread.goroutineID} - \ }) - return s:eval_tree(l:res.result.Variable, 0) - catch - call go#util#EchoError(v:exception) - return '' - endtry -endfunction - -function! go#debug#BalloonExpr() abort - silent! let l:v = s:eval(v:beval_text) - return l:v -endfunction - -function! go#debug#Print(arg) abort - try - echo substitute(s:eval(a:arg), "\n$", "", 0) - catch - call go#util#EchoError(v:exception) - endtry -endfunction - -function! s:update_goroutines() abort - try - let l:res = s:call_jsonrpc('RPCServer.State') - let l:currentGoroutineID = 0 - try - if type(l:res) is type({}) && has_key(l:res, 'result') && !empty(l:res['result']) - let l:currentGoroutineID = l:res["result"]["State"]["currentGoroutine"]["id"] - endif - catch - call go#util#EchoWarning("current goroutine not found...") - endtry - - let l:res = s:call_jsonrpc('RPCServer.ListGoroutines') - call s:show_goroutines(l:currentGoroutineID, l:res) - catch - call go#util#EchoError(v:exception) - endtry - endfunction - -function! s:show_goroutines(currentGoroutineID, res) abort - let l:goroutines_winid = bufwinid('__GODEBUG_GOROUTINES__') - if l:goroutines_winid == -1 - return - endif - - let l:winid = win_getid() - call win_gotoid(l:goroutines_winid) - - try - setlocal modifiable - silent %delete _ - - let v = ['# Goroutines'] - - if type(a:res) isnot type({}) || !has_key(a:res, 'result') || empty(a:res['result']) - call setline(1, v) - return - endif - - let l:goroutines = a:res["result"]["Goroutines"] - if len(l:goroutines) == 0 - call go#util#EchoWarning("No Goroutines Running Now...") - call setline(1, v) - return - endif - - for l:idx in range(len(l:goroutines)) - let l:goroutine = l:goroutines[l:idx] - let l:goroutineType = "" - let l:loc = 0 - if l:goroutine.startLoc.file != "" - let l:loc = l:goroutine.startLoc - let l:goroutineType = "Start" - endif - if l:goroutine.goStatementLoc.file != "" - let l:loc = l:goroutine.goStatementLoc - let l:goroutineType = "Go" - endif - if l:goroutine.currentLoc.file != "" - let l:loc = l:goroutine.currentLoc - let l:goroutineType = "Runtime" - endif - if l:goroutine.userCurrentLoc.file != "" - let l:loc=l:goroutine.userCurrentLoc - let l:goroutineType = "User" - endif - - " The current goroutine can be changed by pressing enter on one of the - " lines listing a non-active goroutine. If the format of either of these - " lines is modified, then make sure that go#debug#Goroutine is also - " changed if needed. - if l:goroutine.id == a:currentGoroutineID - let l:g = printf("* Goroutine %s - %s: %s:%s %s (thread: %s)", l:goroutine.id, l:goroutineType, l:loc.file, l:loc.line, l:loc.function.name, l:goroutine.threadID) - else - let l:g = printf(" Goroutine %s - %s: %s:%s %s (thread: %s)", l:goroutine.id, l:goroutineType, l:loc.file, l:loc.line, l:loc.function.name, l:goroutine.threadID) - endif - let v += [l:g] - endfor - - call setline(1, v) - finally - setlocal nomodifiable - call win_gotoid(l:winid) - endtry -endfunction - -function! s:update_variables() abort - " FollowPointers requests pointers to be automatically dereferenced. - " MaxVariableRecurse is how far to recurse when evaluating nested types. - " MaxStringLen is the maximum number of bytes read from a string - " MaxArrayValues is the maximum number of elements read from an array, a slice or a map. - " MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields. - let l:cfg = { - \ 'scope': {'GoroutineID': s:goroutineID()}, - \ 'cfg': {'MaxStringLen': 20, 'MaxArrayValues': 20} - \ } - - try - let res = s:call_jsonrpc('RPCServer.ListLocalVars', l:cfg) - - let s:state['localVars'] = {} - if type(l:res) is type({}) && has_key(l:res, 'result') && !empty(l:res.result) - let s:state['localVars'] = l:res.result['Variables'] - endif - catch - call go#util#EchoError(v:exception) - endtry - - try - let res = s:call_jsonrpc('RPCServer.ListFunctionArgs', l:cfg) - let s:state['functionArgs'] = {} - if type(l:res) is type({}) && has_key(l:res, 'result') && !empty(l:res.result) - let s:state['functionArgs'] = res.result['Args'] - endif - catch - call go#util#EchoError(v:exception) - endtry - - call s:show_variables() -endfunction - -function! go#debug#Set(symbol, value) abort - try - let l:res = s:call_jsonrpc('RPCServer.State') - call s:call_jsonrpc('RPCServer.Set', { - \ 'symbol': a:symbol, - \ 'value': a:value, - \ 'scope': {'GoroutineID': l:res.result.State.currentThread.goroutineID} - \ }) - catch - call go#util#EchoError(v:exception) - endtry - - call s:update_variables() -endfunction - -function! s:update_stacktrace() abort - try - let l:res = s:call_jsonrpc('RPCServer.Stacktrace', {'id': s:goroutineID(), 'depth': 5}) - call s:show_stacktrace(l:res) - catch - call go#util#EchoError(v:exception) - endtry -endfunction - -function! s:stack_cb(res) abort - let s:stack_name = '' - - if type(a:res) isnot type({}) || !has_key(a:res, 'result') || empty(a:res.result) - return - endif - - call s:update_breakpoint(a:res) - call s:update_goroutines() - call s:update_stacktrace() - call s:update_variables() -endfunction - -" Send a command to change the cursor location to Delve. -" -" a:name must be one of continue, next, step, or stepOut. -function! go#debug#Stack(name) abort - let l:name = a:name - - " Run continue if the program hasn't started yet. - if s:state.running is 0 - let s:state.running = 1 - let l:name = 'continue' - endif - - " Add a breakpoint to the main.Main if the user didn't define any. - if len(s:list_breakpoints()) is 0 - if go#debug#Breakpoint() isnot 0 - let s:state.running = 0 - return - endif - endif - - try - " TODO: document why this is needed. - if l:name is# 'next' && get(s:, 'stack_name', '') is# 'next' - call s:call_jsonrpc('RPCServer.CancelNext') - endif - let s:stack_name = l:name - try - let l:res = s:call_jsonrpc('RPCServer.Command', {'name': l:name}) - - if l:name is# 'next' - let l:res2 = l:res - let l:w = 0 - while l:w < 1 - if l:res2.result.State.NextInProgress == v:true - let l:res2 = s:call_jsonrpc('RPCServer.Command', {'name': 'continue'}) - else - break - endif - endwhile - endif - call s:stack_cb(l:res) - catch - call go#util#EchoError(v:exception) - call s:clearState() - call go#debug#Restart() - endtry - catch - call go#util#EchoError(v:exception) - endtry -endfunction - -function! go#debug#Restart() abort - call go#cmd#autowrite() - - try - call s:stop() - - let s:state = { - \ 'rpcid': 1, - \ 'running': 0, - \ 'currentThread': {}, - \ 'localVars': {}, - \ 'functionArgs': {}, - \ 'message': [], - \} - - call call('go#debug#Start', s:start_args) - catch - call go#util#EchoError(v:exception) - endtry -endfunction - -" Report if debugger mode is active. -function! s:isActive() - return len(s:state['message']) > 0 -endfunction - -" Change Goroutine -function! go#debug#Goroutine() abort - let l:goroutineID = substitute(getline('.'), '^ Goroutine \(.\{-1,\}\) - .*', '\1', 'g') - - if l:goroutineID <= 0 - return - endif - - try - let l:res = s:call_jsonrpc('RPCServer.Command', {'Name': 'switchGoroutine', 'GoroutineID': str2nr(l:goroutineID)}) - call s:stack_cb(l:res) - call go#util#EchoInfo("Switched goroutine to: " . l:goroutineID) - catch - call go#util#EchoError(v:exception) - endtry -endfunction - -" Toggle breakpoint. Returns 0 on success and 1 on failure. -function! go#debug#Breakpoint(...) abort - let l:filename = fnamemodify(expand('%'), ':p:gs!\\!/!') - let l:linenr = line('.') - - " Get line number from argument. - if len(a:000) > 0 - let l:linenr = str2nr(a:1) - if l:linenr is 0 - call go#util#EchoError('not a number: ' . a:1) - return 0 - endif - if len(a:000) > 1 - let l:filename = a:2 - endif - endif - - try - " Check if we already have a breakpoint for this line. - let l:found = {} - for l:bt in s:list_breakpoints() - if l:bt.file is# l:filename && l:bt.line is# l:linenr - let l:found = l:bt - break - endif - endfor - - " Remove breakpoint. - if type(l:found) == v:t_dict && !empty(l:found) - exe 'sign unplace '. l:found.id .' file=' . l:found.file - if s:isActive() - let res = s:call_jsonrpc('RPCServer.ClearBreakpoint', {'id': l:found.id}) - endif - " Add breakpoint. - else - if s:isActive() - let l:res = s:call_jsonrpc('RPCServer.CreateBreakpoint', {'Breakpoint': {'file': l:filename, 'line': l:linenr}}) - let l:bt = res.result.Breakpoint - exe 'sign place '. l:bt.id .' line=' . l:bt.line . ' name=godebugbreakpoint file=' . l:bt.file - else - let l:id = len(s:list_breakpoints()) + 1 - exe 'sign place ' . l:id . ' line=' . l:linenr . ' name=godebugbreakpoint file=' . l:filename - endif - endif - catch - call go#util#EchoError(v:exception) - return 1 - endtry - - return 0 -endfunction - -function! s:list_breakpoints() - " :sign place - " --- Signs --- - " Signs for a.go: - " line=15 id=2 name=godebugbreakpoint - " line=16 id=1 name=godebugbreakpoint - " Signs for a_test.go: - " line=6 id=3 name=godebugbreakpoint - - let l:signs = [] - let l:file = '' - for l:line in split(execute('sign place'), '\n')[1:] - if l:line =~# '^Signs for ' - let l:file = l:line[10:-2] - continue - endif - - if l:line !~# 'name=godebugbreakpoint' - continue - endif - - let l:sign = matchlist(l:line, '\vline\=(\d+) +id\=(\d+)') - call add(l:signs, { - \ 'id': l:sign[2], - \ 'file': fnamemodify(l:file, ':p'), - \ 'line': str2nr(l:sign[1]), - \ }) - endfor - - return l:signs -endfunction - -exe 'sign define godebugbreakpoint text='.go#config#DebugBreakpointSignText().' texthl=GoDebugBreakpoint' -sign define godebugcurline text== texthl=GoDebugCurrent linehl=GoDebugCurrent - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/debug_test.vim b/vim-config/plugins/vim-go/autoload/go/debug_test.vim deleted file mode 100644 index 36ba6b42..00000000 --- a/vim-config/plugins/vim-go/autoload/go/debug_test.vim +++ /dev/null @@ -1,114 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! Test_GoDebugStart_Empty() abort - call s:debug() -endfunction - -function! Test_GoDebugStart_RelativePackage() abort - call s:debug('./debug/debugmain') -endfunction - -function! Test_GoDebugStart_RelativePackage_NullModule() abort - call s:debug('./debug/debugmain', 1) -endfunction - -function! Test_GoDebugStart_Package() abort - call s:debug('debug/debugmain') -endfunction - -function! Test_GoDebugStart_Errors() abort - if !go#util#has_job() - return - endif - - try - let l:tmp = gotest#load_fixture('debug/compilerror/main.go') - - let l:expected = [ - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': '# debug/compilerror'}, - \ {'lnum': 6, 'bufnr': bufnr('%'), 'col': 22, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': ' syntax error: unexpected newline, expecting comma or )'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exit status 2'} - \] - call setqflist([], 'r') - - call assert_false(exists(':GoDebugStop')) - - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd' - execute l:cd . ' debug/compilerror' - - call go#debug#Start(0) - - let l:actual = getqflist() - let l:start = reltime() - while len(l:actual) == 0 && reltimefloat(reltime(l:start)) < 10 - sleep 100m - let l:actual = getqflist() - endwhile - - call gotest#assert_quickfix(l:actual, l:expected) - call assert_false(exists(':GoDebugStop')) - - finally - call delete(l:tmp, 'rf') - " clear the quickfix lists - call setqflist([], 'r') - endtry -endfunction - -" s:debug takes 2 optional arguments. The first is a package to debug. The -" second is a flag to indicate whether to reset GOPATH after -" gotest#load_fixture is called in order to test behavior outside of GOPATH. -function! s:debug(...) abort - if !go#util#has_job() - return - endif - - try - let $oldgopath = $GOPATH - let l:tmp = gotest#load_fixture('debug/debugmain/debugmain.go') - - if a:0 > 1 && a:2 == 1 - let $GOPATH = $oldgopath - endif - - call go#debug#Breakpoint(6) - - call assert_false(exists(':GoDebugStop')) - - if a:0 == 0 - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd' - execute l:cd . ' debug/debugmain' - let l:job = go#debug#Start(0) - else - let l:job = go#debug#Start(0, a:1) - endif - - let l:start = reltime() - while !exists(':GoDebugStop') && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - call assert_true(exists(':GoDebugStop')) - call gotest#assert_quickfix(getqflist(), []) - - call go#debug#Stop() - - if !has('nvim') - call assert_equal(job_status(l:job), 'dead') - endif - - call assert_false(exists(':GoDebugStop')) - - finally - call go#debug#Breakpoint(6) - call delete(l:tmp, 'rf') - endtry -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/decls.vim b/vim-config/plugins/vim-go/autoload/go/decls.vim deleted file mode 100644 index 15743187..00000000 --- a/vim-config/plugins/vim-go/autoload/go/decls.vim +++ /dev/null @@ -1,26 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#decls#Decls(mode, ...) abort - let decls_mode = go#config#DeclsMode() - if decls_mode == 'ctrlp' - call ctrlp#init(call("ctrlp#decls#cmd", [a:mode] + a:000)) - elseif decls_mode == 'fzf' - call call("fzf#decls#cmd", [a:mode] + a:000) - else - if globpath(&rtp, 'plugin/ctrlp.vim') != "" - call ctrlp#init(call("ctrlp#decls#cmd", [a:mode] + a:000)) - elseif globpath(&rtp, 'plugin/fzf.vim') != "" - call call("fzf#decls#cmd", [a:mode] + a:000) - else - call go#util#EchoError("neither ctrlp.vim nor fzf.vim are installed. Please install either one") - end - end -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/def.vim b/vim-config/plugins/vim-go/autoload/go/def.vim deleted file mode 100644 index 4943ba07..00000000 --- a/vim-config/plugins/vim-go/autoload/go/def.vim +++ /dev/null @@ -1,366 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:go_stack = [] -let s:go_stack_level = 0 - -function! go#def#Jump(mode, type) abort - let l:fname = fnamemodify(expand("%"), ':p:gs?\\?/?') - - " so guru right now is slow for some people. previously we were using - " godef which also has it's own quirks. But this issue come up so many - " times I've decided to support both. By default we still use guru as it - " covers all edge cases, but now anyone can switch to godef if they wish - let bin_name = go#config#DefMode() - if bin_name == 'godef' - let l:cmd = ['godef', - \ '-f=' . l:fname, - \ '-o=' . go#util#OffsetCursor(), - \ '-t'] - - if &modified - let l:stdin_content = join(go#util#GetLines(), "\n") - call add(l:cmd, "-i") - let [l:out, l:err] = go#util#ExecInDir(l:cmd, l:stdin_content) - else - let [l:out, l:err] = go#util#ExecInDir(l:cmd) - endif - elseif bin_name == 'guru' - let cmd = [go#path#CheckBinPath(bin_name)] - let buildtags = go#config#BuildTags() - if buildtags isnot '' - let cmd += ['-tags', buildtags] - endif - - let stdin_content = "" - - if &modified - let content = join(go#util#GetLines(), "\n") - let stdin_content = fname . "\n" . strlen(content) . "\n" . content - call add(cmd, "-modified") - endif - - call extend(cmd, ["definition", fname . ':#' . go#util#OffsetCursor()]) - - if go#util#has_job() - let l:state = {} - let l:spawn_args = { - \ 'cmd': cmd, - \ 'complete': function('s:jump_to_declaration_cb', [a:mode, bin_name], l:state), - \ 'for': '_', - \ 'statustype': 'searching declaration', - \ } - - if &modified - let l:spawn_args.input = stdin_content - endif - - call s:def_job(spawn_args, l:state) - return - endif - - if &modified - let [l:out, l:err] = go#util#ExecInDir(l:cmd, l:stdin_content) - else - let [l:out, l:err] = go#util#ExecInDir(l:cmd) - endif - elseif bin_name == 'gopls' - if !go#config#GoplsEnabled() - call go#util#EchoError("go_def_mode is 'gopls', but gopls is disabled") - return - endif - - " reset l:fname when using gopls so that the filename will be converted to - " a URI correctly on windows. - let l:fname = expand('%') - let [l:line, l:col] = go#lsp#lsp#Position() - " delegate to gopls, with an empty job object and an exit status of 0 - " (they're irrelevant for gopls). - if a:type - call go#lsp#TypeDef(l:fname, l:line, l:col, function('s:jump_to_declaration_cb', [a:mode, 'gopls', {}, 0])) - else - call go#lsp#Definition(l:fname, l:line, l:col, function('s:jump_to_declaration_cb', [a:mode, 'gopls', {}, 0])) - endif - return - else - call go#util#EchoError('go_def_mode value: '. bin_name .' is not valid. Valid values are: [godef, guru, gopls]') - return - endif - - if l:err - call go#util#EchoError(out) - return - endif - - call go#def#jump_to_declaration(out, a:mode, bin_name) -endfunction - -function! s:jump_to_declaration_cb(mode, bin_name, job, exit_status, data) abort dict - if a:exit_status != 0 - return - endif - - call go#def#jump_to_declaration(a:data[0], a:mode, a:bin_name) - - " capture the active window so that callbacks for jobs, exit_cb and - " close_cb, and callbacks for gopls can return to it when a:mode caused a - " split. - let self.winid = win_getid(winnr()) -endfunction - -" go#def#jump_to_declaration parses out (expected to be -" 'filename:line:col: message'). -function! go#def#jump_to_declaration(out, mode, bin_name) abort - let final_out = a:out - if a:bin_name == "godef" - " append the type information to the same line so it will be parsed - " correctly using guru's output format. - " This makes it compatible with guru output. - let final_out = join(split(a:out, '\n'), ':') - endif - - " strip line ending - let out = split(final_out, go#util#LineEnding())[0] - if go#util#IsWin() - let parts = split(out, '\(^[a-zA-Z]\)\@ 1 - let line = parts[1] - endif - if len(parts) > 2 - let col = parts[2] - endif - if len(parts) > 3 - let ident = parts[3] - endif - - " Remove anything newer than the current position, just like basic - " vim tag support - if s:go_stack_level == 0 - let s:go_stack = [] - else - let s:go_stack = s:go_stack[0:s:go_stack_level-1] - endif - - " increment the stack counter - let s:go_stack_level += 1 - - " push it on to the jumpstack - let stack_entry = {'line': line("."), 'col': col("."), 'file': expand('%:p'), 'ident': ident} - call add(s:go_stack, stack_entry) - - " needed for restoring back user setting this is because there are two - " modes of switchbuf which we need based on the split mode - let old_switchbuf = &switchbuf - - normal! m' - if filename != fnamemodify(expand("%"), ':p:gs?\\?/?') - " jump to existing buffer if, 1. we have enabled it, 2. the buffer is loaded - " and 3. there is buffer window number we switch to - if go#config#DefReuseBuffer() && bufwinnr(filename) != -1 - " jump to existing buffer if it exists - call win_gotoid(bufwinnr(filename)) - else - if &modified - let cmd = 'hide edit' - else - let cmd = 'edit' - endif - - if a:mode == "tab" - let &switchbuf = "useopen,usetab,newtab" - if bufloaded(filename) == 0 - tab split - else - let cmd = 'sbuf' - endif - elseif a:mode == "split" - split - elseif a:mode == "vsplit" - vsplit - endif - - " open the file and jump to line and column - try - exec cmd fnameescape(fnamemodify(filename, ':.')) - catch - if stridx(v:exception, ':E325:') < 0 - call go#util#EchoError(v:exception) - endif - endtry - endif - endif - call cursor(line, col) - - " also align the line to middle of the view - normal! zz - - let &switchbuf = old_switchbuf -endfunction - -function! go#def#SelectStackEntry() abort - let target_window = go#ui#GetReturnWindow() - if empty(target_window) - let target_window = winnr() - endif - - let highlighted_stack_entry = matchstr(getline("."), '^..\zs\(\d\+\)') - if !empty(highlighted_stack_entry) - execute target_window . "wincmd w" - call go#def#Stack(str2nr(highlighted_stack_entry)) - endif - - call go#ui#CloseWindow() -endfunction - -function! go#def#StackUI() abort - if len(s:go_stack) == 0 - call go#util#EchoError("godef stack empty") - return - endif - - let stackOut = ['" ,:navigate :jump ,q:exit'] - - let i = 0 - while i < len(s:go_stack) - let entry = s:go_stack[i] - let prefix = "" - - if i == s:go_stack_level - let prefix = ">" - else - let prefix = " " - endif - - call add(stackOut, printf("%s %d %s|%d col %d|%s", - \ prefix, i+1, entry["file"], entry["line"], entry["col"], entry["ident"])) - let i += 1 - endwhile - - if s:go_stack_level == i - call add(stackOut, "> ") - endif - - call go#ui#OpenWindow("GoDef Stack", stackOut, "godefstack") - - noremap :call go#def#SelectStackEntry() - noremap :call go#ui#CloseWindow() - noremap q :call go#ui#CloseWindow() -endfunction - -function! go#def#StackClear(...) abort - let s:go_stack = [] - let s:go_stack_level = 0 -endfunction - -function! go#def#StackPop(...) abort - if len(s:go_stack) == 0 - call go#util#EchoError("godef stack empty") - return - endif - - if s:go_stack_level == 0 - call go#util#EchoError("at bottom of the godef stack") - return - endif - - if !len(a:000) - let numPop = 1 - else - let numPop = a:1 - endif - - let newLevel = str2nr(s:go_stack_level) - str2nr(numPop) - call go#def#Stack(newLevel + 1) -endfunction - -function! go#def#Stack(...) abort - if len(s:go_stack) == 0 - call go#util#EchoError("godef stack empty") - return - endif - - if !len(a:000) - " Display interactive stack - call go#def#StackUI() - return - else - let jumpTarget = a:1 - endif - - if jumpTarget !~ '^\d\+$' - if jumpTarget !~ '^\s*$' - call go#util#EchoError("location must be a number") - endif - return - endif - - let jumpTarget = str2nr(jumpTarget) - 1 - - if jumpTarget >= 0 && jumpTarget < len(s:go_stack) - let s:go_stack_level = jumpTarget - let target = s:go_stack[s:go_stack_level] - - " jump - if expand('%:p') != target["file"] - if &modified - exec 'hide edit' target["file"] - else - exec 'edit' target["file"] - endif - endif - call cursor(target["line"], target["col"]) - normal! zz - else - call go#util#EchoError("invalid location. Try :GoDefStack to see the list of valid entries") - endif -endfunction - -function s:def_job(args, state) abort - let l:start_options = go#job#Options(a:args) - - let l:state = a:state - function! s:exit_cb(next, job, exitval) dict - call call(a:next, [a:job, a:exitval]) - if has_key(self, 'winid') - call win_gotoid(self.winid) - endif - endfunction - let l:start_options.exit_cb = funcref('s:exit_cb', [l:start_options.exit_cb], l:state) - - function! s:close_cb(next, ch) dict - call call(a:next, [a:ch]) - if has_key(self, 'winid') - call win_gotoid(self.winid) - endif - endfunction - let l:start_options.close_cb = funcref('s:close_cb', [l:start_options.close_cb], l:state) - - if &modified - let l:tmpname = tempname() - call writefile(split(a:args.input, "\n"), l:tmpname, "b") - let l:start_options.in_io = "file" - let l:start_options.in_name = l:tmpname - endif - - call go#job#Start(a:args.cmd, l:start_options) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/def_test.vim b/vim-config/plugins/vim-go/autoload/go/def_test.vim deleted file mode 100644 index 110d8c30..00000000 --- a/vim-config/plugins/vim-go/autoload/go/def_test.vim +++ /dev/null @@ -1,223 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -func! Test_jump_to_declaration_guru() abort - try - let l:filename = 'def/jump.go' - let l:lnum = 5 - let l:col = 6 - let l:tmp = gotest#load_fixture(l:filename) - - let l:guru_out = printf("%s:%d:%d: defined here as func main", l:filename, l:lnum, l:col) - call go#def#jump_to_declaration(l:guru_out, "", 'guru') - - call assert_equal(l:filename, bufname("%")) - call assert_equal(l:lnum, getcurpos()[1]) - call assert_equal(l:col, getcurpos()[2]) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_jump_to_declaration_godef() abort - try - let l:filename = 'def/jump.go' - let l:lnum = 5 - let l:col = 6 - let l:tmp = gotest#load_fixture(l:filename) - - let l:godef_out = printf("%s:%d:%d\ndefined here as func main", l:filename, l:lnum, l:col) - call go#def#jump_to_declaration(godef_out, "", 'godef') - - call assert_equal(l:filename, bufname("%")) - call assert_equal(l:lnum, getcurpos()[1]) - call assert_equal(l:col, getcurpos()[2]) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_Jump_leaves_lists() abort - try - let l:filename = 'def/jump.go' - let l:tmp = gotest#load_fixture(l:filename) - - let l:expected = [{'lnum': 10, 'bufnr': bufnr('%'), 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'quux'}] - - call setloclist(0, copy(l:expected), 'r' ) - call setqflist(copy(l:expected), 'r' ) - - let l:bufnr = bufnr('%') - call cursor(6, 7) - - if !go#util#has_job() - let g:go_def_mode='godef' - endif - call go#def#Jump('', 0) - - if !go#util#has_job() - unlet g:go_def_mode - endif - - let l:start = reltime() - while bufnr('%') == l:bufnr && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - let l:actual = getloclist(0) - call gotest#assert_quickfix(l:actual, l:expected) - - let l:actual = getqflist() - call gotest#assert_quickfix(l:actual, l:expected) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_DefJump_gopls_simple_first() abort - if !go#util#has_job() - return - endif - - try - let g:go_def_mode = 'gopls' - - let l:tmp = gotest#write_file('simple/firstposition/firstposition.go', [ - \ 'package firstposition', - \ '', - \ 'func Example() {', - \ "\tid := " . '"foo"', - \ "\tprintln(" . '"id:", id)', - \ '}', - \ ] ) - - let l:expected = [0, 4, 2, 0] - - call assert_notequal(l:expected, getpos('.')) - - call go#def#Jump('', 0) - - let l:start = reltime() - while getpos('.') != l:expected && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - call assert_equal(l:expected, getpos('.')) - finally - call delete(l:tmp, 'rf') - unlet g:go_def_mode - endtry -endfunc - -func! Test_DefJump_gopls_simple_last() abort - if !go#util#has_job() - return - endif - - try - let g:go_def_mode = 'gopls' - - let l:tmp = gotest#write_file('simple/lastposition/lastposition.go', [ - \ 'package lastposition', - \ '', - \ 'func Example() {', - \ "\tid := " . '"foo"', - \ "\tprintln(" . '"id:", id)', - \ '}', - \ ] ) - - let l:expected = [0, 4, 2, 0] - - call assert_notequal(l:expected, getpos('.')) - - call go#def#Jump('', 0) - - let l:start = reltime() - while getpos('.') != l:expected && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - call assert_equal(l:expected, getpos('.')) - finally - call delete(l:tmp, 'rf') - unlet g:go_def_mode - endtry -endfunc - -func! Test_DefJump_gopls_MultipleCodeUnit_first() abort - if !go#util#has_job() - return - endif - - try - let g:go_def_mode = 'gopls' - - let l:tmp = gotest#write_file('multiplecodeunit/firstposition/firstposition.go', [ - \ 'package firstposition', - \ '', - \ 'func Example() {', - \ "\t𐐀, id := " . '"foo", "bar"', - \ "\tprintln(" . '"(𐐀, id):", 𐐀, id)', - \ '}', - \ ] ) - - let l:expected = [0, 4, 8, 0] - call assert_notequal(l:expected, getpos('.')) - - call go#def#Jump('', 0) - - let l:start = reltime() - while getpos('.') != l:expected && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - call assert_equal(l:expected, getpos('.')) - finally - call delete(l:tmp, 'rf') - unlet g:go_def_mode - endtry -endfunc - - -func! Test_DefJump_gopls_MultipleCodeUnit_last() abort - if !go#util#has_job() - return - endif - - try - let g:go_def_mode = 'gopls' - - let l:tmp = gotest#write_file('multiplecodeunit/lastposition/lastposition.go', [ - \ 'package lastposition', - \ '', - \ 'func Example() {', - \ "\t𐐀, id := " . '"foo", "bar"', - \ "\tprintln(" . '"(𐐀, id):", 𐐀, id)', - \ '}', - \ ] ) - - let l:expected = [0, 4, 8, 0] - call assert_notequal(l:expected, getpos('.')) - - call go#def#Jump('', 0) - - let l:start = reltime() - while getpos('.') != l:expected && reltimefloat(reltime(l:start)) < 10 - sleep 100m - endwhile - - call assert_equal(l:expected, getpos('.')) - finally - call delete(l:tmp, 'rf') - unlet g:go_def_mode - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/doc.vim b/vim-config/plugins/vim-go/autoload/go/doc.vim deleted file mode 100644 index 15f3b503..00000000 --- a/vim-config/plugins/vim-go/autoload/go/doc.vim +++ /dev/null @@ -1,210 +0,0 @@ -" Copyright 2011 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:buf_nr = -1 - -function! go#doc#OpenBrowser(...) abort - if len(a:000) == 0 - let [l:out, l:err] = go#lsp#DocLink() - if l:err - call go#util#EchoError(l:out) - return - endif - - if len(l:out) == 0 - call go#util#EchoWarning("could not path for doc URL") - endif - - let l:godoc_url = printf('%s/%s', go#config#DocUrl(), l:out) - - call go#util#OpenBrowser(l:godoc_url) - return - endif - - let pkgs = s:godocWord(a:000) - if empty(pkgs) - return - endif - - let pkg = pkgs[0] - let exported_name = pkgs[1] - - " example url: https://godoc.org/github.com/fatih/set#Set - let godoc_url = printf('%s/%s#%s', go#config#DocUrl(), pkg, exported_name) - call go#util#OpenBrowser(godoc_url) -endfunction - -function! go#doc#Open(newmode, mode, ...) abort - " With argument: run "godoc [arg]". - if len(a:000) - let [l:out, l:err] = go#util#Exec(['go', 'doc'] + a:000) - else " Without argument: use gopls to get documentation - let [l:out, l:err] = go#lsp#Doc() - endif - - if l:err - call go#util#EchoError(out) - return - endif - - call s:GodocView(a:newmode, a:mode, l:out) -endfunction - -function! s:GodocView(newposition, position, content) abort - " popup window - if go#config#DocPopupWindow() - if exists('*popup_atcursor') && exists('*popup_clear') - call popup_clear() - - call popup_atcursor(split(a:content, '\n'), { - \ 'padding': [1, 1, 1, 1], - \ 'borderchars': ['-','|','-','|','+','+','+','+'], - \ "border": [1, 1, 1, 1], - \ }) - elseif has('nvim') && exists('*nvim_open_win') - let lines = split(a:content, '\n') - let height = 0 - let width = 0 - for line in lines - let lw = strdisplaywidth(line) - if lw > width - let width = lw - endif - let height += 1 - endfor - let width += 1 " right margin - let max_height = go#config#DocMaxHeight() - if height > max_height - let height = max_height - endif - - let buf = nvim_create_buf(v:false, v:true) - call nvim_buf_set_lines(buf, 0, -1, v:true, lines) - let opts = { - \ 'relative': 'cursor', - \ 'row': 1, - \ 'col': 0, - \ 'width': width, - \ 'height': height, - \ 'style': 'minimal', - \ } - call nvim_open_win(buf, v:true, opts) - setlocal nomodified nomodifiable filetype=godoc - - " close easily with CR, Esc and q - noremap :close - noremap :close - noremap q :close - endif - return - endif - - " reuse existing buffer window if it exists otherwise create a new one - let is_visible = bufexists(s:buf_nr) && bufwinnr(s:buf_nr) != -1 - if !bufexists(s:buf_nr) - execute a:newposition - sil file `="[Godoc]"` - let s:buf_nr = bufnr('%') - elseif bufwinnr(s:buf_nr) == -1 - execute a:position - execute s:buf_nr . 'buffer' - elseif bufwinnr(s:buf_nr) != bufwinnr('%') - execute bufwinnr(s:buf_nr) . 'wincmd w' - endif - - " if window was not visible then resize it - if !is_visible - if a:position == "split" - " cap window height to 20, but resize it for smaller contents - let max_height = go#config#DocMaxHeight() - let content_height = len(split(a:content, "\n")) - if content_height > max_height - exe 'resize ' . max_height - else - exe 'resize ' . content_height - endif - else - " set a sane maximum width for vertical splits. In this case the minimum - " that fits the godoc for package http without extra linebreaks and line - " numbers on - exe 'vertical resize 84' - endif - endif - - setlocal filetype=godoc - setlocal bufhidden=delete - setlocal buftype=nofile - setlocal noswapfile - setlocal nobuflisted - setlocal nocursorline - setlocal nocursorcolumn - setlocal iskeyword+=: - setlocal iskeyword-=- - - setlocal modifiable - %delete _ - call append(0, split(a:content, "\n")) - sil $delete _ - setlocal nomodifiable - sil normal! gg - - " close easily with enter - noremap :close - noremap :close - " make sure any key that sends an escape as a prefix (e.g. the arrow keys) - " don't cause the window to close. - nnoremap [ [ -endfunction - -" returns the package and exported name. exported name might be empty. -" ie: fmt and Println -" ie: github.com/fatih/set and New -function! s:godocWord(args) abort - if !executable('godoc') - let msg = "godoc command not found." - let msg .= " install with: go get golang.org/x/tools/cmd/godoc" - call go#util#EchoWarning(msg) - return [] - endif - - if !len(a:args) - let oldiskeyword = &iskeyword - setlocal iskeyword+=. - let word = expand('') - let &iskeyword = oldiskeyword - let word = substitute(word, '[^a-zA-Z0-9\\/._~-]', '', 'g') - let words = split(word, '\.\ze[^./]\+$') - else - let words = a:args - endif - - if !len(words) - return [] - endif - - let pkg = words[0] - if len(words) == 1 - let exported_name = "" - else - let exported_name = words[1] - endif - - let packages = go#tool#Imports() - - if has_key(packages, pkg) - let pkg = packages[pkg] - endif - - return [pkg, exported_name] -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/fillstruct.vim b/vim-config/plugins/vim-go/autoload/go/fillstruct.vim deleted file mode 100644 index 1e406d75..00000000 --- a/vim-config/plugins/vim-go/autoload/go/fillstruct.vim +++ /dev/null @@ -1,72 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#fillstruct#FillStruct() abort - let l:cmd = ['fillstruct', - \ '-file', bufname(''), - \ '-offset', go#util#OffsetCursor(), - \ '-line', line('.')] - " Needs: https://github.com/davidrjenni/reftools/pull/14 - "\ '-tags', go#config#BuildTags()] - - " Read from stdin if modified. - if &modified - call add(l:cmd, '-modified') - let [l:out, l:err] = go#util#Exec(l:cmd, go#util#archive()) - else - let [l:out, l:err] = go#util#Exec(l:cmd) - endif - - if l:err - call go#util#EchoError(l:out) - return - endif - - try - let l:json = json_decode(l:out) - catch - call go#util#EchoError(l:out) - return - endtry - - " Output is array: - "[ - " {"start": 92, "end": 106, "code": "mail.Address{\n\tName: \"\",\n\tAddress: \"\",\n}"}, - " {...second struct...} - " ] - - let l:pos = getpos('.') - - try - for l:struct in l:json - let l:code = split(l:struct['code'], "\n") - - " Add any code before/after the struct. - exe l:struct['start'] . 'go' - let l:code[0] = getline('.')[:col('.')-1] . l:code[0] - exe l:struct['end'] . 'go' - let l:code[len(l:code)-1] .= getline('.')[col('.'):] - - " Indent every line except the first one; makes it look nice. - let l:indent = repeat("\t", indent('.') / &tabstop) - for l:i in range(1, len(l:code)-1) - let l:code[l:i] = l:indent . l:code[l:i] - endfor - - " Out with the old ... - exe 'normal! ' . l:struct['start'] . 'gov' . l:struct['end'] . 'gox' - " ... in with the new. - call setline('.', l:code[0]) - call append('.', l:code[1:]) - endfor - finally - call setpos('.', l:pos) - endtry -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/fillstruct_test.vim b/vim-config/plugins/vim-go/autoload/go/fillstruct_test.vim deleted file mode 100644 index 73ed0891..00000000 --- a/vim-config/plugins/vim-go/autoload/go/fillstruct_test.vim +++ /dev/null @@ -1,98 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_fillstruct() abort - try - let l:tmp = gotest#write_file('a/a.go', [ - \ 'package a', - \ 'import "net/mail"', - \ "var addr = mail.\x1fAddress{}"]) - - call go#fillstruct#FillStruct() - call gotest#assert_buffer(1, [ - \ 'var addr = mail.Address{', - \ '\tName: "",', - \ '\tAddress: "",', - \ '}']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_fillstruct_line() abort - try - let l:tmp = gotest#write_file('a/a.go', [ - \ 'package a', - \ 'import "net/mail"', - \ "\x1f" . 'var addr = mail.Address{}']) - - call go#fillstruct#FillStruct() - call gotest#assert_buffer(1, [ - \ 'var addr = mail.Address{', - \ '\tName: "",', - \ '\tAddress: "",', - \ '}']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_fillstruct_two_line() abort - try - let l:tmp = gotest#write_file('a/a.go', [ - \ 'package a', - \ 'import (', - \ '"fmt"', - \ '"net/mail"', - \ ')', - \ "\x1f" . 'func x() { fmt.Println(mail.Address{}, mail.Address{}) }']) - - call go#fillstruct#FillStruct() - call gotest#assert_buffer(1, [ - \ 'import (', - \ '"fmt"', - \ '"net/mail"', - \ ')', - \ 'func x() { fmt.Println(mail.Address{', - \ '\tName: "",', - \ '\tAddress: "",', - \ '}, mail.Address{', - \ '\tName: "",', - \ '\tAddress: "",', - \ '}) }']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_fillstruct_two_cursor() abort - try - let l:tmp = gotest#write_file('a/a.go', [ - \ 'package a', - \ 'import (', - \ '"fmt"', - \ '"net/mail"', - \ ')', - \ "func x() { fmt.Println(mail.Address{}, mail.Ad\x1fdress{}) }"]) - - call go#fillstruct#FillStruct() - call gotest#assert_buffer(1, [ - \ 'import (', - \ '"fmt"', - \ '"net/mail"', - \ ')', - \ 'func x() { fmt.Println(mail.Address{}, mail.Address{', - \ '\tName: "",', - \ '\tAddress: "",', - \ '}) }']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/fmt.vim b/vim-config/plugins/vim-go/autoload/go/fmt.vim deleted file mode 100644 index d3a7d92f..00000000 --- a/vim-config/plugins/vim-go/autoload/go/fmt.vim +++ /dev/null @@ -1,231 +0,0 @@ -" Copyright 2011 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" fmt.vim: Vim command to format Go files with gofmt (and gofmt compatible -" toorls, such as goimports). - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" we have those problems : -" http://stackoverflow.com/questions/12741977/prevent-vim-from-updating-its-undo-tree -" http://stackoverflow.com/questions/18532692/golang-formatter-and-vim-how-to-destroy-history-record?rq=1 -" -" The below function is an improved version that aims to fix all problems. -" it doesn't undo changes and break undo history. If you are here reading -" this and have VimL experience, please look at the function for -" improvements, patches are welcome :) -function! go#fmt#Format(withGoimport) abort - let l:bin_name = go#config#FmtCommand() - if a:withGoimport == 1 - let l:mode = go#config#ImportsMode() - if l:mode == 'gopls' - if !go#config#GoplsEnabled() - call go#util#EchoError("go_imports_mode is 'gopls', but gopls is disabled") - return - endif - call go#lsp#Imports() - return - endif - - let l:bin_name = 'goimports' - endif - - if l:bin_name == 'gopls' - if !go#config#GoplsEnabled() - call go#util#EchoError("go_def_mode is 'gopls', but gopls is disabled") - return - endif - call go#lsp#Format() - return - endif - - if go#config#FmtExperimental() - " Using winsaveview to save/restore cursor state has the problem of - " closing folds on save: - " https://github.com/fatih/vim-go/issues/502 - " One fix is to use mkview instead. Unfortunately, this sometimes causes - " other bad side effects: - " https://github.com/fatih/vim-go/issues/728 - " and still closes all folds if foldlevel>0: - " https://github.com/fatih/vim-go/issues/732 - let l:curw = {} - try - mkview! - catch - let l:curw = winsaveview() - endtry - - " save our undo file to be restored after we are done. This is needed to - " prevent an additional undo jump due to BufWritePre auto command and also - " restore 'redo' history because it's getting being destroyed every - " BufWritePre - let tmpundofile = tempname() - exe 'wundo! ' . tmpundofile - else - " Save cursor position and many other things. - let l:curw = winsaveview() - endif - - " Write current unsaved buffer to a temp file - let l:tmpname = tempname() . '.go' - call writefile(go#util#GetLines(), l:tmpname) - if go#util#IsWin() - let l:tmpname = tr(l:tmpname, '\', '/') - endif - - let current_col = col('.') - let [l:out, l:err] = go#fmt#run(l:bin_name, l:tmpname, expand('%')) - let line_offset = len(readfile(l:tmpname)) - line('$') - let l:orig_line = getline('.') - - if l:err == 0 - call go#fmt#update_file(l:tmpname, expand('%')) - elseif !go#config#FmtFailSilently() - let l:errors = s:replace_filename(expand('%'), out) - call go#fmt#ShowErrors(l:errors) - endif - - " We didn't use the temp file, so clean up - call delete(l:tmpname) - - if go#config#FmtExperimental() - " restore our undo history - silent! exe 'rundo ' . tmpundofile - call delete(tmpundofile) - - " Restore our cursor/windows positions, folds, etc. - if empty(l:curw) - silent! loadview - else - call winrestview(l:curw) - endif - else - " Restore our cursor/windows positions. - call winrestview(l:curw) - endif - - " be smart and jump to the line the new statement was added/removed and - " adjust the column within the line - let l:lineno = line('.') + line_offset - call cursor(l:lineno, current_col + (len(getline(l:lineno)) - len(l:orig_line))) - - " Syntax highlighting breaks less often. - syntax sync fromstart -endfunction - -" update_file updates the target file with the given formatted source -function! go#fmt#update_file(source, target) - " remove undo point caused via BufWritePre - try | silent undojoin | catch | endtry - - let old_fileformat = &fileformat - if exists("*getfperm") - " save file permissions - let original_fperm = getfperm(a:target) - endif - - call rename(a:source, a:target) - - " restore file permissions - if exists("*setfperm") && original_fperm != '' - call setfperm(a:target , original_fperm) - endif - - " reload buffer to reflect latest changes - silent edit! - - call go#lsp#DidChange(expand(a:target, ':p')) - - let &fileformat = old_fileformat - let &syntax = &syntax - - call go#fmt#CleanErrors() -endfunction - -" run runs the gofmt/goimport command for the given source file and returns -" the output of the executed command. Target is the real file to be formatted. -function! go#fmt#run(bin_name, source, target) - let l:cmd = s:fmt_cmd(a:bin_name, a:source, a:target) - if empty(l:cmd) - return - endif - return go#util#Exec(l:cmd) -endfunction - -" fmt_cmd returns the command to run as a list. -function! s:fmt_cmd(bin_name, source, target) - let l:cmd = [a:bin_name, '-w'] - - " add the options for binary (if any). go_fmt_options was by default of type - " string, however to allow customization it's now a dictionary of binary - " name mapping to options. - let opts = go#config#FmtOptions() - if type(opts) == type({}) - let opts = has_key(opts, a:bin_name) ? opts[a:bin_name] : "" - endif - call extend(cmd, split(opts, " ")) - if a:bin_name is# 'goimports' - call extend(cmd, ["-srcdir", a:target]) - endif - - call add(cmd, a:source) - return cmd -endfunction - -" replace_filename replaces the filename on each line of content with -" a:filename. -function! s:replace_filename(filename, content) abort - let l:errors = split(a:content, '\n') - - let l:errors = map(l:errors, printf('substitute(v:val, ''^.\{-}:'', ''%s:'', '''')', a:filename)) - return join(l:errors, "\n") -endfunction - -function! go#fmt#CleanErrors() abort - let l:listtype = go#list#Type("GoFmt") - - " clean up previous list - if l:listtype == "quickfix" - let l:list_title = getqflist({'title': 1}) - else - let l:list_title = getloclist(0, {'title': 1}) - endif - - if has_key(l:list_title, 'title') && (l:list_title['title'] == 'Format' || l:list_title['title'] == 'GoMetaLinterAutoSave') - call go#list#Clean(l:listtype) - endif -endfunction - -" show_errors opens a location list and shows the given errors. If errors is -" empty, it closes the the location list. -function! go#fmt#ShowErrors(errors) abort - let l:errorformat = '%f:%l:%c:\ %m' - let l:listtype = go#list#Type("GoFmt") - - call go#list#ParseFormat(l:listtype, l:errorformat, a:errors, 'Format', 0) - let l:errors = go#list#Get(l:listtype) - - " this closes the window if there are no errors or it opens - " it if there are any. - call go#list#Window(l:listtype, len(l:errors)) -endfunction - -function! go#fmt#ToggleFmtAutoSave() abort - if go#config#FmtAutosave() - call go#config#SetFmtAutosave(0) - call go#util#EchoProgress("auto fmt disabled") - return - end - - call go#config#SetFmtAutosave(1) - call go#util#EchoProgress("auto fmt enabled") -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/fmt_test.vim b/vim-config/plugins/vim-go/autoload/go/fmt_test.vim deleted file mode 100644 index b1b740ae..00000000 --- a/vim-config/plugins/vim-go/autoload/go/fmt_test.vim +++ /dev/null @@ -1,57 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_run_fmt() abort - let actual_file = tempname() - call writefile(readfile("test-fixtures/fmt/hello.go"), actual_file) - - let expected = join(readfile("test-fixtures/fmt/hello_golden.go"), "\n") - - " run our code - call go#fmt#run("gofmt", actual_file, "test-fixtures/fmt/hello.go") - - " this should now contain the formatted code - let actual = join(readfile(actual_file), "\n") - - call assert_equal(expected, actual) -endfunc - -func! Test_update_file() abort - let expected = join(readfile("test-fixtures/fmt/hello_golden.go"), "\n") - let source_file = tempname() - call writefile(readfile("test-fixtures/fmt/hello_golden.go"), source_file) - - let target_file = tempname() - call writefile([""], target_file) - - " update_file now - call go#fmt#update_file(source_file, target_file) - - " this should now contain the formatted code - let actual = join(readfile(target_file), "\n") - - call assert_equal(expected, actual) -endfunc - -func! Test_goimports() abort - let $GOPATH = 'test-fixtures/fmt/' - let actual_file = tempname() - call writefile(readfile("test-fixtures/fmt/src/imports/goimports.go"), actual_file) - - let expected = join(readfile("test-fixtures/fmt/src/imports/goimports_golden.go"), "\n") - - " run our code - call go#fmt#run("goimports", actual_file, "test-fixtures/fmt/src/imports/goimports.go") - - " this should now contain the formatted code - let actual = join(readfile(actual_file), "\n") - - call assert_equal(expected, actual) -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/guru.vim b/vim-config/plugins/vim-go/autoload/go/guru.vim deleted file mode 100644 index 91d5a654..00000000 --- a/vim-config/plugins/vim-go/autoload/go/guru.vim +++ /dev/null @@ -1,722 +0,0 @@ -" guru.vim -- Vim integration for the Go guru. - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" guru_cmd returns a dict that contains the command to execute guru. args -" is dict with following options: -" mode : guru mode, such as 'implements' -" format : output format, either 'plain' or 'json' -" needs_scope : if 1, adds the current package to the scope -" selected : if 1, means it's a range of selection, otherwise it picks up the -" offset under the cursor -" example output: -" {'cmd' : ['guru', '-json', 'implements', 'demo/demo.go:#66']} -function! s:guru_cmd(args) range abort - let mode = a:args.mode - let format = a:args.format - let needs_scope = a:args.needs_scope - let selected = a:args.selected - let postype = get(a:args, 'postype', 'cursor') - - let result = {} - - "return with a warning if the binary doesn't exist - let bin_path = go#path#CheckBinPath("guru") - if empty(bin_path) - return {'err': "bin path not found"} - endif - - " start constructing the command - let cmd = [bin_path, '-tags', go#config#BuildTags()] - - if &modified - let result.stdin_content = go#util#archive() - call add(cmd, "-modified") - endif - - " enable outputting in json format - if format == "json" - call add(cmd, "-json") - endif - - let scopes = go#config#GuruScope() - if empty(scopes) - " some modes require scope to be defined (such as callers). For these we - " choose a sensible setting, which is using the current file's package - if needs_scope - let pkg = go#package#ImportPath() - if pkg == -1 - return {'err': "current directory is not inside of a valid GOPATH"} - endif - let scopes = [pkg] - endif - endif - - " Add the scope. - if !empty(scopes) - " guru expect a comma-separated list of patterns. - let l:scope = join(scopes, ",") - let result.scope = l:scope - call extend(cmd, ["-scope", l:scope]) - endif - - if postype == 'balloon' - let pos = printf("#%s", go#util#Offset(v:beval_lnum, v:beval_col)) - else - let pos = printf("#%s", go#util#OffsetCursor()) - if selected != -1 - " means we have a range, get it - let pos1 = go#util#Offset(line("'<"), col("'<")) - let pos2 = go#util#Offset(line("'>"), col("'>")) - let pos = printf("#%s,#%s", pos1, pos2) - endif - endif - - let l:filename = fnamemodify(expand("%"), ':p:gs?\\?/?') . ':' . pos - call extend(cmd, [mode, l:filename]) - - let result.cmd = cmd - return result -endfunction - -" sync_guru runs guru in sync mode with the given arguments -function! s:sync_guru(args) abort - let result = s:guru_cmd(a:args) - if has_key(result, 'err') - call go#util#EchoError(result.err) - return -1 - endif - - if !has_key(a:args, 'disable_progress') - if a:args.needs_scope - call go#util#EchoProgress("analysing with scope ". result.scope . - \ " (see ':help go-guru-scope' if this doesn't work)...") - elseif a:args.mode !=# 'what' - " the query might take time, let us give some feedback - call go#util#EchoProgress("analysing ...") - endif - endif - - " run, forrest run!!! - if has_key(l:result, 'stdin_content') - let [l:out, l:err] = go#util#Exec(l:result.cmd, l:result.stdin_content) - else - let [l:out, l:err] = go#util#Exec(l:result.cmd) - endif - - if has_key(a:args, 'custom_parse') - call a:args.custom_parse(l:err, l:out, a:args.mode) - else - call s:parse_guru_output(l:err, l:out, a:args.mode) - endif - - return l:out -endfunc - -" async_guru runs guru in async mode with the given arguments -function! s:async_guru(args) abort - let result = s:guru_cmd(a:args) - if has_key(result, 'err') - call go#util#EchoError(result.err) - return - endif - - let state = { - \ 'mode': a:args.mode, - \ 'parse' : get(a:args, 'custom_parse', funcref("s:parse_guru_output")) - \ } - - " explicitly bind complete to state so that within it, self will - " always refer to state. See :help Partial for more information. - let state.complete = function('s:complete', [], state) - - let opts = { - \ 'statustype': get(a:args, 'statustype', a:args.mode), - \ 'for': '_', - \ 'errorformat': "%f:%l.%c-%[%^:]%#:\ %m,%f:%l:%c:\ %m", - \ 'complete': state.complete, - \ } - - if has_key(a:args, 'disable_progress') - let opts.statustype = '' - endif - - let opts = go#job#Options(l:opts) - - if has_key(result, 'stdin_content') - let l:tmpname = tempname() - call writefile(split(result.stdin_content, "\n"), l:tmpname, "b") - let l:opts.in_io = "file" - let l:opts.in_name = l:tmpname - endif - - call go#job#Start(result.cmd, opts) - - if a:args.needs_scope && go#config#EchoCommandInfo() && !has_key(a:args, 'disable_progress') - call go#util#EchoProgress("analysing with scope " . result.scope . - \ " (see ':help go-guru-scope' if this doesn't work)...") - endif -endfunc - -function! s:complete(job, exit_status, messages) dict abort - let output = join(a:messages, "\n") - call self.parse(a:exit_status, output, self.mode) -endfunction - -" run_guru runs the given guru argument -function! s:run_guru(args) abort - if go#util#has_job() - let res = s:async_guru(a:args) - else - let res = s:sync_guru(a:args) - endif - - return res -endfunction - -" Show 'implements' relation for selected package -function! go#guru#Implements(selected) abort - let args = { - \ 'mode': 'implements', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - call s:run_guru(args) -endfunction - -" Shows the set of possible objects to which a pointer may point. -function! go#guru#PointsTo(selected) abort - let l:args = { - \ 'mode': 'pointsto', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - call s:run_guru(l:args) -endfunction - -" Report the possible constants, global variables, and concrete types that may -" appear in a value of type error -function! go#guru#Whicherrs(selected) abort - let args = { - \ 'mode': 'whicherrs', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - - " TODO(arslan): handle empty case for both sync/async - " if empty(out.out) - " call go#util#EchoSuccess("no error variables found. Try to change the scope with :GoGuruScope") - " return - " endif - call s:run_guru(args) -endfunction - -" Describe selected syntax: definition, methods, etc -function! go#guru#Describe(selected) abort - let args = { - \ 'mode': 'describe', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - call s:run_guru(args) -endfunction - -function! go#guru#DescribeInfo(showstatus) abort - - " check if the version of Vim being tested supports json_decode() - if !exists("*json_decode") - call go#util#EchoError("GoDescribeInfo requires 'json_decode'. Update your Vim/Neovim version.") - return - endif - - let args = { - \ 'mode': 'describe', - \ 'format': 'json', - \ 'selected': -1, - \ 'needs_scope': 0, - \ 'custom_parse': function('s:info'), - \ 'disable_progress': a:showstatus == 0, - \ } - - call s:run_guru(args) -endfunction - -function! s:info(exit_val, output, mode) - if a:exit_val != 0 - return - endif - - if a:output[0] !=# '{' - return - endif - - if empty(a:output) || type(a:output) != type("") - return - endif - - let result = json_decode(a:output) - if type(result) != type({}) - call go#util#EchoError(printf("malformed output from guru: %s", a:output)) - return - endif - - if !has_key(result, 'detail') - " if there is no detail check if there is a description and print it - if has_key(result, "desc") - call go#util#EchoInfo(result["desc"]) - return - endif - - call go#util#EchoError("detail key is missing. Please open a bug report on vim-go repo.") - return - endif - - let detail = result['detail'] - let info = "" - - " guru gives different information based on the detail mode. Let try to - " extract the most useful information - - if detail == "value" - if !has_key(result, 'value') - call go#util#EchoError("value key is missing. Please open a bug report on vim-go repo.") - return - endif - - let val = result["value"] - if !has_key(val, 'type') - call go#util#EchoError("type key is missing (value.type). Please open a bug report on vim-go repo.") - return - endif - - let info = val["type"] - elseif detail == "type" - if !has_key(result, 'type') - call go#util#EchoError("type key is missing. Please open a bug report on vim-go repo.") - return - endif - - let type = result["type"] - if !has_key(type, 'type') - call go#util#EchoError("type key is missing (type.type). Please open a bug report on vim-go repo.") - return - endif - - let info = type["type"] - elseif detail == "package" - if !has_key(result, 'package') - call go#util#EchoError("package key is missing. Please open a bug report on vim-go repo.") - return - endif - - let package = result["package"] - if !has_key(package, 'path') - call go#util#EchoError("path key is missing (package.path). Please open a bug report on vim-go repo.") - return - endif - - let info = printf("package %s", package["path"]) - elseif detail == "unknown" - let info = result["desc"] - else - call go#util#EchoError(printf("unknown detail mode found '%s'. Please open a bug report on vim-go repo", detail)) - return - endif - - call go#util#ShowInfo(info) -endfunction - -" Show possible targets of selected function call -function! go#guru#Callees(selected) abort - let args = { - \ 'mode': 'callees', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - call s:run_guru(args) -endfunction - -" Show possible callers of selected function -function! go#guru#Callers(selected) abort - let args = { - \ 'mode': 'callers', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - call s:run_guru(args) -endfunction - -" Show path from callgraph root to selected function -function! go#guru#Callstack(selected) abort - let args = { - \ 'mode': 'callstack', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - call s:run_guru(args) -endfunction - -" Show free variables of selection -function! go#guru#Freevars(selected) abort - " Freevars requires a selection - if a:selected == -1 - call go#util#EchoError("GoFreevars requires a selection (range) of code") - return - endif - - let args = { - \ 'mode': 'freevars', - \ 'format': 'plain', - \ 'selected': 1, - \ 'needs_scope': 0, - \ } - - call s:run_guru(args) -endfunction - -" Show send/receive corresponding to selected channel op -function! go#guru#ChannelPeers(selected) abort - let args = { - \ 'mode': 'peers', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 1, - \ } - - call s:run_guru(args) -endfunction - -" Show all refs to entity denoted by selected identifier -function! go#guru#Referrers(selected) abort - let args = { - \ 'mode': 'referrers', - \ 'format': 'plain', - \ 'selected': a:selected, - \ 'needs_scope': 0, - \ } - - call s:run_guru(args) -endfunction - -function! go#guru#SameIds(showstatus) abort - " check if the version of Vim being tested supports matchaddpos() - if !exists("*matchaddpos") - call go#util#EchoError("GoSameIds requires 'matchaddpos'. Update your Vim/Neovim version.") - return - endif - - " check if the version of Vim being tested supports json_decode() - if !exists("*json_decode") - call go#util#EchoError("GoSameIds requires 'json_decode'. Update your Vim/Neovim version.") - return - endif - - let [l:line, l:col] = getpos('.')[1:2] - let [l:line, l:col] = go#lsp#lsp#Position(l:line, l:col) - call go#lsp#SameIDs(0, expand('%:p'), l:line, l:col, funcref('s:same_ids_highlight')) -endfunction - -function! s:same_ids_highlight(exit_val, output, mode) abort - call go#guru#ClearSameIds() " run after calling guru to reduce flicker. - - if a:output[0] !=# '{' - if !go#config#AutoSameids() - call go#util#EchoError(a:output) - endif - return - endif - - let result = json_decode(a:output) - if type(result) != type({}) && !go#config#AutoSameids() - call go#util#EchoError("malformed output from guru") - return - endif - - if !has_key(result, 'sameids') - if !go#config#AutoSameids() - call go#util#EchoError("no same_ids founds for the given identifier") - endif - return - endif - - let poslen = 0 - for enclosing in result['enclosing'] - if enclosing['desc'] == 'identifier' - let poslen = enclosing['end'] - enclosing['start'] - break - endif - endfor - - " return when there's no identifier to highlight. - if poslen == 0 - return - endif - - let same_ids = result['sameids'] - - " highlight the lines - let l:matches = [] - for item in same_ids - let pos = split(item, ':') - let l:matches = add(l:matches, [str2nr(pos[-2]), str2nr(pos[-1]), str2nr(poslen)]) - endfor - - call go#util#HighlightPositions('goSameId', l:matches) - - if go#config#AutoSameids() - " re-apply SameIds at the current cursor position at the time the buffer - " is redisplayed: e.g. :edit, :GoRename, etc. - augroup vim-go-sameids - autocmd! * - if has('textprop') - autocmd BufReadPost nested call go#guru#SameIds(0) - else - autocmd BufWinEnter nested call go#guru#SameIds(0) - endif - augroup end - endif -endfunction - -" ClearSameIds returns 0 when it removes goSameId groups and non-zero if no -" goSameId groups are found. -function! go#guru#ClearSameIds() abort - let l:cleared = go#util#ClearHighlights('goSameId') - - if !l:cleared - return 1 - endif - - " remove the autocmds we defined - augroup vim-go-sameids - autocmd! * - augroup end - - return 0 -endfunction - -function! go#guru#ToggleSameIds() abort - if go#guru#ClearSameIds() != 0 - call go#guru#SameIds(1) - endif -endfunction - -function! go#guru#AutoToggleSameIds() abort - if go#config#AutoSameids() - call go#util#EchoProgress("sameids auto highlighting disabled") - call go#guru#ClearSameIds() - call go#config#SetAutoSameids(0) - else - call go#util#EchoSuccess("sameids auto highlighting enabled") - call go#config#SetAutoSameids(1) - endif - call go#auto#update_autocmd() -endfunction - - -"""""""""""""""""""""""""""""""""""""""" -"" HELPER FUNCTIONS -"""""""""""""""""""""""""""""""""""""""" - -" This uses Vim's errorformat to parse the output from Guru's 'plain output -" and put it into location list. I believe using errorformat is much more -" easier to use. If we need more power we can always switch back to parse it -" via regex. Match two possible styles of errorformats: -" -" 'file:line.col-line2.col2: message' -" 'file:line:col: message' -" -" We discard line2 and col2 for the first errorformat, because it's not -" useful and location only has the ability to show one line and column -" number -function! s:parse_guru_output(exit_val, output, title) abort - if a:exit_val - call go#util#EchoError(a:output) - return - endif - - let errformat = "%f:%l.%c-%[%^:]%#:\ %m,%f:%l:%c:\ %m" - let l:listtype = go#list#Type("_guru") - call go#list#ParseFormat(l:listtype, errformat, a:output, a:title, 0) - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) -endfunction - -function! go#guru#Scope(...) abort - if a:0 - let scope = a:000 - if a:0 == 1 && a:1 == '""' - let scope = [] - endif - - call go#config#SetGuruScope(scope) - if empty(scope) - call go#util#EchoSuccess("guru scope is cleared") - else - call go#util#EchoSuccess("guru scope changed to: ". join(a:000, ",")) - endif - - return - endif - - let scope = go#config#GuruScope() - if empty(scope) - call go#util#EchoError("guru scope is not set") - else - call go#util#EchoSuccess("current guru scope: ". join(scope, ",")) - endif -endfunction - -function! go#guru#DescribeBalloon() abort - " don't even try if async isn't available. - if !go#util#has_job() - return - endif - - " check if the version of Vim being tested supports json_decode() - if !exists("*json_decode") - call go#util#EchoError("GoDescribeBalloon requires 'json_decode'. Update your Vim/Neovim version.") - return - endif - - " change the active window to the window where the cursor is. - let l:winid = win_getid(winnr()) - call win_gotoid(v:beval_winid) - - let l:args = { - \ 'mode': 'describe', - \ 'format': 'json', - \ 'selected': -1, - \ 'needs_scope': 0, - \ 'custom_parse': function('s:describe_balloon'), - \ 'disable_progress': 1, - \ 'postype': 'balloon', - \ } - - call s:async_guru(args) - - " make the starting window active again - call win_gotoid(l:winid) - - return '' -endfunction - -function! s:describe_balloon(exit_val, output, mode) - if a:exit_val != 0 - return - endif - - if a:output[0] !=# '{' - return - endif - - if empty(a:output) || type(a:output) != type("") - return - endif - - let l:result = json_decode(a:output) - if type(l:result) != type({}) - call go#util#EchoError(printf('malformed output from guru: %s', a:output)) - return - endif - - let l:info = [] - if has_key(l:result, 'desc') - if l:result['desc'] != 'identifier' - let l:info = add(l:info, l:result['desc']) - endif - endif - - if has_key(l:result, 'detail') - let l:detail = l:result['detail'] - - " guru gives different information based on the detail mode. Let try to - " extract the most useful information - - if l:detail == 'value' - if !has_key(l:result, 'value') - call go#util#EchoError('value key is missing. Please open a bug report on vim-go repo.') - return - endif - - let l:val = l:result['value'] - if !has_key(l:val, 'type') - call go#util#EchoError('type key is missing (value.type). Please open a bug report on vim-go repo.') - return - endif - - let l:info = add(l:info, printf('type: %s', l:val['type'])) - if has_key(l:val, 'value') - let l:info = add(l:info, printf('value: %s', l:val['value'])) - endif - elseif l:detail == 'type' - if !has_key(l:result, 'type') - call go#util#EchoError('type key is missing. Please open a bug report on vim-go repo.') - return - endif - - let l:type = l:result['type'] - if !has_key(l:type, 'type') - call go#util#EchoError('type key is missing (type.type). Please open a bug report on vim-go repo.') - return - endif - - let l:info = add(l:info, printf('type: %s', l:type['type'])) - - if has_key(l:type, 'methods') - let l:info = add(l:info, 'methods:') - for l:m in l:type.methods - let l:info = add(l:info, printf("\t%s", l:m['name'])) - endfor - endif - elseif l:detail == 'package' - if !has_key(l:result, 'package') - call go#util#EchoError('package key is missing. Please open a bug report on vim-go repo.') - return - endif - - let l:package = result['package'] - if !has_key(l:package, 'path') - call go#util#EchoError('path key is missing (package.path). Please open a bug report on vim-go repo.') - return - endif - - let l:info = add(l:info, printf('package: %s', l:package["path"])) - elseif l:detail == 'unknown' - " the description is already included in l:info, and there's no other - " information on unknowns. - else - call go#util#EchoError(printf('unknown detail mode (%s) found. Please open a bug report on vim-go repo', l:detail)) - return - endif - endif - - if has('balloon_eval') - call balloon_show(join(l:info, "\n")) - return - endif - - call balloon_show(l:info) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/guru_test.vim b/vim-config/plugins/vim-go/autoload/go/guru_test.vim deleted file mode 100644 index 47e6bf64..00000000 --- a/vim-config/plugins/vim-go/autoload/go/guru_test.vim +++ /dev/null @@ -1,23 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function Test_GuruScope_Set() abort - silent call go#guru#Scope("example.com/foo/bar") - let actual = go#config#GuruScope() - call assert_equal(["example.com/foo/bar"], actual) - - silent call go#guru#Scope('""') - silent let actual = go#config#GuruScope() - call assert_equal([], actual, "setting scope to empty string should clear") - - if exists('g:go_guru_scope') - unlet g:go_guru_scope - endif -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/highlight_test.vim b/vim-config/plugins/vim-go/autoload/go/highlight_test.vim deleted file mode 100644 index 9360a8f7..00000000 --- a/vim-config/plugins/vim-go/autoload/go/highlight_test.vim +++ /dev/null @@ -1,424 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! Test_gomodVersion_highlight() abort - try - syntax on - - let l:dir = gotest#write_file('gomodtest/go.mod', [ - \ 'module github.com/fatih/vim-go', - \ '', - \ '\x1frequire (', - \ '\tversion/simple v1.0.0', - \ '\tversion/simple-pre-release v1.0.0-rc', - \ '\tversion/simple-pre-release v1.0.0+meta', - \ '\tversion/simple-pre-release v1.0.0-rc+meta', - \ '\tversion/pseudo/premajor v1.0.0-20060102150405-0123456789abcdef', - \ '\tversion/pseudo/prerelease v1.0.0-prerelease.0.20060102150405-0123456789abcdef', - \ '\tversion/pseudo/prepatch v1.0.1-0.20060102150405-0123456789abcdef', - \ '\tversion/simple/incompatible v2.0.0+incompatible', - \ '\tversion/pseudo/premajor/incompatible v2.0.0-20060102150405-0123456789abcdef+incompatible', - \ '\tversion/pseudo/prerelease/incompatible v2.0.0-prerelease.0.20060102150405-0123456789abcdef+incompatible', - \ '\tversion/pseudo/prepatch/incompatible v2.0.1-0.20060102150405-0123456789abcdef+incompatible', - \ ')']) - - let l:lineno = 4 - let l:lineclose = line('$') - while l:lineno < l:lineclose - let l:line = getline(l:lineno) - let l:col = col([l:lineno, '$']) - 1 - let l:idx = len(l:line) - 1 - let l:from = stridx(l:line, ' ') + 1 - - while l:idx >= l:from - call cursor(l:lineno, l:col) - let l:synname = synIDattr(synID(l:lineno, l:col, 1), 'name') - let l:errlen = len(v:errors) - - call assert_equal('gomodVersion', l:synname, 'version on line ' . l:lineno) - - " continue at the next line if there was an error at this column; - " there's no need to test each column once an error is detected. - if l:errlen < len(v:errors) - break - endif - - let l:col -= 1 - let l:idx -= 1 - endwhile - let l:lineno += 1 - endwhile - finally - call delete(l:dir, 'rf') - endtry -endfunc - -function! Test_gomodVersion_incompatible_highlight() abort - try - syntax on - - let l:dir = gotest#write_file('gomodtest/go.mod', [ - \ 'module github.com/fatih/vim-go', - \ '', - \ '\x1frequire (', - \ '\tversion/invalid/premajor/incompatible v1.0.0-20060102150405-0123456789abcdef+incompatible', - \ '\tversion/invalid/prerelease/incompatible v1.0.0-prerelease.0.20060102150405-0123456789abcdef+incompatible', - \ '\tversion/invalid/prepatch/incompatible v1.0.1-0.20060102150405-0123456789abcdef+incompatible', - \ ')']) - - let l:lineno = 4 - let l:lineclose = line('$') - while l:lineno < l:lineclose - let l:line = getline(l:lineno) - let l:col = col([l:lineno, '$']) - 1 - let l:idx = len(l:line) - 1 - let l:from = stridx(l:line, '+') - - while l:idx >= l:from - call cursor(l:lineno, l:col) - let l:synname = synIDattr(synID(l:lineno, l:col, 1), 'name') - let l:errlen = len(v:errors) - - call assert_notequal('gomodVersion', l:synname, 'version on line ' . l:lineno) - - " continue at the next line if there was an error at this column; - " there's no need to test each column once an error is detected. - if l:errlen < len(v:errors) - break - endif - - let l:col -= 1 - let l:idx -= 1 - endwhile - let l:lineno += 1 - endwhile - finally - call delete(l:dir, 'rf') - endtry -endfunc - -function! Test_numeric_literal_highlight() abort - syntax on - - let tests = { - \ 'lone zero': {'group': 'goDecimalInt', 'value': '0'}, - \ 'integer': {'group': 'goDecimalInt', 'value': '1234567890'}, - \ 'integerGrouped': {'group': 'goDecimalInt', 'value': '1_234_567_890'}, - \ 'integerErrorLeadingUnderscore': {'group': 'goDecimalError', 'value': '_1234_567_890'}, - \ 'integerErrorTrailingUnderscore': {'group': 'goDecimalError', 'value': '1_234_567890_'}, - \ 'integerErrorDoubleUnderscore': {'group': 'goDecimalError', 'value': '1_234__567_890'}, - \ 'hexadecimal': {'group': 'goHexadecimalInt', 'value': '0x0123456789abdef'}, - \ 'hexadecimalGrouped': {'group': 'goHexadecimalInt', 'value': '0x012_345_678_9ab_def'}, - \ 'hexadecimalErrorLeading': {'group': 'goHexadecimalError', 'value': '0xg0123456789abdef'}, - \ 'hexadecimalErrorTrailing': {'group': 'goHexadecimalError', 'value': '0x0123456789abdefg'}, - \ 'hexadecimalErrorDoubleUnderscore': {'group': 'goHexadecimalError', 'value': '0x__0123456789abdef'}, - \ 'hexadecimalErrorTrailingUnderscore': {'group': 'goHexadecimalError', 'value': '0x0123456789abdef_'}, - \ 'heXadecimal': {'group': 'goHexadecimalInt', 'value': '0X0123456789abdef'}, - \ 'heXadecimalErrorLeading': {'group': 'goHexadecimalError', 'value': '0Xg0123456789abdef'}, - \ 'heXadecimalErrorTrailing': {'group': 'goHexadecimalError', 'value': '0X0123456789abdefg'}, - \ 'octal': {'group': 'goOctalInt', 'value': '01234567'}, - \ 'octalPrefix': {'group': 'goOctalInt', 'value': '0o1234567'}, - \ 'octalGrouped': {'group': 'goOctalInt', 'value': '0o1_234_567'}, - \ 'octalErrorLeading': {'group': 'goOctalError', 'value': '081234567'}, - \ 'octalErrorTrailing': {'group': 'goOctalError', 'value': '012345678'}, - \ 'octalErrorDoubleUnderscore': {'group': 'goOctalError', 'value': '0o__1234567'}, - \ 'octalErrorTrailingUnderscore': {'group': 'goOctalError', 'value': '0o_123456_7_'}, - \ 'octalErrorTrailingO': {'group': 'goOctalError', 'value': '0o_123456_7o'}, - \ 'octalErrorTrailingX': {'group': 'goOctalError', 'value': '0o_123456_7x'}, - \ 'octalErrorTrailingB': {'group': 'goOctalError', 'value': '0o_123456_7b'}, - \ 'OctalPrefix': {'group': 'goOctalInt', 'value': '0O1234567'}, - \ 'binaryInt': {'group': 'goBinaryInt', 'value': '0b0101'}, - \ 'binaryIntGrouped': {'group': 'goBinaryInt', 'value': '0b_01_01'}, - \ 'binaryErrorLeading': {'group': 'goBinaryError', 'value': '0b20101'}, - \ 'binaryErrorTrailing': {'group': 'goBinaryError', 'value': '0b01012'}, - \ 'binaryErrorDoubleUnderscore': {'group': 'goBinaryError', 'value': '0b_01__01'}, - \ 'binaryOverrideOctal': {'group': 'goBinaryError', 'value': '0b1234567'}, - \ 'binaryErrorTrailingUnderscore': {'group': 'goBinaryError', 'value': '0b_01_01_'}, - \ 'BinaryInt': {'group': 'goBinaryInt', 'value': '0B0101'}, - \ 'BinaryErrorLeading': {'group': 'goBinaryError', 'value': '0B20101'}, - \ 'BinaryErrorTrailing': {'group': 'goBinaryError', 'value': '0B01012'}, - \ } - - for kv in items(tests) - let l:actual = s:numericHighlightGroupInAssignment(kv[0], kv[1].value) - call assert_equal(kv[1].group, l:actual, kv[0]) - endfor -endfunction - -function! Test_zero_as_index_element() abort - syntax on - - let l:actual = s:numericHighlightGroupInSliceElement('zero-element', '0') - call assert_equal('goDecimalInt', l:actual) - let l:actual = s:numericHighlightGroupInMultidimensionalSliceElement('zero-element', '0') - call assert_equal('goDecimalInt', l:actual, 'multi-dimensional') -endfunction - -function! Test_zero_as_slice_index() abort - syntax on - - let l:actual = s:numericHighlightGroupInSliceIndex('zero-index', '0') - call assert_equal('goDecimalInt', l:actual) - let l:actual = s:numericHighlightGroupInMultidimensionalSliceIndex('zero-index', '0', '0') - - call assert_equal('goDecimalInt', l:actual, 'multi-dimensional') -endfunction - -function! Test_zero_as_start_slicing_slice() abort - syntax on - - let l:actual = s:numericHighlightGroupInSliceSlicing('slice-slicing', '0', '1') - call assert_equal('goDecimalInt', l:actual) -endfunction - -function! s:numericHighlightGroupInAssignment(testname, value) - let l:dir = gotest#write_file(printf('numeric/%s.go', a:testname), [ - \ 'package numeric', - \ '', - \ printf("var v = %s\x1f", a:value), - \ ]) - - try - let l:pos = getcurpos() - let l:actual = synIDattr(synID(l:pos[1], l:pos[2], 1), 'name') - return l:actual - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! s:numericHighlightGroupInSliceElement(testname, value) - let l:dir = gotest#write_file(printf('numeric/slice-element/%s.go', a:testname), [ - \ 'package numeric', - \ '', - \ printf("v := []int{\x1f%s}", a:value), - \ ]) - - try - let l:pos = getcurpos() - let l:actual = synIDattr(synID(l:pos[1], l:pos[2], 1), 'name') - return l:actual - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! s:numericHighlightGroupInMultidimensionalSliceElement(testname, value) - let l:dir = gotest#write_file(printf('numeric/slice-multidimensional-element/%s.go', a:testname), [ - \ 'package numeric', - \ '', - \ printf("v := [][]int{{\x1f%s},{%s}}", a:value, a:value), - \ ]) - - try - let l:pos = getcurpos() - let l:actual = synIDattr(synID(l:pos[1], l:pos[2], 1), 'name') - return l:actual - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! s:numericHighlightGroupInSliceIndex(testname, value) - let l:dir = gotest#write_file(printf('numeric/slice-index/%s.go', a:testname), [ - \ 'package numeric', - \ '', - \ 'var sl []int', - \ printf("println(sl[\x1f%s])", a:value), - \ ]) - - try - let l:pos = getcurpos() - let l:actual = synIDattr(synID(l:pos[1], l:pos[2], 1), 'name') - return l:actual - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! s:numericHighlightGroupInMultidimensionalSliceIndex(testname, first, second) - let l:dir = gotest#write_file(printf('numeric/slice-multidimensional-index/%s.go', a:testname), [ - \ 'package numeric', - \ '', - \ 'var sl [][]int', - \ printf("println(sl[\x1f%s][%s])", a:first, a:second), - \ ]) - - try - let l:pos = getcurpos() - let l:actual = synIDattr(synID(l:pos[1], l:pos[2], 1), 'name') - return l:actual - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! s:numericHighlightGroupInSliceSlicing(testname, from, to) - let l:dir = gotest#write_file(printf('numeric/slice-slicing/%s.go', a:testname), [ - \ 'package numeric', - \ '', - \ 'var sl = []int{1,2}', - \ printf("println(sl[\x1f%s:%s])", a:from, a:to), - \ ]) - try - let l:pos = getcurpos() - let l:actual = synIDattr(synID(l:pos[1], l:pos[2], 1), 'name') - return l:actual - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! Test_diagnostic_after_fmt() abort - let g:go_fmt_command = 'gofmt' - try - call s:diagnostic_after_write( [ - \ 'package main', - \ 'import "fmt"', - \ '', - \ 'func main() {', - \ '', - \ "\tfmt.Println(\x1fhello)", - \ '}', - \ ], []) - finally - unlet g:go_fmt_command - endtry -endfunction - -function! Test_diagnostic_after_fmt_change() abort - " craft a file that will be changed when its written (gofmt will change it). - let g:go_fmt_command = 'gofmt' - try - call s:diagnostic_after_write( [ - \ 'package main', - \ 'import "fmt"', - \ '', - \ 'func main() {', - \ '', - \ "fmt.Println(\x1fhello)", - \ '}', - \ ], []) - finally - unlet g:go_fmt_command - endtry -endfunction - -function! Test_diagnostic_after_fmt_cleared() abort - " craft a file that will be fixed when it is written. - let g:go_fmt_command = 'gofmt' - try - call s:diagnostic_after_write( [ - \ 'package main', - \ 'import "fmt"', - \ '', - \ 'func main() {', - \ '', - \ "fmt.Println(\x1fhello)", - \ '}', - \ ], ['hello := "hello, vim-go"']) - finally - unlet g:go_fmt_command - endtry -endfunction - -function! Test_diagnostic_after_reload() abort - let l:dir = gotest#write_file('diagnostic/after-reload.go', [ - \ 'package main', - \ 'import "fmt"', - \ '', - \ 'func main() {', - \ '', - \ "\tfmt.Println(\x1fhello)", - \ '}', - \ ]) - try - call s:check_diagnostics('', 'goDiagnosticError', 'initial') - let l:pos = getcurpos() - edit - call setpos('.', l:pos) - call s:check_diagnostics('', 'goDiagnosticError', 'after-reload') - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! s:diagnostic_after_write(contents, changes) abort - syntax on - - let l:dir = gotest#write_file('diagnostic/after-write.go', a:contents) - - try - let l:pos = getcurpos() - call s:check_diagnostics('', 'goDiagnosticError', 'initial') - - " write a:changes to the previous line and make sure l:actual and - " l:expected are set so that they won't accidentally match on the next - " check. - if len(a:changes) > 0 - call append(l:pos[1]-1, a:changes) - let l:actual = 'goDiagnosticError' - let l:expected = '' - else - let l:actual = '' - let l:expected = 'goDiagnosticError' - endif - - write - - call s:check_diagnostics(l:actual, l:expected, 'after-write') - finally - call delete(l:dir, 'rf') - endtry -endfunction - -function! s:check_diagnostics(actual, expected, when) - let l:actual = a:actual - let l:start = reltime() - - while l:actual != a:expected && reltimefloat(reltime(l:start)) < 10 - " Get the cursor position on each iteration, because the cursor postion - " may change between iterations when go#fmt#GoFmt formats, reloads the - " file, and moves the cursor to try to keep it where the user expects it - " to be when gofmt modifies the files. - let l:pos = getcurpos() - if !has('textprop') - let l:matches = getmatches() - if len(l:matches) == 0 - let l:actual = '' - endif - - for l:m in l:matches - let l:matchline = l:m.pos1[0] - if len(l:m.pos1) < 2 - continue - endif - let l:matchcol = get(l:m.pos1, 1, 1) - if l:pos[1] == l:matchline && l:pos[2] >= l:matchcol && l:pos[2] <= l:matchcol + l:m.pos1[2] - " Ideally, we'd check that the cursor is within the match, but when a - " tab is added on the current line, the cursor position within the - " line will stay constant while the line itself is shifted over by a - " column, so just check the line itself instead of checking a precise - " cursor location. - " if l:pos[1] == l:matchline - let l:actual = l:m.group - break - endif - endfor - - sleep 100m - continue - endif - - let l:actual = get(prop_list(l:pos[1]), 0, {'type': ''}).type - sleep 100m - endwhile - - call assert_equal(a:expected, l:actual, a:when) -endfunction -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/iferr.vim b/vim-config/plugins/vim-go/autoload/go/iferr.vim deleted file mode 100644 index cc777b34..00000000 --- a/vim-config/plugins/vim-go/autoload/go/iferr.vim +++ /dev/null @@ -1,26 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#iferr#Generate() - let [l:out, l:err] = go#util#Exec(['iferr', - \ '-pos=' . go#util#OffsetCursor()], go#util#GetLines()) - if len(l:out) == 1 - return - endif - if getline('.') =~ '^\s*$' - silent delete _ - silent normal! k - endif - let l:pos = getcurpos() - call append(l:pos[1], split(l:out, "\n")) - silent normal! j=2j - call setpos('.', l:pos) - silent normal! 4j -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/impl.vim b/vim-config/plugins/vim-go/autoload/go/impl.vim deleted file mode 100644 index 1a04d0cc..00000000 --- a/vim-config/plugins/vim-go/autoload/go/impl.vim +++ /dev/null @@ -1,175 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#impl#Impl(...) abort - let recv = "" - let iface = "" - let interactive = 0 - - let pos = getpos('.') - - if a:0 is 0 - " Interactive mode if user didn't pass any arguments. - let recv = s:getReceiver() - let iface = input("vim-go: generating method stubs for interface: ") - redraw! - if empty(iface) - call go#util#EchoError('usage: interface type is not provided') - return - endif - elseif a:0 is 1 - " we assume the user only passed the interface type, - " i.e: ':GoImpl io.Writer' - let recv = s:getReceiver() - let iface = a:1 - elseif a:0 > 2 - " user passed receiver and interface type both, - " i.e: 'GoImpl f *Foo io.Writer' - let recv = join(a:000[:-2], ' ') - let iface = a:000[-1] - else - call go#util#EchoError('usage: GoImpl {receiver} {interface}') - return - endif - - " Make sure we put the generated code *after* the struct. - if getline(".") =~ "struct " - normal! $% - endif - - try - let dirname = fnameescape(expand('%:p:h')) - let [result, err] = go#util#Exec(['impl', '-dir', dirname, recv, iface]) - let result = substitute(result, "\n*$", "", "") - if err - call go#util#EchoError(result) - return - endif - - if result is# '' - return - end - - put ='' - silent put =result - finally - call setpos('.', pos) - endtry -endfunction - -function! s:getReceiver() - let receiveType = expand("") - if receiveType == "type" - normal! w - let receiveType = expand("") - elseif receiveType == "struct" - normal! ge - let receiveType = expand("") - endif - return printf("%s *%s", tolower(receiveType)[0], receiveType) -endfunction - -if exists('*uniq') - function! s:uniq(list) - return uniq(a:list) - endfunction -else - " Note: Believe that the list is sorted - function! s:uniq(list) - let i = len(a:list) - 1 - while 0 < i - if a:list[i-1] ==# a:list[i] - call remove(a:list, i) - let i -= 2 - else - let i -= 1 - endif - endwhile - return a:list - endfunction -endif - -function! s:root_dirs() abort - let dirs = [] - let root = go#util#env("goroot") - if root !=# '' && isdirectory(root) - call add(dirs, root) - endif - - let paths = map(split(go#util#env("gopath"), go#util#PathListSep()), "substitute(v:val, '\\\\', '/', 'g')") - if !empty(filter(paths, 'isdirectory(v:val)')) - call extend(dirs, paths) - endif - - return dirs -endfunction - -function! s:go_packages(dirs, arglead) abort - let pkgs = [] - for dir in a:dirs - " this may expand to multiple lines - let scr_root = expand(dir . '/src/') - for pkg in split(globpath(scr_root, a:arglead.'*'), "\n") - if isdirectory(pkg) - let pkg .= '/' - elseif pkg !~ '\.a$' - continue - endif - - " without this the result can have duplicates in form of - " 'encoding/json' and '/encoding/json/' - let pkg = go#util#StripPathSep(pkg) - - " remove the scr root and keep the package in tact - let pkg = substitute(pkg, scr_root, "", "") - call add(pkgs, pkg) - endfor - endfor - - return pkgs -endfunction - -function! s:interface_list(pkg) abort - let [contents, err] = go#util#Exec(['go', 'doc', a:pkg]) - if err - return [] - endif - - let contents = split(contents, "\n") - call filter(contents, 'v:val =~# ''^type\s\+\h\w*\s\+interface''') - return map(contents, 'a:pkg . "." . matchstr(v:val, ''^type\s\+\zs\h\w*\ze\s\+interface'')') -endfunction - -" Complete package and interface for {interface} -function! go#impl#Complete(arglead, cmdline, cursorpos) abort - let words = split(a:cmdline, '\s\+', 1) - - if words[-1] ==# '' - " if no words are given, just start completing the first package we found - return s:uniq(sort(s:go_packages(s:root_dirs(), a:arglead))) - elseif words[-1] =~# '^\(\h\w.*\.\%(\h\w*\)\=$\)\@!\S*$' - " start matching go packages. It's negate match of the below match - return s:uniq(sort(s:go_packages(s:root_dirs(), a:arglead))) - elseif words[-1] =~# '^\h\w.*\.\%(\h\w*\)\=$' - " match the following, anything that could indicate an interface candidate - " - " io. - " io.Wr - " github.com/fatih/color. - " github.com/fatih/color.U - " github.com/fatih/color.Un - let splitted = split(words[-1], '\.', 1) - let pkg = join(splitted[:-2], '.') - let interface = splitted[-1] - return s:uniq(sort(filter(s:interface_list(pkg), 'v:val =~? words[-1]'))) - else - return [] - endif -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/impl_test.vim b/vim-config/plugins/vim-go/autoload/go/impl_test.vim deleted file mode 100644 index 6be39a11..00000000 --- a/vim-config/plugins/vim-go/autoload/go/impl_test.vim +++ /dev/null @@ -1,47 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_impl() abort - try - let l:tmp = gotest#write_file('a/a.go', [ - \ 'package a', - \ '', - \ '']) - - call go#impl#Impl('r', 'reader', 'io.Reader') - call gotest#assert_buffer(1, [ - \ 'func (r reader) Read(p []byte) (n int, err error) {', - \ ' panic("not implemented") // TODO: Implement', - \ '}']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_impl_get() abort - try - let l:tmp = gotest#write_file('a/a.go', [ - \ 'package a', - \ '', - \ 'type reader struct {}']) - - call go#impl#Impl('io.Reader') - call gotest#assert_buffer(0, [ - \ 'package a', - \ '', - \ 'type reader struct {}', - \ '', - \ 'func (r *reader) Read(p []byte) (n int, err error) {', - \ ' panic("not implemented") // TODO: Implement', - \ '}']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/implements.vim b/vim-config/plugins/vim-go/autoload/go/implements.vim deleted file mode 100644 index 0d25f8c2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/implements.vim +++ /dev/null @@ -1,44 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#implements#Implements(selected) abort - let l:mode = go#config#ImplementsMode() - if l:mode == 'guru' - call go#guru#Implements(a:selected) - return - elseif l:mode == 'gopls' - if !go#config#GoplsEnabled() - call go#util#EchoError("go_implements_mode is 'gopls', but gopls is disabled") - endif - let [l:line, l:col] = getpos('.')[1:2] - let [l:line, l:col] = go#lsp#lsp#Position(l:line, l:col) - let l:fname = expand('%:p') - call go#lsp#Implements(l:fname, l:line, l:col, funcref('s:parse_output')) - return - else - call go#util#EchoWarning('unknown value for g:go_implements_mode') - endif -endfunction - -" This uses Vim's errorformat to parse the output and put it into a quickfix -" or locationlist. -function! s:parse_output(exit_val, output, title) abort - if a:exit_val - call go#util#EchoError(a:output) - return - endif - - let errformat = ",%f:%l:%c:\ %m" - let l:listtype = go#list#Type("GoImplements") - call go#list#ParseFormat(l:listtype, errformat, a:output, a:title, 0) - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/import.vim b/vim-config/plugins/vim-go/autoload/go/import.vim deleted file mode 100644 index 848a5c0b..00000000 --- a/vim-config/plugins/vim-go/autoload/go/import.vim +++ /dev/null @@ -1,232 +0,0 @@ -" Copyright 2011 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" Check out the docs for more information at /doc/vim-go.txt -" - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#import#SwitchImport(enabled, localname, path, bang) abort - let view = winsaveview() - let path = substitute(a:path, '^\s*\(.\{-}\)\s*$', '\1', '') - - " Quotes are not necessary, so remove them if provided. - if path[0] == '"' - let path = strpart(path, 1) - endif - if path[len(path)-1] == '"' - let path = strpart(path, 0, len(path) - 1) - endif - - " if given a trailing slash, eg. `github.com/user/pkg/`, remove it - if path[len(path)-1] == '/' - let path = strpart(path, 0, len(path) - 1) - endif - - if path == '' - call s:Error('Import path not provided') - return - endif - - if a:bang == "!" - let [l:out, l:err] = go#util#Exec(['go', 'get', '-u', '-v', path]) - if err != 0 - call s:Error("Can't find import: " . path . ":" . out) - endif - endif - let exists = go#tool#Exists(path) - if exists == -1 - call s:Error("Can't find import: " . path) - return - endif - - " Extract any site prefix (e.g. github.com/). - " If other imports with the same prefix are grouped separately, - " we will add this new import with them. - " Only up to and including the first slash is used. - let siteprefix = matchstr(path, "^[^/]*/") - - let qpath = '"' . path . '"' - if a:localname != '' - let qlocalpath = a:localname . ' ' . qpath - else - let qlocalpath = qpath - endif - let indentstr = 0 - let packageline = -1 " Position of package name statement - let appendline = -1 " Position to introduce new import - let deleteline = -1 " Position of line with existing import - let linesdelta = 0 " Lines added/removed - - " Find proper place to add/remove import. - let line = 0 - while line <= line('$') - let linestr = getline(line) - - if linestr =~# '^package\s' - let packageline = line - let appendline = line - - elseif linestr =~# '^import\s\+(\+)' - let appendline = line - let appendstr = qlocalpath - elseif linestr =~# '^import\s\+(' - let appendstr = qlocalpath - let indentstr = 1 - let appendline = line - let firstblank = -1 - let lastprefix = "" - while line <= line("$") - let line = line + 1 - let linestr = getline(line) - let m = matchlist(getline(line), '^\()\|\(\s\+\)\(\w\+\s\+\)\="\(.\+\)"\)') - if empty(m) - if siteprefix == "" && a:enabled - " must be in the first group - break - endif - " record this position, but keep looking - if firstblank < 0 - let firstblank = line - endif - continue - endif - if m[1] == ')' - " if there's no match, add it to the first group - if appendline < 0 && firstblank >= 0 - let appendline = firstblank - endif - break - endif - let lastprefix = matchstr(m[4], "^[^/]*/") - if a:localname != '' && m[3] != '' - let qlocalpath = printf('%-' . (len(m[3])-1) . 's %s', a:localname, qpath) - endif - let appendstr = m[2] . qlocalpath - let indentstr = 0 - if m[4] == path - let appendline = -1 - let deleteline = line - break - elseif m[4] < path - " don't set candidate position if we have a site prefix, - " we've passed a blank line, and this doesn't share the same - " site prefix. - if siteprefix == "" || firstblank < 0 || match(m[4], "^" . siteprefix) >= 0 - let appendline = line - endif - elseif siteprefix != "" && match(m[4], "^" . siteprefix) >= 0 - " first entry of site group - let appendline = line - 1 - break - endif - endwhile - break - - elseif linestr =~# '^import ' - if appendline == packageline - let appendstr = 'import ' . qlocalpath - let appendline = line - 1 - endif - let m = matchlist(linestr, '^import\(\s\+\)\(\S*\s*\)"\(.\+\)"') - if !empty(m) - if m[3] == path - let appendline = -1 - let deleteline = line - break - endif - if m[3] < path - let appendline = line - endif - if a:localname != '' && m[2] != '' - let qlocalpath = printf("%s %" . len(m[2])-1 . "s", a:localname, qpath) - endif - let appendstr = 'import' . m[1] . qlocalpath - endif - - elseif linestr =~# '^\(var\|const\|type\|func\)\>' - break - - endif - let line = line + 1 - endwhile - - " Append or remove the package import, as requested. - if a:enabled - if deleteline != -1 - call s:Error(qpath . ' already being imported') - elseif appendline == -1 - call s:Error('No package line found') - else - if appendline == packageline - call append(appendline + 0, '') - call append(appendline + 1, 'import (') - call append(appendline + 2, ')') - let appendline += 2 - let linesdelta += 3 - let appendstr = qlocalpath - let indentstr = 1 - call append(appendline, appendstr) - elseif getline(appendline) =~# '^import\s\+(\+)' - call setline(appendline, 'import (') - call append(appendline + 0, appendstr) - call append(appendline + 1, ')') - let linesdelta -= 1 - let indentstr = 1 - else - call append(appendline, appendstr) - endif - execute appendline + 1 - if indentstr - execute 'normal! >>' - endif - let linesdelta += 1 - endif - else - if deleteline == -1 - call s:Error(qpath . ' not being imported') - else - execute deleteline . 'd' - let linesdelta -= 1 - - if getline(deleteline-1) =~# '^import\s\+(' && getline(deleteline) =~# '^)' - " Delete empty import block - let deleteline -= 1 - execute deleteline . "d" - execute deleteline . "d" - let linesdelta -= 2 - endif - - if getline(deleteline) == '' && getline(deleteline - 1) == '' - " Delete spacing for removed line too. - execute deleteline . "d" - let linesdelta -= 1 - endif - endif - endif - - " Adjust view for any changes. - let view.lnum += linesdelta - let view.topline += linesdelta - if view.topline < 0 - let view.topline = 0 - endif - - " Put buffer back where it was. - call winrestview(view) - -endfunction - - -function! s:Error(s) abort - echohl Error | echo a:s | echohl None -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/import_test.vim b/vim-config/plugins/vim-go/autoload/go/import_test.vim deleted file mode 100644 index c4306a1a..00000000 --- a/vim-config/plugins/vim-go/autoload/go/import_test.vim +++ /dev/null @@ -1,35 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_SwitchImportAddIgnoresCommented() - try - let l:tmp = gotest#write_file('import/import.go', [ - \ 'package import', - \ '', - \ 'import (', - \ "\t" . '// "fmt"', - \ "\t" . '"io"', - \ "\t" . '"ioutil"', - \ "\t" . '"os"', - \ ')', - \ '', - \ 'func main() {', - \ ' io.Copy(ioutil.Discard, os.Stdin)', - \ ' fmt.Println("import the package")', - \ '}', - \ ]) - call go#import#SwitchImport(1, '', 'fmt', 0) - - let l:actual = getline(4) - call assert_equal("\t" . '"fmt"', l:actual) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/indent_test.vim b/vim-config/plugins/vim-go/autoload/go/indent_test.vim deleted file mode 100644 index c969fde7..00000000 --- a/vim-config/plugins/vim-go/autoload/go/indent_test.vim +++ /dev/null @@ -1,72 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_indent_raw_string() abort - " The goRawString discovery requires that syntax be enabled. - syntax on - - try - let l:dir= gotest#write_file('indent/indent.go', [ - \ 'package main', - \ '', - \ 'import "fmt"', - \ '', - \ 'func main() {', - \ "\t\x1fconst msg = `", - \ '`', - \ '\tfmt.Println(msg)', - \ '}']) - - silent execute "normal o" . "not indented\" - let l:indent = indent(line('.')) - call assert_equal(0, l:indent) - finally - call delete(l:dir, 'rf') - endtry - - try - let l:dir= gotest#write_file('indent/indent.go', [ - \ 'package main', - \ '', - \ 'import "fmt"', - \ '', - \ 'func main() {', - \ "\t\x1fmsg := `", - \ '`', - \ '\tfmt.Println(msg)', - \ '}']) - - silent execute "normal o" . "not indented\" - let l:indent = indent(line('.')) - call assert_equal(0, l:indent) - finally - call delete(l:dir, 'rf') - endtry - - try - let l:dir= gotest#write_file('indent/indent.go', [ - \ 'package main', - \ '', - \ 'import "fmt"', - \ '', - \ 'func main() {', - \ "\tconst msg = `", - \ "\t\x1findented", - \ '`', - \ '\tfmt.Println(msg)', - \ '}']) - - silent execute "normal o" . "indented\" - let l:indent = indent(line('.')) - call assert_equal(shiftwidth(), l:indent) - finally - call delete(l:dir, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/issue.vim b/vim-config/plugins/vim-go/autoload/go/issue.vim deleted file mode 100644 index 135cc253..00000000 --- a/vim-config/plugins/vim-go/autoload/go/issue.vim +++ /dev/null @@ -1,56 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:templatepath = go#util#Join(expand(':p:h:h:h'), '.github', 'ISSUE_TEMPLATE.md') - -function! go#issue#New() abort - let body = go#uri#Encode(s:issuebody()) - let url = "https://github.com/fatih/vim-go/issues/new?body=" . l:body - call go#util#OpenBrowser(l:url) -endfunction - -function! s:issuebody() abort - let lines = readfile(s:templatepath) - - let rtrimpat = '[[:space:]]\+$' - let body = [] - for l in lines - let body = add(body, l) - - if l =~ '^' - let [out, err] = go#util#Exec(['go', 'version']) - let body = add(body, substitute(l:out, rtrimpat, '', '')) - elseif l =~ '^' - let [out, err] = go#util#ExecInDir(['go', 'env']) - let body = add(body, substitute(l:out, rtrimpat, '', '')) - elseif l=~ '^' - let [out, err] = go#util#Exec(['gopls', 'version']) - let body = add(body, substitute(l:out, rtrimpat, '', '')) - endif - endfor - - let body = add(body, "\n#### vim-go configuration:\n
vim-go configuration
")
-
-  for k in keys(g:)
-    if k =~ '^go_'
-      let body = add(body, 'g:' . k . ' = ' . string(get(g:, k)))
-    endif
-  endfor
-
-  let body = add(body, '
') - - let body = add(body, printf("\n#### filetype detection configuration:\n
filetype detection
%s", execute('filetype')))
-  let body = add(body, '
') - - return join(body, "\n") -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/job.vim b/vim-config/plugins/vim-go/autoload/go/job.vim deleted file mode 100644 index f0ee305e..00000000 --- a/vim-config/plugins/vim-go/autoload/go/job.vim +++ /dev/null @@ -1,547 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" Spawn starts an asynchronous job. See the description of go#job#Options to -" understand the args parameter. -" -" Spawn returns a job. -function! go#job#Spawn(cmd, args) - let l:options = go#job#Options(a:args) - return go#job#Start(a:cmd, l:options) -endfunction - -" Options returns callbacks to be used with job_start. It is abstracted to be -" used with various go commands, such as build, test, install, etc.. This -" allows us to avoid writing the same callback over and over for some -" commands. It's fully customizable so each command can change it to its own -" logic. -" -" args is a dictionary with the these keys: -" 'bang': -" Set to 0 to jump to the first error in the error list. -" Defaults to 0. -" 'statustype': -" The status type to use when updating the status. -" See statusline.vim. -" 'for': -" The g:go_list_type_command key to use to get the error list type to use. -" Errors will not be handled when the value is '_'. -" Defaults to '_job' -" 'errorformat': -" The errorformat string to use when parsing errors. Defaults to -" &errorformat. -" See :help 'errorformat'. -" 'complete': -" A function to call after the job exits and the channel is closed. The -" function will be passed three arguments: the job, its exit code, and the -" list of messages received from the channel. The default is a no-op. A -" custom value can modify the messages before they are processed by the -" returned exit_cb and close_cb callbacks. When the function is called, -" the current window will be the window that was hosting the buffer when -" the job was started. After it returns, the current window will be -" restored to what it was before the function was called. -" 'preserveerrors': -" A function that will be passed one value, the list type. It should -" return a boolean value that indicates whether any errors encountered -" should be consider additive to the existing set of errors. This is -" mostly useful for a set of commands that are run via autocmds. -" -" The return value is a dictionary with these keys: -" 'callback': -" A function suitable to be passed as a job callback handler. See -" job-callback. -" 'exit_cb': -" A function suitable to be passed as a job exit_cb handler. See -" job-exit_cb. -" 'close_cb': -" A function suitable to be passed as a job close_cb handler. See -" job-close_cb. -" 'cwd': -" The path to the directory which contains the current buffer. The -" callbacks are configured to expect this directory is the working -" directory for the job; it should not be modified by callers. -function! go#job#Options(args) - let cbs = {} - let state = { - \ 'winid': win_getid(winnr()), - \ 'dir': getcwd(), - \ 'jobdir': expand("%:p:h"), - \ 'messages': [], - \ 'bang': 0, - \ 'for': "_job", - \ 'exited': 0, - \ 'exit_status': 0, - \ 'closed': 0, - \ 'errorformat': &errorformat, - \ 'statustype' : '', - \ } - - let cbs.cwd = state.jobdir - - if has_key(a:args, 'bang') - let state.bang = a:args.bang - endif - - if has_key(a:args, 'for') - let state.for = a:args.for - endif - - if has_key(a:args, 'statustype') - let state.statustype = a:args.statustype - endif - - if has_key(a:args, 'errorformat') - let state.errorformat = a:args.errorformat - endif - - if has_key(a:args, 'preserveerrors') - let state.preserveerrors = a:args.preserveerrors - endif - - function state.complete(job, exit_status, data) - if has_key(self, 'custom_complete') - let l:winid = win_getid(winnr()) - " Always set the active window to the window that was active when the job - " was started. Among other things, this makes sure that the correct - " window's location list will be populated when the list type is - " 'location' and the user has moved windows since starting the job. - call win_gotoid(self.winid) - call self.custom_complete(a:job, a:exit_status, a:data) - call win_gotoid(l:winid) - endif - - call self.show_errors(a:job, a:exit_status, a:data) - endfunction - - function state.show_status(job, exit_status) dict - if self.statustype == '' - return - endif - - if go#config#EchoCommandInfo() - let prefix = '[' . self.statustype . '] ' - if a:exit_status == 0 - call go#util#EchoSuccess(prefix . "SUCCESS") - else - call go#util#EchoError(prefix . "FAIL") - endif - endif - - let status = { - \ 'desc': 'last status', - \ 'type': self.statustype, - \ 'state': "success", - \ } - - if a:exit_status - let status.state = "failed" - endif - - if has_key(self, 'started_at') - let elapsed_time = reltimestr(reltime(self.started_at)) - " strip whitespace - let elapsed_time = substitute(elapsed_time, '^\s*\(.\{-}\)\s*$', '\1', '') - let status.state .= printf(" (%ss)", elapsed_time) - endif - - call go#statusline#Update(self.jobdir, status) - endfunction - - if has_key(a:args, 'complete') - let state.custom_complete = a:args.complete - endif - - " explicitly bind _start to state so that within it, self will - " always refer to state. See :help Partial for more information. - " - " _start is intended only for internal use and should not be referenced - " outside of this file. - let cbs._start = function('s:start', [''], state) - - " explicitly bind callback to state so that within it, self will - " always refer to state. See :help Partial for more information. - let cbs.callback = function('s:callback', [], state) - - " explicitly bind exit_cb to state so that within it, self will always refer - " to state. See :help Partial for more information. - let cbs.exit_cb = function('s:exit_cb', [], state) - - " explicitly bind close_cb to state so that within it, self will - " always refer to state. See :help Partial for more information. - let cbs.close_cb = function('s:close_cb', [], state) - - function state.show_errors(job, exit_status, data) - if self.for == '_' - return - endif - - let l:winid = win_getid(winnr()) - " Always set the active window to the window that was active when the job - " was started. Among other things, this makes sure that the correct - " window's location list will be populated when the list type is - " 'location' and the user has moved windows since starting the job. - call win_gotoid(self.winid) - - let l:listtype = go#list#Type(self.for) - - let l:preserveerrors = 0 - if has_key(self, 'preserveerrors') - let l:preserveerrors = self.preserveerrors(l:listtype) - endif - - if a:exit_status == 0 - if !l:preserveerrors - call go#list#Clean(l:listtype) - call win_gotoid(l:winid) - endif - return - endif - - let l:listtype = go#list#Type(self.for) - if len(a:data) == 0 - if !l:preserveerrors - call go#list#Clean(l:listtype) - call win_gotoid(l:winid) - endif - return - endif - - let out = join(self.messages, "\n") - - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd' - try - " parse the errors relative to self.jobdir - execute l:cd fnameescape(self.jobdir) - call go#list#ParseFormat(l:listtype, self.errorformat, out, self.for, l:preserveerrors) - let errors = go#list#Get(l:listtype) - finally - execute l:cd fnameescape(self.dir) - endtry - - - if empty(errors) - " failed to parse errors, output the original content - call go#util#EchoError([self.dir] + self.messages) - call win_gotoid(l:winid) - return - endif - - " only open the error window if user was still in the window from which - " the job was started. - if self.winid == l:winid - call go#list#Window(l:listtype, len(errors)) - if self.bang - call win_gotoid(l:winid) - else - call go#list#JumpToFirst(l:listtype) - endif - endif - endfunction - - return cbs -endfunction - -function! s:start(args) dict - if go#config#EchoCommandInfo() && self.statustype != "" - let prefix = '[' . self.statustype . '] ' - call go#util#EchoSuccess(prefix . "dispatched") - endif - - if self.statustype != '' - let status = { - \ 'desc': 'current status', - \ 'type': self.statustype, - \ 'state': "started", - \ } - - call go#statusline#Update(self.jobdir, status) - endif - let self.started_at = reltime() -endfunction - -function! s:callback(chan, msg) dict - call add(self.messages, a:msg) -endfunction - -function! s:exit_cb(job, exitval) dict - let self.exit_status = a:exitval - let self.exited = 1 - - call self.show_status(a:job, a:exitval) - - if self.closed || has('nvim') - call self.complete(a:job, self.exit_status, self.messages) - endif -endfunction - -function! s:close_cb(ch) dict - let self.closed = 1 - - if self.exited - let job = ch_getjob(a:ch) - call self.complete(job, self.exit_status, self.messages) - endif -endfunction - -" go#job#Start runs a job. The options are expected to be the options -" suitable for Vim8 jobs. When called from Neovim, Vim8 options will be -" transformed to their Neovim equivalents. -function! go#job#Start(cmd, options) - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd' - let l:options = copy(a:options) - - if has('nvim') - let l:options = s:neooptions(l:options) - endif - - " Verify that the working directory for the job actually exists. Return - " early if the directory does not exist. This helps avoid errors when - " working with plugins that use virtual files that don't actually exist on - " the file system. - let l:filedir = expand("%:p:h") - if has_key(l:options, 'cwd') && !isdirectory(l:options.cwd) - return - elseif !isdirectory(l:filedir) - return - endif - - let l:manualcd = 0 - if !has_key(l:options, 'cwd') - " pre start - let l:manualcd = 1 - let dir = getcwd() - execute l:cd fnameescape(filedir) - endif - - if has_key(l:options, '_start') - call l:options._start() - " remove _start to play nicely with vim (when vim encounters an unexpected - " job option it reports an "E475: invalid argument" error). - unlet l:options._start - endif - - " noblock was added in 8.1.350; remove it if it's not supported. - if has_key(l:options, 'noblock') && (has('nvim') || !has("patch-8.1.350")) - call remove(l:options, 'noblock') - endif - - if go#util#HasDebug('shell-commands') - call go#util#EchoInfo('job command: ' . string(a:cmd)) - endif - - if has('nvim') - let l:input = [] - if has_key(a:options, 'in_io') && a:options.in_io ==# 'file' && !empty(a:options.in_name) - let l:input = readfile(a:options.in_name, "b") - endif - - let job = jobstart(a:cmd, l:options) - - if len(l:input) > 0 - call chansend(job, l:input) - " close stdin to signal that no more bytes will be sent. - call chanclose(job, 'stdin') - endif - else - let l:cmd = a:cmd - if go#util#IsWin() - let l:cmd = join(map(copy(a:cmd), function('s:winjobarg')), " ") - endif - - let job = job_start(l:cmd, l:options) - endif - - if l:manualcd - " post start - execute l:cd fnameescape(l:dir) - endif - - return job -endfunction - -" s:neooptions returns a dictionary of job options suitable for use by Neovim -" based on a dictionary of job options suitable for Vim8. -function! s:neooptions(options) - let l:options = {} - let l:options['stdout_buf'] = '' - let l:options['stderr_buf'] = '' - - let l:err_mode = get(a:options, 'err_mode', get(a:options, 'mode', '')) - let l:out_mode = get(a:options, 'out_mode', get(a:options, 'mode', '')) - - for key in keys(a:options) - if key == 'cwd' - let l:options['cwd'] = a:options['cwd'] - continue - endif - - if key == 'callback' - let l:options['callback'] = a:options['callback'] - - if !has_key(a:options, 'out_cb') - let l:options['on_stdout'] = function('s:callback2on_stdout', [l:out_mode], l:options) - endif - - if !has_key(a:options, 'err_cb') - let l:options['on_stderr'] = function('s:callback2on_stderr', [l:err_mode], l:options) - endif - - continue - endif - - if key == 'out_cb' - let l:options['out_cb'] = a:options['out_cb'] - let l:options['on_stdout'] = function('s:on_stdout', [l:out_mode], l:options) - - continue - endif - - if key == 'err_cb' - let l:options['err_cb'] = a:options['err_cb'] - let l:options['on_stderr'] = function('s:on_stderr', [l:err_mode], l:options) - - continue - endif - - if key == 'exit_cb' - let l:options['exit_cb'] = a:options['exit_cb'] - let l:options['on_exit'] = function('s:on_exit', [], l:options) - - continue - endif - - if key == 'close_cb' - continue - endif - - if key == 'stoponexit' - if a:options['stoponexit'] == '' - let l:options['detach'] = 1 - endif - continue - endif - endfor - return l:options -endfunction - -function! s:callback2on_stdout(mode, ch, data, event) dict - let self.stdout_buf = s:neocb(a:mode, a:ch, self.stdout_buf, a:data, self.callback) -endfunction - -function! s:callback2on_stderr(mode, ch, data, event) dict - let self.stderr_buf = s:neocb(a:mode, a:ch, self.stderr_buf, a:data, self.callback) -endfunction - -function! s:on_stdout(mode, ch, data, event) dict - let self.stdout_buf = s:neocb(a:mode, a:ch, self.stdout_buf, a:data, self.out_cb) -endfunction - -function! s:on_stderr(mode, ch, data, event) dict - let self.stderr_buf = s:neocb(a:mode, a:ch, self.stderr_buf, a:data, self.err_cb ) -endfunction - -function! s:on_exit(jobid, exitval, event) dict - call self.exit_cb(a:jobid, a:exitval) -endfunction - -function! go#job#Stop(job) abort - if has('nvim') - call jobstop(a:job) - return - endif - - call job_stop(a:job) - call go#job#Wait(a:job) - return -endfunction - -function! go#job#Wait(job) abort - if has('nvim') - call jobwait([a:job]) - return - endif - - while job_status(a:job) is# 'run' - sleep 50m - endwhile -endfunction - -function! s:winjobarg(idx, val) abort - if empty(a:val) - return '""' - endif - return a:val -endfunction - -function! s:neocb(mode, ch, buf, data, callback) - " dealing with the channel lines of Neovim is awful. The docs (:help - " channel-lines) say: - " stream event handlers may receive partial (incomplete) lines. For a - " given invocation of on_stdout etc, `a:data` is not guaranteed to end - " with a newline. - " - `abcdefg` may arrive as `['abc']`, `['defg']`. - " - `abc\nefg` may arrive as `['abc', '']`, `['efg']` or `['abc']`, - " `['','efg']`, or even `['ab']`, `['c','efg']`. - " - " Thankfully, though, this is explained a bit better in an issue: - " https://github.com/neovim/neovim/issues/3555. Specifically in these two - " comments: - " * https://github.com/neovim/neovim/issues/3555#issuecomment-152290804 - " * https://github.com/neovim/neovim/issues/3555#issuecomment-152588749 - " - " The key is - " Every item in the list passed to job control callbacks represents a - " string after a newline(Except the first, of course). If the program - " outputs: "hello\nworld" the corresponding list is ["hello", "world"]. - " If the program outputs "hello\nworld\n", the corresponding list is - " ["hello", "world", ""]. In other words, you can always determine if - " the last line received is complete or not. - " and - " for every list you receive in a callback, all items except the first - " represent newlines. - - let l:buf = '' - - " A single empty string means EOF was reached. The first item will never be - " an empty string except for when it's the only item and is signaling that - " EOF was reached. - if len(a:data) == 1 && a:data[0] == '' - " when there's nothing buffered, return early so that an - " erroneous message will not be added. - if a:buf == '' - return '' - endif - - let l:data = [a:buf] - else - let l:data = copy(a:data) - let l:data[0] = a:buf . l:data[0] - - " The last element may be a partial line; save it for next time. - if a:mode != 'raw' - let l:buf = l:data[-1] - let l:data = l:data[:-2] - endif - endif - - let l:i = 0 - let l:last = len(l:data) - 1 - while l:i <= l:last - let l:msg = l:data[l:i] - if a:mode == 'raw' && l:i < l:last - let l:msg = l:msg . "\n" - endif - call a:callback(a:ch, l:msg) - - let l:i += 1 - endwhile - - return l:buf -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/job_test.vim b/vim-config/plugins/vim-go/autoload/go/job_test.vim deleted file mode 100644 index 42f90ade..00000000 --- a/vim-config/plugins/vim-go/autoload/go/job_test.vim +++ /dev/null @@ -1,53 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_JobDirWithSpaces() - if !go#util#has_job() - return - endif - - try - let l:filename = 'job/dir has spaces/main.go' - let l:tmp = gotest#load_fixture(l:filename) - exe 'cd ' . fnameescape(l:tmp . '/src/job/dir has spaces') - - " set the compiler type so that the errorformat option will be set - " correctly. - compiler go - - let expected = [{'lnum': 4, 'bufnr': bufnr('%'), 'col': 2, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'undefined: notafunc'}] - " clear the quickfix lists - call setqflist([], 'r') - - " go build discards any results when it compiles multiple packages. So we - " pass the `errors` package just as a placeholder with the current folder - " (indicated with '.'). - let l:cmd = ['go', 'build', '.', 'errors'] - - let l:complete = go#promise#New(function('s:complete'), 10000, '') - call go#job#Spawn(l:cmd, { - \ 'for': 'GoBuild', - \ 'complete': l:complete.wrapper, - \ 'statustype': 'build' - \}) - - let l:out = l:complete.await() - - let actual = getqflist() - - call gotest#assert_quickfix(actual, l:expected) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! s:complete(job, exit_code, messages) - return a:messages -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/keyify.vim b/vim-config/plugins/vim-go/autoload/go/keyify.vim deleted file mode 100644 index 41a543f3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/keyify.vim +++ /dev/null @@ -1,64 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#keyify#Keyify() - " Needs: https://github.com/dominikh/go-tools/pull/272 - "\ '-tags', go#config#BuildTags(), - let l:cmd = ['keyify', - \ '-json', - \ printf('%s:#%s', fnamemodify(expand('%'), ':p:gs?\\?/?'), go#util#OffsetCursor())] - - let [l:out, l:err] = go#util#Exec(l:cmd) - if l:err - call go#util#EchoError("non-zero exit code: " . l:out) - return - endif - silent! let result = json_decode(l:out) - - " We want to output the error message in case the result isn't a JSON - if type(result) != type({}) - call go#util#EchoError(s:chomp(l:out)) - return - endif - - " Because keyify returns the byte before the region we want, we goto the - " byte after that - execute "goto" result.start + 1 - let start = getpos('.') - execute "goto" result.end - let end = getpos('.') - - let vis_start = getpos("'<") - let vis_end = getpos("'>") - - " Replace contents between start and end with `replacement` - call setpos("'<", start) - call setpos("'>", end) - - let select = 'gv' - - " Make sure the visual mode is 'v', to avoid some bugs - normal! gv - if mode() !=# 'v' - let select .= 'v' - endif - - silent! execute "normal!" select."\"=result.replacement\p" - - " Replacement text isn't aligned, so it needs fix - normal! '= - - call setpos("'<", vis_start) - call setpos("'>", vis_end) -endfunction - -function! s:chomp(string) - return substitute(a:string, '\n\+$', '', '') -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lint.vim b/vim-config/plugins/vim-go/autoload/go/lint.vim deleted file mode 100644 index 55ccb50e..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lint.vim +++ /dev/null @@ -1,469 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#lint#Gometa(bang, autosave, ...) abort - if a:0 == 0 - let goargs = [expand('%:p:h')] - else - let goargs = a:000 - endif - - let l:metalinter = go#config#MetalinterCommand() - - let cmd = [] - if l:metalinter == 'golangci-lint' - let linters = a:autosave ? go#config#MetalinterAutosaveEnabled() : go#config#MetalinterEnabled() - let cmd = s:metalintercmd(l:metalinter, len(linters) != 0) - if empty(cmd) - return - endif - - " add linters to cmd - for linter in linters - let cmd += ["--enable=".linter] - endfor - elseif l:metalinter != 'gopls' - " the user wants something else, let us use it. - let cmd = split(go#config#MetalinterCommand(), " ") - endif - - if a:autosave - " redraw so that any messages that were displayed while writing the file - " will be cleared - redraw - - if l:metalinter == "golangci-lint" - let goargs[0] = expand('%:p:h') - endif - endif - - " Call metalinter asynchronously. - let deadline = go#config#MetalinterDeadline() - if deadline != '' - let cmd += ["--deadline=" . deadline] - endif - - let cmd += goargs - - let errformat = s:errorformat(l:metalinter) - - if l:metalinter == 'gopls' - if a:autosave - let l:messages = go#lsp#AnalyzeFile(expand('%:p')) - else - let l:import_paths = l:goargs - if len(l:import_paths) == 0 - let l:pkg = go#package#ImportPath() - if l:pkg == -1 - call go#util#EchoError('could not determine package name') - return - endif - - let l:import_paths = [l:pkg] - endif - let l:messages = call('go#lsp#Diagnostics', l:import_paths) - endif - - let l:err = len(l:messages) - else - if go#util#has_job() - if a:autosave - let l:for = 'GoMetaLinterAutoSave' - else - let l:for = 'GoMetaLinter' - endif - - call s:lint_job(l:metalinter, {'cmd': cmd, 'statustype': l:metalinter, 'errformat': errformat, 'for': l:for}, a:bang, a:autosave) - return - endif - - let [l:out, l:err] = go#util#Exec(cmd) - let l:messages = split(out, "\n") - endif - - if a:autosave - let l:listtype = go#list#Type('GoMetaLinterAutoSave') - let l:for = 'GoMetaLinterAutoSave' - else - let l:listtype = go#list#Type('GoMetaLinter') - let l:for = 'GoMetaLinterAuto' - endif - - if l:err == 0 - if !s:preserveerrors(a:autosave, l:listtype) - call go#list#Clean(l:listtype) - endif - call go#util#EchoSuccess('[metalinter] PASS') - else - let l:winid = win_getid(winnr()) - " Parse and populate our location list - - if a:autosave - call s:metalinterautosavecomplete(l:metalinter, fnamemodify(expand('%:p'), ":."), 0, 1, l:messages) - endif - call go#list#ParseFormat(l:listtype, errformat, l:messages, l:for, s:preserveerrors(a:autosave, l:listtype)) - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) - - if a:autosave || a:bang - call win_gotoid(l:winid) - else - call go#list#JumpToFirst(l:listtype) - endif - endif -endfunction - -function! go#lint#Diagnostics(bang, ...) abort - if a:0 == 0 - let l:pkg = go#package#ImportPath() - if l:pkg == -1 - call go#util#EchoError('could not determine package name') - return - endif - - let l:import_paths = [l:pkg] - else - let l:import_paths = a:000 - endif - - let errformat = s:errorformat('gopls') - - let l:messages = call('go#lsp#Diagnostics', l:import_paths) - - let l:listtype = go#list#Type("GoDiagnostics") - - if len(l:messages) == 0 - call go#list#Clean(l:listtype) - call go#util#EchoSuccess('[diagnostics] PASS') - else - " Parse and populate the quickfix list - let l:winid = win_getid(winnr()) - call go#list#ParseFormat(l:listtype, errformat, l:messages, 'GoDiagnostics', 0) - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) - - if a:bang - call win_gotoid(l:winid) - else - call go#list#JumpToFirst(l:listtype) - endif - endif -endfunction - -" Golint calls 'golint' on the current directory. Any warnings are populated in -" the location list -function! go#lint#Golint(bang, ...) abort - call go#cmd#autowrite() - - let l:type = 'golint' - let l:status = { - \ 'desc': 'current status', - \ 'type': l:type, - \ 'state': "started", - \ } - if go#config#EchoCommandInfo() - call go#util#EchoProgress(printf('[%s] analyzing...', l:type)) - endif - call go#statusline#Update(expand('%:p:h'), l:status) - - if a:0 == 0 - let [l:out, l:err] = go#util#Exec([go#config#GolintBin(), expand('%:p:h')]) - else - let [l:out, l:err] = go#util#Exec([go#config#GolintBin()] + a:000) - endif - - let l:status.state = 'success' - let l:state = 'PASS' - let l:listtype = go#list#Type("GoLint") - if !empty(l:out) - let l:status.state = 'failed' - let l:state = 'FAIL' - - let l:winid = win_getid(winnr()) - call go#list#Parse(l:listtype, l:out, "GoLint", 0) - let l:errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(l:errors)) - - if a:bang - call win_gotoid(l:winid) - else - call go#list#JumpToFirst(l:listtype) - endif - if go#config#EchoCommandInfo() - call go#util#EchoError(printf('[%s] %s', l:type, l:state)) - endif - else - call go#list#Clean(l:listtype) - if go#config#EchoCommandInfo() - call go#util#EchoSuccess(printf('[%s] %s', l:type, l:state)) - endif - endif - call go#statusline#Update(expand('%:p:h'), l:status) -endfunction - -" Vet calls 'go vet' on the current buffer's directory. Any warnings are -" populated in the location list -function! go#lint#Vet(bang, ...) abort - call go#cmd#autowrite() - - let l:cmd = ['go', 'vet'] - - let buildtags = go#config#BuildTags() - if buildtags isnot '' - let l:cmd += ['-tags', buildtags] - endif - - if a:0 == 0 - let l:import_path = go#package#ImportPath() - if l:import_path == -1 - call go#util#EchoError('could not determine package') - return - endif - let l:cmd = add(l:cmd, l:import_path) - else - let l:cmd = extend(l:cmd, a:000) - endif - - let l:type = 'go vet' - if go#config#EchoCommandInfo() - call go#util#EchoProgress(printf('[%s] analyzing...', l:type)) - endif - let l:status = { - \ 'desc': 'current status', - \ 'type': l:type, - \ 'state': "started", - \ } - call go#statusline#Update(expand('%:p:h'), l:status) - - let [l:out, l:err] = go#util#ExecInDir(l:cmd) - - let l:status.state = 'success' - let l:state = 'PASS' - - let l:listtype = go#list#Type("GoVet") - if l:err != 0 - let l:status.state = 'failed' - let l:state = 'FAIL' - - let l:winid = win_getid(winnr()) - let l:errorformat = "%-Gexit status %\\d%\\+," . &errorformat - let l:dir = getcwd() - call go#util#Chdir(expand('%:p:h')) - try - call go#list#ParseFormat(l:listtype, l:errorformat, out, "GoVet", 0) - finally - call go#util#Chdir(l:dir) - endtry - let l:errors = go#list#Get(l:listtype) - - if empty(l:errors) - call go#util#EchoError(l:out) - return - endif - - call go#list#Window(l:listtype, len(l:errors)) - if !empty(l:errors) && !a:bang - call go#list#JumpToFirst(l:listtype) - else - call win_gotoid(l:winid) - endif - - if go#config#EchoCommandInfo() - call go#util#EchoError(printf('[%s] %s', l:type, l:state)) - endif - else - call go#list#Clean(l:listtype) - if go#config#EchoCommandInfo() - call go#util#EchoSuccess(printf('[%s] %s', l:type, l:state)) - endif - endif - call go#statusline#Update(expand('%:p:h'), l:status) -endfunction - -" ErrCheck calls 'errcheck' for the given packages. Any warnings are populated in -" the location list -function! go#lint#Errcheck(bang, ...) abort - call go#cmd#autowrite() - - let l:cmd = [go#config#ErrcheckBin(), '-abspath'] - - let buildtags = go#config#BuildTags() - if buildtags isnot '' - let l:cmd += ['-tags', buildtags] - endif - - if a:0 == 0 - let l:import_path = go#package#ImportPath() - if l:import_path == -1 - call go#util#EchoError('could not determine package') - return - endif - let l:cmd = add(l:cmd, l:import_path) - else - let l:cmd = extend(l:cmd, a:000) - endif - - let l:type = 'errcheck' - if go#config#EchoCommandInfo() - call go#util#EchoProgress(printf('[%s] analyzing...', l:type)) - endif - let l:status = { - \ 'desc': 'current status', - \ 'type': l:type, - \ 'state': "started", - \ } - redraw - - call go#statusline#Update(expand('%:p:h'), l:status) - - let [l:out, l:err] = go#util#ExecInDir(l:cmd) - - let l:status.state = 'success' - let l:state = 'PASS' - - let l:listtype = go#list#Type("GoErrCheck") - if l:err != 0 - let l:status.state = 'failed' - let l:state = 'FAIL' - - let l:winid = win_getid(winnr()) - - if l:err == 1 - let l:errformat = "%f:%l:%c:\ %m,%f:%l:%c\ %#%m" - " Parse and populate our location list - call go#list#ParseFormat(l:listtype, l:errformat, split(out, "\n"), 'Errcheck', 0) - endif - - let l:errors = go#list#Get(l:listtype) - if empty(l:errors) - call go#util#EchoError(l:out) - return - endif - - if !empty(errors) - call go#list#Populate(l:listtype, l:errors, 'Errcheck') - call go#list#Window(l:listtype, len(l:errors)) - if !a:bang - call go#list#JumpToFirst(l:listtype) - else - call win_gotoid(l:winid) - endif - endif - if go#config#EchoCommandInfo() - call go#util#EchoError(printf('[%s] %s', l:type, l:state)) - endif - else - call go#list#Clean(l:listtype) - if go#config#EchoCommandInfo() - call go#util#EchoSuccess(printf('[%s] %s', l:type, l:state)) - endif - endif - call go#statusline#Update(expand('%:p:h'), l:status) -endfunction - -function! go#lint#ToggleMetaLinterAutoSave() abort - if go#config#MetalinterAutosave() - call go#config#SetMetalinterAutosave(0) - call go#util#EchoProgress("auto metalinter disabled") - return - end - - call go#config#SetMetalinterAutosave(1) - call go#util#EchoProgress("auto metalinter enabled") -endfunction - -function! s:lint_job(metalinter, args, bang, autosave) - let l:opts = { - \ 'statustype': a:args.statustype, - \ 'errorformat': a:args.errformat, - \ 'for': 'GoMetaLinter', - \ 'bang': a:bang, - \ } - - if a:autosave - let l:opts.for = 'GoMetaLinterAutoSave' - " s:metalinterautosavecomplete is really only needed for golangci-lint - let l:opts.complete = funcref('s:metalinterautosavecomplete', [a:metalinter, expand('%:p:t')]) - let l:opts.preserveerrors = funcref('s:preserveerrors', [a:autosave]) - endif - - " autowrite is not enabled for jobs - call go#cmd#autowrite() - - call go#job#Spawn(a:args.cmd, l:opts) -endfunction - -function! s:metalintercmd(metalinter, haslinter) - let l:cmd = [] - let bin_path = go#path#CheckBinPath(a:metalinter) - if !empty(bin_path) - if a:metalinter == "golangci-lint" - let l:cmd = s:golangcilintcmd(bin_path, a:haslinter) - endif - endif - - return cmd -endfunction - -function! s:golangcilintcmd(bin_path, haslinter) - let cmd = [a:bin_path] - let cmd += ["run"] - let cmd += ["--print-issued-lines=false"] - let cmd += ['--build-tags', go#config#BuildTags()] - " do not use the default exclude patterns, because doing so causes golint - " problems about missing doc strings to be ignored and other things that - " golint identifies. - let cmd += ["--exclude-use-default=false"] - - if a:haslinter - let cmd += ["--disable-all"] - endif - - return cmd -endfunction - -function! s:metalinterautosavecomplete(metalinter, filepath, job, exit_code, messages) - if a:metalinter != 'golangci-lint' - return - endif - - if len(a:messages) == 0 - return - endif - - let l:idx = len(a:messages) - 1 - while l:idx >= 0 - " leave in any messages that report errors about a:filepath or that report - " more general problems that prevent golangci-lint from linting - " a:filepath. - if a:messages[l:idx] !~# '^' . a:filepath . ':' && a:messages[l:idx] !~# '^level=' - call remove(a:messages, l:idx) - endif - let l:idx -= 1 - endwhile -endfunction - -function! s:errorformat(metalinter) abort - if a:metalinter == 'golangci-lint' - " Golangci-lint can output the following: - " ::: () - " This can be defined by the following errorformat: - return 'level=%tarning\ msg="%m:\ [%f:%l:%c:\ %.%#]",level=%tarning\ msg="%m",level=%trror\ msg="%m:\ [%f:%l:%c:\ %.%#]",level=%trror\ msg="%m",%f:%l:%c:\ %m,%f:%l\ %m' - elseif a:metalinter == 'gopls' - return '%f:%l:%c:%t:\ %m,%f:%l:%c::\ %m' - endif - -endfunction - -function! s:preserveerrors(autosave, listtype) abort - return a:autosave && a:listtype == go#list#Type("GoFmt") && go#config#FmtAutosave() && isdirectory(expand('%:p:h')) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lint_test.vim b/vim-config/plugins/vim-go/autoload/go/lint_test.vim deleted file mode 100644 index 6c556d3b..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lint_test.vim +++ /dev/null @@ -1,490 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_GometaGolangciLint() abort - call s:gometa('golangci-lint') -endfunc - -func! s:gometa(metalinter) abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnamemodify(getcwd(), ':p') . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/lint/lint.go' - - try - let g:go_metalinter_command = a:metalinter - let expected = [ - \ {'lnum': 5, 'bufnr': bufnr('%')+1, 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'w', 'pattern': '', 'text': 'exported function MissingFooDoc should have comment or be unexported (golint)'} - \ ] - if a:metalinter == 'golangci-lint' - let expected = [ - \ {'lnum': 5, 'bufnr': bufnr('%')+5, 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exported function `MissingFooDoc` should have comment or be unexported (golint)'} - \ ] - endif - - " clear the quickfix lists - call setqflist([], 'r') - - let g:go_metalinter_enabled = ['golint'] - - call go#lint#Gometa(0, 0, $GOPATH . '/src/foo') - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call call(RestoreGOPATH, []) - unlet g:go_metalinter_enabled - endtry -endfunc - -func! Test_GometaGolangciLint_shadow() abort - call s:gometa_shadow('golangci-lint') -endfunc - -func! s:gometa_shadow(metalinter) abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnamemodify(getcwd(), ':p') . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/lint/golangci-lint/problems/shadow/problems.go' - - try - let g:go_metalinter_command = a:metalinter - let expected = [ - \ {'lnum': 4, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'w', 'module': '', 'text': '[runner] Can''t run linter golint: golint: analysis skipped: errors in package'}, - \ {'lnum': 4, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'e', 'module': '', 'text': 'Running error: golint: analysis skipped: errors in package'} - \ ] - - " clear the quickfix lists - call setqflist([], 'r') - - let g:go_metalinter_enabled = ['golint'] - - call go#lint#Gometa(0, 0) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call call(RestoreGOPATH, []) - unlet g:go_metalinter_enabled - endtry -endfunc - -func! Test_GometaAutoSaveGolangciLint() abort - call s:gometaautosave('golangci-lint', 0) -endfunc - -func! Test_GometaAutoSaveKeepsErrors() abort - call s:gometaautosave('golangci-lint', 1) -endfunc - -func! s:gometaautosave(metalinter, withList) abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/lint/lint.go' - - try - let g:go_metalinter_command = a:metalinter - let l:expected = [ - \ {'lnum': 5, 'bufnr': bufnr('%'), 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'w', 'pattern': '', 'text': 'exported function MissingDoc should have comment or be unexported (golint)'} - \ ] - if a:metalinter == 'golangci-lint' - let l:expected = [ - \ {'lnum': 5, 'bufnr': bufnr('%'), 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exported function `MissingDoc` should have comment or be unexported (golint)'} - \ ] - endif - - let l:list = [] - if a:withList - let l:list = [ - \ {'lnum': 1, 'bufnr': 1, 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'before metalinter'} - \ ] - let l:expected = extend(l:list, l:expected) - endif - - " set the location lists - call setloclist(0, l:list, 'r') - - let g:go_metalinter_autosave_enabled = ['golint'] - - call go#lint#Gometa(0, 1) - - let l:actual = getloclist(0) - let l:start = reltime() - while len(l:actual) != len(l:expected) && reltimefloat(reltime(l:start)) < 10 - sleep 100m - let l:actual = getloclist(0) - endwhile - - call gotest#assert_quickfix(l:actual, l:expected) - finally - call call(RestoreGOPATH, []) - unlet g:go_metalinter_autosave_enabled - endtry -endfunc - -func! Test_GometaGolangciLint_importabs() abort - call s:gometa_importabs('golangci-lint') -endfunc - -func! s:gometa_importabs(metalinter) abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnamemodify(getcwd(), ':p') . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/lint/golangci-lint/problems/importabs/problems.go' - - try - let g:go_metalinter_command = a:metalinter - let expected = [ - \ {'lnum': 3, 'bufnr': bufnr('%'), 'col': 8, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'w', 'module': '', 'text': '[runner] Can''t run linter golint: golint: analysis skipped: errors in package'}, - \ {'lnum': 3, 'bufnr': bufnr('%'), 'col': 8, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'e', 'module': '', 'text': 'Running error: golint: analysis skipped: errors in package'}, - \ ] - " clear the quickfix lists - call setqflist([], 'r') - - let g:go_metalinter_enabled = ['golint'] - - call go#lint#Gometa(0, 0) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call call(RestoreGOPATH, []) - unlet g:go_metalinter_enabled - endtry -endfunc - -func! Test_GometaAutoSaveGolangciLint_importabs() abort - call s:gometaautosave_importabs('golangci-lint') -endfunc - -func! s:gometaautosave_importabs(metalinter) abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/lint/golangci-lint/problems/importabs/ok.go' - - try - let g:go_metalinter_command = a:metalinter - let expected = [ - \ {'lnum': 3, 'bufnr': bufnr('%')+1, 'col': 8, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'w', 'module': '', 'text': '[runner] Can''t run linter golint: golint: analysis skipped: errors in package'}, - \ {'lnum': 3, 'bufnr': bufnr('%')+1, 'col': 8, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'e', 'module': '', 'text': 'Running error: golint: analysis skipped: errors in package'} - \ ] - - " clear the location lists - call setloclist(0, [], 'r') - - let g:go_metalinter_autosave_enabled = ['golint'] - - call go#lint#Gometa(0, 1) - - let actual = getloclist(0) - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getloclist(0) - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call call(RestoreGOPATH, []) - unlet g:go_metalinter_autosave_enabled - endtry -endfunc - -func! Test_GometaGolangciLint_multiple() abort - call s:gometa_multiple('golangci-lint') -endfunc - -func! s:gometa_multiple(metalinter) abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnamemodify(getcwd(), ':p') . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/lint/golangci-lint/problems/multiple/problems.go' - - try - let g:go_metalinter_command = a:metalinter - let expected = [ - \ {'lnum': 8, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'w', 'module': '', 'text': '[runner] Can''t run linter golint: golint: analysis skipped: errors in package'}, - \ {'lnum': 8, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'e', 'module': '', 'text': 'Running error: golint: analysis skipped: errors in package'}, - \ ] - " clear the quickfix lists - call setqflist([], 'r') - - let g:go_metalinter_enabled = ['golint'] - - call go#lint#Gometa(0, 0) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call call(RestoreGOPATH, []) - unlet g:go_metalinter_enabled - endtry -endfunc - -func! Test_GometaAutoSaveGolangciLint_multiple() abort - call s:gometaautosave_multiple('golangci-lint') -endfunc - -func! s:gometaautosave_multiple(metalinter) abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/lint/golangci-lint/problems/multiple/problems.go' - - try - let g:go_metalinter_command = a:metalinter - let expected = [ - \ {'lnum': 8, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'w', 'module': '', 'text': '[runner] Can''t run linter golint: golint: analysis skipped: errors in package'}, - \ {'lnum': 8, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'e', 'module': '', 'text': 'Running error: golint: analysis skipped: errors in package'}, - \ ] - - " clear the location lists - call setloclist(0, [], 'r') - - let g:go_metalinter_autosave_enabled = ['golint'] - - call go#lint#Gometa(0, 1) - - let actual = getloclist(0) - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getloclist(0) - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call call(RestoreGOPATH, []) - unlet g:go_metalinter_autosave_enabled - endtry -endfunc - -func! Test_Vet() abort - let l:tmp = gotest#load_fixture('lint/src/vet/vet.go') - - try - let expected = [ - \ {'lnum': 7, 'bufnr': bufnr('%'), 'col': 2, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', - \ 'text': 'Printf format %d has arg str of wrong type string'} - \ ] - - let winnr = winnr() - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Vet(1) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_Vet_subdir() abort - let l:tmp = gotest#load_fixture('lint/src/vet/vet.go') - - " go up one directory to easily test that go vet's file paths are handled - " correctly when the working directory is not the directory that contains - " the file being vetted. - call go#util#Chdir('..') - - try - let expected = [ - \ {'lnum': 7, 'bufnr': bufnr('%'), 'col': 2, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', - \ 'text': 'Printf format %d has arg str of wrong type string'} - \ ] - - let winnr = winnr() - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Vet(1) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_Vet_compilererror() abort - let l:tmp = gotest#load_fixture('lint/src/vet/compilererror/compilererror.go') - - try - let expected = [ - \ {'lnum': 6, 'bufnr': bufnr('%'), 'col': 22, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': "missing ',' before newline in argument list (and 1 more errors)"} - \ ] - - let winnr = winnr() - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Vet(1) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_Lint_GOPATH() abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/lint') - - silent exe 'e ' . $GOPATH . '/src/lint/lint.go' - compiler go - - let expected = [ - \ {'lnum': 5, 'bufnr': bufnr('%'), 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exported function MissingDoc should have comment or be unexported'}, - \ {'lnum': 5, 'bufnr': bufnr('%')+7, 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exported function AlsoMissingDoc should have comment or be unexported'} - \ ] - - let winnr = winnr() - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Golint(1) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) - - call call(RestoreGOPATH, []) -endfunc - -func! Test_Lint_NullModule() abort - silent exe 'e ' . fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/lint/src/lint/lint.go' - compiler go - - let expected = [ - \ {'lnum': 5, 'bufnr': bufnr('%'), 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exported function MissingDoc should have comment or be unexported'}, - \ {'lnum': 5, 'bufnr': bufnr('%')+7, 'col': 1, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exported function AlsoMissingDoc should have comment or be unexported'} - \ ] - - let winnr = winnr() - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Golint(1) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - call gotest#assert_quickfix(actual, expected) -endfunc - -func! Test_Errcheck() abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnamemodify(getcwd(), ':p') . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/errcheck/errcheck.go' - - try - let l:bufnr = bufnr('') - let expected = [ - \ {'lnum': 9, 'bufnr': bufnr(''), 'col': 9, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': ":\tio.Copy(os.Stdout, os.Stdin)"}, - \ {'lnum': 10, 'bufnr': bufnr('')+1, 'col': 9, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': ":\tio.Copy(os.Stdout, os.Stdin)"}, - \ ] - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Errcheck(1) - - call gotest#assert_quickfix(getqflist(), expected) - call assert_equal(l:bufnr, bufnr('')) - finally - call call(RestoreGOPATH, []) - endtry -endfunc - -func! Test_Errcheck_options() abort - let RestoreGOPATH = go#util#SetEnv('GOPATH', fnamemodify(getcwd(), ':p') . 'test-fixtures/lint') - silent exe 'e ' . $GOPATH . '/src/errcheck/errcheck.go' - - try - let l:bufnr = bufnr('') - let expected = [ - \ {'lnum': 9, 'bufnr': bufnr(''), 'col': 9, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': ":\tio.Copy(os.Stdout, os.Stdin)"}, - \ ] - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Errcheck(1, '-ignoretests') - - call gotest#assert_quickfix(getqflist(), expected) - call assert_equal(l:bufnr, bufnr('')) - finally - call call(RestoreGOPATH, []) - endtry -endfunc - -func! Test_Errcheck_compilererror() abort - let l:tmp = gotest#load_fixture('lint/src/errcheck/compilererror/compilererror.go') - - try - let l:bufnr = bufnr('') - let expected = [] - - " clear the location lists - call setqflist([], 'r') - - call go#lint#Errcheck(1) - - call gotest#assert_quickfix(getqflist(), expected) - call assert_equal(l:bufnr, bufnr('')) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/list.vim b/vim-config/plugins/vim-go/autoload/go/list.vim deleted file mode 100644 index e7002034..00000000 --- a/vim-config/plugins/vim-go/autoload/go/list.vim +++ /dev/null @@ -1,189 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" Window opens the list with the given height up to 10 lines maximum. -" Otherwise g:go_loclist_height is used. -" -" If no or zero height is given it closes the window by default. -" To prevent this, set g:go_list_autoclose = 0 -function! go#list#Window(listtype, ...) abort - " we don't use lwindow to close the location list as we need also the - " ability to resize the window. So, we are going to use lopen and lclose - " for a better user experience. If the number of errors in a current - " location list increases/decreases, cwindow will not resize when a new - " updated height is passed. lopen in the other hand resizes the screen. - if !a:0 || a:1 == 0 - call go#list#Close(a:listtype) - return - endif - - let height = go#config#ListHeight() - if height == 0 - " prevent creating a large location height for a large set of numbers - if a:1 > 10 - let height = 10 - else - let height = a:1 - endif - endif - - if a:listtype == "locationlist" - exe 'lopen ' . height - else - exe 'copen ' . height - endif -endfunction - - -" Get returns the current items from the list -function! go#list#Get(listtype) abort - if a:listtype == "locationlist" - return getloclist(0) - else - return getqflist() - endif -endfunction - -" Populate populate the list with the given items -function! go#list#Populate(listtype, items, title) abort - if a:listtype == "locationlist" - call setloclist(0, a:items, 'r') - call setloclist(0, [], 'a', {'title': a:title}) - else - call setqflist(a:items, 'r') - call setqflist([], 'a', {'title': a:title}) - endif -endfunction - -" Parse parses the given items based on the specified errorformat and -" populates the list. -function! go#list#ParseFormat(listtype, errformat, items, title, add) abort - " backup users errorformat, will be restored once we are finished - let old_errorformat = &errorformat - - " parse and populate the location list - let &errorformat = a:errformat - try - call go#list#Parse(a:listtype, a:items, a:title, a:add) - finally - "restore back - let &errorformat = old_errorformat - endtry -endfunction - -" Parse parses the given items based on the global errorformat and -" populates the list. -function! go#list#Parse(listtype, items, title, add) abort - let l:list = [] - if a:add - let l:list = go#list#Get(a:listtype) - endif - - if a:listtype == "locationlist" - if a:add - laddexpr a:items - else - lgetexpr a:items - endif - call setloclist(0, [], 'a', {'title': a:title}) - else - if a:add - caddexpr a:items - else - cgetexpr a:items - endif - call setqflist([], 'a', {'title': a:title}) - endif -endfunction - -" JumpToFirst jumps to the first item in the location list -function! go#list#JumpToFirst(listtype) abort - if a:listtype == "locationlist" - ll 1 - else - cc 1 - endif -endfunction - -" Clean cleans and closes the location list -function! go#list#Clean(listtype) abort - if a:listtype == "locationlist" - lex [] - else - cex [] - endif - - call go#list#Close(a:listtype) -endfunction - -" Close closes the location list -function! go#list#Close(listtype) abort - let autoclose_window = go#config#ListAutoclose() - if !autoclose_window - return - endif - - if a:listtype == "locationlist" - lclose - else - cclose - endif -endfunction - -function! s:listtype(listtype) abort - let listtype = go#config#ListType() - if empty(listtype) - return a:listtype - endif - - return listtype -endfunction - -" s:default_list_type_commands is the defaults that will be used for each of -" the supported commands (see documentation for g:go_list_type_commands). When -" defining a default, quickfix should be used if the command operates on -" multiple files, while locationlist should be used if the command operates on a -" single file or buffer. Keys that begin with an underscore are not supported -" in g:go_list_type_commands. -let s:default_list_type_commands = { - \ "GoBuild": "quickfix", - \ "GoDiagnostics": "quickfix", - \ "GoDebug": "quickfix", - \ "GoErrCheck": "quickfix", - \ "GoFmt": "locationlist", - \ "GoGenerate": "quickfix", - \ "GoInstall": "quickfix", - \ "GoLint": "quickfix", - \ "GoMetaLinter": "quickfix", - \ "GoMetaLinterAutoSave": "locationlist", - \ "GoModFmt": "locationlist", - \ "GoModifyTags": "locationlist", - \ "GoRename": "quickfix", - \ "GoRun": "quickfix", - \ "GoTest": "quickfix", - \ "GoVet": "quickfix", - \ "GoReferrers": "locationlist", - \ "GoImplements": "locationlist", - \ "_guru": "locationlist", - \ "_term": "locationlist", - \ "_job": "locationlist", - \ } - -function! go#list#Type(for) abort - let l:listtype = s:listtype(get(s:default_list_type_commands, a:for)) - if l:listtype == "0" - call go#util#EchoError(printf( - \ "unknown list type command value found ('%s'). Please open a bug report in the vim-go repo.", - \ a:for)) - let l:listtype = "quickfix" - endif - - return get(go#config#ListTypeCommands(), a:for, l:listtype) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lsp.vim b/vim-config/plugins/vim-go/autoload/go/lsp.vim deleted file mode 100644 index 235c7fa2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lsp.vim +++ /dev/null @@ -1,1584 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -let s:lspfactory = {} - -function! s:lspfactory.get() dict abort - if empty(get(self, 'current', {})) || empty(get(self.current, 'job', {})) - let self.current = s:newlsp() - endif - - return self.current -endfunction - -function! s:lspfactory.reset() dict abort - if has_key(self, 'current') - call remove(self, 'current') - endif -endfunction - -function! s:newlsp() abort - " job is the job used to talk to the backing instance of gopls. - " ready is 0 until the initialize response has been received. 1 afterwards. - " queue is messages to send after initialization - " last_request_id is id of the most recently sent request. - " buf is unprocessed/incomplete responses - " handlers is a mapping of request ids to dictionaries of functions. - " request id -> {start, requestComplete, handleResult, error} - " * start is a function that takes no arguments - " * requestComplete is a function that takes 1 argument. The parameter will be 1 - " if the call was succesful. - " * handleResult takes a single argument, the result message received from gopls - " * error takes a single argument, the error message received from gopls. - " The error method is optional. - " workspaceDirectories is an array of named workspaces. - " wd is the working directory for gopls - " diagnostics is a dictionary whose keys are filenames and each value is a - " list of diagnostic messages for the file. - " diagnosticsQueue is a queue of diagnostics notifications that have been - " received, but not yet processed. - " fileVersions is a dictionary of filenames to versions. - " notificationQueue is a dictionary of filenames to functions. For a given - " filename, each notification will call the first function in the list of - " function values and remove it from the list. The functions should accept - " two arguments: an absolute path and a list of diagnotics messages for - " the file. - let l:lsp = { - \ 'job': '', - \ 'ready': 0, - \ 'queue': [], - \ 'last_request_id': 0, - \ 'buf': '', - \ 'handlers': {}, - \ 'workspaceDirectories': [], - \ 'wd' : '', - \ 'diagnosticsQueue': [], - \ 'diagnostics': {}, - \ 'fileVersions': {}, - \ 'notificationQueue': {}, - \ } - - if !go#config#GoplsEnabled() - let l:lsp.sendMessage = funcref('s:noop') - return l:lsp - endif - - if !go#util#has_job() - let l:oldshortmess=&shortmess - if has('nvim') - set shortmess-=F - endif - call go#util#EchoWarning('Features that rely on gopls will not work without either Vim 8.0.0087 or newer with +job or Neovim') - " Sleep one second to make sure people see the message. Otherwise it is - " often immediately overwritten by an async message. - sleep 1 - let &shortmess=l:oldshortmess - return l:lsp - endif - - function! l:lsp.readMessage(data) dict abort - let l:responses = [] - let l:rest = a:data - - while 1 - " Look for the end of the HTTP headers - let l:body_start_idx = matchend(l:rest, "\r\n\r\n") - - if l:body_start_idx < 0 - " incomplete header - break - endif - - " Parse the Content-Length header. - let l:header = l:rest[:l:body_start_idx - 4] - let l:length_match = matchlist( - \ l:header, - \ '\vContent-Length: *(\d+)' - \) - - if empty(l:length_match) - " TODO(bc): shutdown gopls? - throw "invalid JSON-RPC header:\n" . l:header - endif - - " get the start of the rest - let l:next_start_idx = l:body_start_idx + str2nr(l:length_match[1]) - - if len(l:rest) < l:next_start_idx - " incomplete response body - break - endif - - call s:debug('received', l:rest[:l:next_start_idx - 1]) - - let l:body = l:rest[l:body_start_idx : l:next_start_idx - 1] - let l:rest = l:rest[l:next_start_idx :] - - try - " add the json body to the list. - call add(l:responses, json_decode(l:body)) - catch - " TODO(bc): log the message and/or show an error message. - finally - " intentionally left blank. - endtry - endwhile - - return [l:rest, l:responses] - endfunction - - function! l:lsp.handleMessage(ch, data) dict abort - let self.buf .= a:data - - let [self.buf, l:messages] = self.readMessage(self.buf) - - for l:message in l:messages - if has_key(l:message, 'method') - if has_key(l:message, 'id') - call self.handleRequest(l:message) - else - call self.handleNotification(l:message) - endif - elseif has_key(l:message, 'result') || has_key(l:message, 'error') - call self.handleResponse(l:message) - endif - endfor - endfunction - - function! l:lsp.handleRequest(req) dict abort - if a:req.method == 'workspace/workspaceFolders' - let l:resp = go#lsp#message#WorkspaceFoldersResult(self.workspaceDirectories) - elseif a:req.method == 'workspace/configuration' && has_key(a:req, 'params') && has_key(a:req.params, 'items') - let l:resp = go#lsp#message#ConfigurationResult(a:req.params.items) - elseif a:req.method == 'client/registerCapability' && has_key(a:req, 'params') && has_key(a:req.params, 'registrations') - let l:resp = v:null - else - return - endif - - if get(self, 'exited', 0) - return - endif - - let l:msg = self.newResponse(a:req.id, l:resp) - call self.write(l:msg) - endfunction - - function! l:lsp.handleResponse(resp) dict abort - if has_key(a:resp, 'id') && has_key(self.handlers, a:resp.id) - try - let l:handler = self.handlers[a:resp.id] - - let l:winid = win_getid(winnr()) - " Always set the active window to the window that was active when - " the request was sent. Among other things, this makes sure that - " the correct window's location list will be populated when the - " list type is 'location' and the user has moved windows since - " sending the request. - call win_gotoid(l:handler.winid) - - if has_key(a:resp, 'error') - call l:handler.requestComplete(0) - if has_key(l:handler, 'error') - call call(l:handler.error, [a:resp.error.message]) - else - call go#util#EchoError(a:resp.error.message) - endif - call win_gotoid(l:winid) - return - endif - call l:handler.requestComplete(1) - - let l:winidBeforeHandler = l:handler.winid - call call(l:handler.handleResult, [a:resp.result]) - - " change the window back to the window that was active when - " starting to handle the message _only_ if the handler didn't - " update the winid, so that handlers can set the winid if needed - " (e.g. :GoDef). - if l:handler.winid == l:winidBeforeHandler - call win_gotoid(l:winid) - endif - finally - call remove(self.handlers, a:resp.id) - endtry - endif - endfunction - - function! l:lsp.handleNotification(req) dict abort - " TODO(bc): handle more notifications (e.g. window/showMessage). - if a:req.method == 'textDocument/publishDiagnostics' - call self.handleDiagnostics(a:req.params) - endif - endfunction - - function! l:lsp.handleDiagnostics(data) dict abort - let self.diagnosticsQueue = add(self.diagnosticsQueue, a:data) - call self.updateDiagnostics() - endfunction - - " TODO(bc): process the queue asynchronously - function! l:lsp.updateDiagnostics() dict abort - for l:data in self.diagnosticsQueue - call remove(self.diagnosticsQueue, 0) - - try - let l:diagnostics = [] - let l:errorMatches = [] - let l:warningMatches = [] - let l:fname = go#path#FromURI(l:data.uri) - - " get the buffer name relative to the current directory, because - " Vim says that a buffer name can't be an absolute path. - let l:bufname = fnamemodify(l:fname, ':.') - - if len(l:data.diagnostics) > 0 && (go#config#DiagnosticsEnabled() || bufnr(l:bufname) == bufnr('')) - " make sure the buffer is listed and loaded before calling getbufline() on it - if !bufexists(l:bufname) - "let l:starttime = reltime() - call bufadd(l:bufname) - endif - - if !bufloaded(l:bufname) - "let l:starttime = reltime() - call bufload(l:bufname) - endif - - for l:diag in l:data.diagnostics - " TODO(bc): cache the raw diagnostics when they're not for the - " current buffer so that they can be processed when it is the - " current buffer and highlight the areas of concern. - let [l:error, l:matchpos] = s:errorFromDiagnostic(l:diag, l:bufname, l:fname) - let l:diagnostics = add(l:diagnostics, l:error) - - if empty(l:matchpos) - continue - endif - - if l:diag.severity == 1 - let l:errorMatches = add(l:errorMatches, l:matchpos) - elseif l:diag.severity == 2 - let l:warningMatches = add(l:warningMatches, l:matchpos) - endif - endfor - endif - - if bufnr(l:bufname) == bufnr('') - " only apply highlighting when the diagnostics are for the current - " version. - let l:lsp = s:lspfactory.get() - let l:version = get(l:lsp.fileVersions, l:fname, 0) - " it's tempting to only highlight matches when they are for the - " current version of the buffer, but that causes problems when the - " version number has been updated and the content has not. In such a - " case, the diagnostics may not be sent for later versions. - call s:highlightMatches(l:errorMatches, l:warningMatches) - endif - - let self.diagnostics[l:fname] = l:diagnostics - if has_key(self.notificationQueue, l:fname) && len(self.notificationQueue[l:fname]) > 0 - call call(self.notificationQueue[l:fname][0], copy(l:diagnostics)) - call remove(self.notificationQueue[l:fname], 0) - endif - catch - call go#util#EchoError(printf('%s: %s', v:throwpoint, v:exception)) - endtry - endfor - endfunction - - function! l:lsp.handleInitializeResult(result) dict abort - if go#config#EchoCommandInfo() - call go#util#EchoProgress("initialized gopls") - endif - let status = { - \ 'desc': '', - \ 'type': 'gopls', - \ 'state': 'initialized', - \ } - call go#statusline#Update(self.wd, status) - - let self.ready = 1 - let l:msg = self.newMessage(go#lsp#message#Initialized()) - call self.write(l:msg) - - " send messages queued while waiting for ready. - for l:item in self.queue - call self.sendMessage(l:item.data, l:item.handler) - endfor - - " reset the queue - let self.queue = [] - endfunction - - function! l:lsp.sendMessage(data, handler) dict abort - if !self.last_request_id - let l:wd = go#util#ModuleRoot() - if l:wd == -1 - call go#util#EchoError('could not determine appropriate working directory for gopls') - return -1 - endif - - if l:wd == '' - let l:wd = getcwd() - endif - let self.wd = l:wd - - if go#config#EchoCommandInfo() - call go#util#EchoProgress("initializing gopls") - endif - - let l:status = { - \ 'desc': '', - \ 'type': 'gopls', - \ 'state': 'initializing', - \ } - call go#statusline#Update(l:wd, l:status) - - let self.workspaceDirectories = add(self.workspaceDirectories, l:wd) - let l:msg = self.newMessage(go#lsp#message#Initialize(l:wd)) - - let l:state = s:newHandlerState('') - let l:state.handleResult = funcref('self.handleInitializeResult', [], l:self) - - let self.handlers[l:msg.id] = l:state - - call l:state.start() - call self.write(l:msg) - endif - - if !self.ready - call add(self.queue, {'data': a:data, 'handler': a:handler}) - return - endif - - let l:msg = self.newMessage(a:data) - if has_key(l:msg, 'id') - let self.handlers[l:msg.id] = a:handler - endif - - call a:handler.start() - call self.write(l:msg) - endfunction - - " newMessage returns a message constructed from data. data should be a dict - " with 2 or 3 keys: notification, method, and optionally params. - function! l:lsp.newMessage(data) dict abort - let l:msg = { - \ 'method': a:data.method, - \ 'jsonrpc': '2.0', - \ } - - if !a:data.notification - let self.last_request_id += 1 - let l:msg.id = self.last_request_id - endif - - if has_key(a:data, 'params') - let l:msg.params = a:data.params - endif - - return l:msg - endfunction - - function l:lsp.newResponse(id, result) dict abort - let l:msg = { - \ 'jsonrpc': '2.0', - \ 'id': a:id, - \ 'result': a:result, - \ } - - return l:msg - endfunction - - function! l:lsp.write(msg) dict abort - if empty(get(self, 'job', {})) - return - endif - - let l:body = json_encode(a:msg) - let l:data = 'Content-Length: ' . strlen(l:body) . "\r\n\r\n" . l:body - - call s:debug('sent', l:data) - - if has('nvim') - call chansend(self.job, l:data) - return - endif - - call ch_sendraw(self.job, l:data) - endfunction - - function! l:lsp.exit_cb(job, exit_status) dict - let self.exited = 1 - if !get(self, 'restarting', 0) - return - endif - - let l:queue = self.queue - - let l:workspaces = self.workspaceDirectories - - call s:lspfactory.reset() - let l:lsp = s:lspfactory.get() - - " restore workspaces - call call('go#lsp#AddWorkspaceDirectory', l:workspaces) - " * send DidOpen messages for all buffers that have b:did_lsp_open set - " TODO(bc): check modifiable and filetype, too? - bufdo if get(b:, 'go_lsp_did_open', 0) | if &modified | call go#lsp#DidOpen(expand('%:p')) | else | call go#lsp#DidChange(expand('%:p')) | endif | endif - let l:lsp.queue = extend(l:lsp.queue, l:queue) - return - endfunction - - function! l:lsp.close_cb(ch) dict abort - " TODO(bc): remove the buffer variables that indicate that gopls has been - " informed that the file is open - endfunction - - function! l:lsp.err_cb(ch, msg) dict abort - if a:msg =~ '^\d\{4}/\d\d/\d\d\ \d\d:\d\d:\d\d debug server listening on port \d\+$' && !get(self, 'debugport', 0) - let self.debugport = substitute(a:msg, '\d\{4}/\d\d/\d\d\ \d\d:\d\d:\d\d debug server listening on port \(\d\+\).*$', '\1', '') - endif - - call s:debug('stderr', a:msg) - endfunction - - " explicitly bind callbacks to l:lsp so that within it, self will always refer - " to l:lsp instead of l:opts. See :help Partial for more information. - let l:opts = { - \ 'in_mode': 'raw', - \ 'out_mode': 'raw', - \ 'err_mode': 'nl', - \ 'noblock': 1, - \ 'err_cb': funcref('l:lsp.err_cb', [], l:lsp), - \ 'out_cb': funcref('l:lsp.handleMessage', [], l:lsp), - \ 'close_cb': funcref('l:lsp.close_cb', [], l:lsp), - \ 'exit_cb': funcref('l:lsp.exit_cb', [], l:lsp), - \ 'cwd': getcwd(), - \} - - let l:bin_path = go#path#CheckBinPath("gopls") - if empty(l:bin_path) - return l:lsp - endif - - let l:cmd = [l:bin_path] - let l:cmdopts = go#config#GoplsOptions() - - if go#util#HasDebug('lsp') - " debugging can be enabled either with g:go_debug or with - " g:go_gopls_options; use g:go_gopls_options if it's given in case users - " are running the gopls debug server on a known port. - let l:needsDebug = 1 - - for l:item in l:cmdopts - let l:idx = stridx(l:item, '-debug') - if l:idx == 0 || l:idx == 1 - let l:needsDebug = 0 - endif - endfor - if l:needsDebug - let l:cmd = extend(l:cmd, ['-debug', 'localhost:0']) - endif - endif - - let l:lsp.job = go#job#Start(l:cmd+l:cmdopts, l:opts) - - return l:lsp -endfunction - -function! s:noop(...) abort -endfunction - -function! s:newHandlerState(statustype) abort - let l:state = { - \ 'winid': win_getid(winnr()), - \ 'statustype': a:statustype, - \ 'jobdir': getcwd(), - \ 'handleResult': funcref('s:noop'), - \ } - - " explicitly bind requestComplete to state so that within it, self will - " always refer to state. See :help Partial for more information. - let l:state.requestComplete = funcref('s:requestComplete', [], l:state) - - " explicitly bind start to state so that within it, self will - " always refer to state. See :help Partial for more information. - let l:state.start = funcref('s:start', [], l:state) - - return l:state -endfunction - -function! s:requestComplete(ok) abort dict - if self.statustype == '' - return - endif - - if go#config#EchoCommandInfo() - let prefix = '[' . self.statustype . '] ' - if a:ok - call go#util#EchoSuccess(prefix . "SUCCESS") - else - call go#util#EchoError(prefix . "FAIL") - endif - endif - - let status = { - \ 'desc': 'last status', - \ 'type': self.statustype, - \ 'state': "success", - \ } - - if !a:ok - let status.state = "failed" - endif - - if has_key(self, 'started_at') - let elapsed_time = reltimestr(reltime(self.started_at)) - " strip whitespace - let elapsed_time = substitute(elapsed_time, '^\s*\(.\{-}\)\s*$', '\1', '') - let status.state .= printf(" (%ss)", elapsed_time) - endif - - call go#statusline#Update(self.jobdir, status) -endfunction - -function! s:start() abort dict - let self.started_at = reltime() - if self.statustype == '' - return - endif - let status = { - \ 'desc': 'current status', - \ 'type': self.statustype, - \ 'state': "started", - \ } - - call go#statusline#Update(self.jobdir, status) -endfunction - -" go#lsp#Definition calls gopls to get the definition of the identifier at -" line and col in fname. handler should be a dictionary function that takes a -" list of strings in the form 'file:line:col: message'. handler will be -" attached to a dictionary that manages state (statuslines, sets the winid, -" etc.) -function! go#lsp#Definition(fname, line, col, handler) abort - call go#lsp#DidChange(a:fname) - - let l:lsp = s:lspfactory.get() - let l:state = s:newHandlerState('definition') - let l:state.handleResult = funcref('s:definitionHandler', [function(a:handler, [], l:state)], l:state) - let l:msg = go#lsp#message#Definition(fnamemodify(a:fname, ':p'), a:line, a:col) - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:definitionHandler(next, msg) abort dict - " gopls returns a []Location; just take the first one. - let l:msg = a:msg[0] - let l:args = [[printf('%s:%d:%d: %s', go#path#FromURI(l:msg.uri), l:msg.range.start.line+1, go#lsp#lsp#PositionOf(getline(l:msg.range.start.line+1), l:msg.range.start.character), 'lsp does not supply a description')]] - call call(a:next, l:args) -endfunction - -" go#lsp#Type calls gopls to get the type definition of the identifier at -" line and col in fname. handler should be a dictionary function that takes a -" list of strings in the form 'file:line:col: message'. handler will be -" attached to a dictionary that manages state (statuslines, sets the winid, -" etc.) -function! go#lsp#TypeDef(fname, line, col, handler) abort - call go#lsp#DidChange(a:fname) - - let l:lsp = s:lspfactory.get() - let l:state = s:newHandlerState('type definition') - let l:msg = go#lsp#message#TypeDefinition(fnamemodify(a:fname, ':p'), a:line, a:col) - let l:state.handleResult = funcref('s:typeDefinitionHandler', [function(a:handler, [], l:state)], l:state) - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:typeDefinitionHandler(next, msg) abort dict - " gopls returns a []Location; just take the first one. - let l:msg = a:msg[0] - let l:args = [[printf('%s:%d:%d: %s', go#path#FromURI(l:msg.uri), l:msg.range.start.line+1, go#lsp#lsp#PositionOf(getline(l:msg.range.start.line+1), l:msg.range.start.character), 'lsp does not supply a description')]] - call call(a:next, l:args) -endfunction - -function! go#lsp#DidOpen(fname) abort - if get(b:, 'go_lsp_did_open', 0) - return - endif - - let l:fname = fnamemodify(a:fname, ':p') - if !isdirectory(fnamemodify(l:fname, ':h')) - return - endif - - let l:lsp = s:lspfactory.get() - - if !has_key(l:lsp.notificationQueue, l:fname) - let l:lsp.notificationQueue[l:fname] = [] - endif - - if !has_key(l:lsp.fileVersions, l:fname) - let l:lsp.fileVersions[l:fname] = 0 - endif - let l:lsp.fileVersions[l:fname] = l:lsp.fileVersions[l:fname] + 1 - - let l:msg = go#lsp#message#DidOpen(l:fname, join(go#util#GetLines(), "\n") . "\n", l:lsp.fileVersions[l:fname]) - let l:state = s:newHandlerState('') - - " TODO(bc): setting a buffer level variable here assumes that a:fname is the - " current buffer. Change to a:fname first before setting it and then change - " back to active buffer. - let b:go_lsp_did_open = 1 - - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! go#lsp#DidChange(fname) abort - " DidChange is called even when fname isn't open in a buffer (e.g. via - " go#lsp#Info); don't report the file as open or as having changed when it's - " not actually a buffer. - if bufnr(a:fname) == -1 - return - endif - - let l:fname = fnamemodify(a:fname, ':p') - if !isdirectory(fnamemodify(l:fname, ':h')) - return - endif - - call go#lsp#DidOpen(a:fname) - - let l:lsp = s:lspfactory.get() - - if !has_key(l:lsp.fileVersions, l:fname) - let l:lsp.fileVersions[l:fname] = 0 - endif - let l:lsp.fileVersions[l:fname] = l:lsp.fileVersions[l:fname] + 1 - - let l:msg = go#lsp#message#DidChange(l:fname, join(go#util#GetLines(), "\n") . "\n", l:lsp.fileVersions[l:fname]) - let l:state = s:newHandlerState('') - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! go#lsp#DidClose(fname) abort - let l:fname = fnamemodify(a:fname, ':p') - if !isdirectory(fnamemodify(l:fname, ':h')) - return - endif - - if !get(b:, 'go_lsp_did_open', 0) - return - endif - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#DidClose(l:fname) - let l:state = s:newHandlerState('') - " TODO(bc): setting a buffer level variable here assumes that a:fname is the - " current buffer. Change to a:fname first before setting it and then change - " back to active buffer. - let b:go_lsp_did_open = 0 - - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! go#lsp#Completion(fname, line, col, handler) abort - call go#lsp#DidChange(a:fname) - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#Completion(a:fname, a:line, a:col) - let l:state = s:newHandlerState('completion') - let l:state.handleResult = funcref('s:completionHandler', [function(a:handler, [], l:state)], l:state) - let l:state.error = funcref('s:completionErrorHandler', [function(a:handler, [], l:state)], l:state) - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:completionHandler(next, msg) abort dict - " gopls returns a CompletionList. - let l:matches = [] - let l:start = -1 - - for l:item in a:msg.items - let l:start = l:item.textEdit.range.start.character - - let l:match = {'abbr': l:item.label, 'word': l:item.textEdit.newText, 'info': '', 'kind': go#lsp#completionitemkind#Vim(l:item.kind)} - if has_key(l:item, 'detail') - let l:match.menu = l:item.detail - if go#lsp#completionitemkind#IsFunction(l:item.kind) || go#lsp#completionitemkind#IsMethod(l:item.kind) - let l:match.info = printf('%s %s', l:item.label, l:item.detail) - - " The detail provided by gopls hasn't always provided the the full - " signature including the return value. The label used to be the - " function signature and the detail was the return value. Handle - " that case for backward compatibility. This can be removed in the - " future once it's likely that the majority of users are on a recent - " version of gopls. - if l:item.detail !~ '^func' - let l:match.info = printf('func %s %s', l:item.label, l:item.detail) - endif - endif - endif - - if has_key(l:item, 'documentation') - let l:match.info .= "\n\n" . l:item.documentation - endif - - let l:matches = add(l:matches, l:match) - endfor - let l:args = [l:start, l:matches] - call call(a:next, l:args) -endfunction - -function! s:completionErrorHandler(next, error) abort dict - call call(a:next, [-1, []]) -endfunction - -" go#lsp#SameIDs calls gopls to get the references to the identifier at line -" and col in fname. handler should be a dictionary function that takes a list -" of strings in the form 'file:line:col: message'. handler will be attached to -" a dictionary that manages state (statuslines, sets the winid, etc.). handler -" should take three arguments: an exit_code, a JSON object encoded to a string -" that mimics guru's ouput for `what`, and third mode parameter that only -" exists for compatibility with the guru implementation of SameIDs. -" TODO(bc): refactor to not need the guru adapter. -function! go#lsp#SameIDs(showstatus, fname, line, col, handler) abort - call go#lsp#DidChange(a:fname) - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#References(a:fname, a:line, a:col) - - if a:showstatus - let l:state = s:newHandlerState('same ids') - else - let l:state = s:newHandlerState('') - endif - - let l:state.handleResult = funcref('s:sameIDsHandler', [function(a:handler, [], l:state)], l:state) - let l:state.error = funcref('s:noop') - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:sameIDsHandler(next, msg) abort dict - let l:furi = go#path#ToURI(expand('%:p')) - - let l:result = { - \ 'sameids': [], - \ 'enclosing': [], - \ } - - let l:msg = a:msg - if a:msg is v:null - let l:msg = [] - endif - - for l:loc in l:msg - if l:loc.uri !=# l:furi - continue - endif - - if len(l:result.enclosing) == 0 - let l:result.enclosing = [{ - \ 'desc': 'identifier', - \ 'start': l:loc.range.start.character+1, - \ 'end': l:loc.range.end.character+1, - \ }] - endif - - let l:result.sameids = add(l:result.sameids, printf('%s:%s:%s', go#path#FromURI(l:loc.uri), l:loc.range.start.line+1, l:loc.range.start.character+1)) - endfor - - call call(a:next, [0, json_encode(l:result), '']) -endfunction - -" go#lsp#Referrers calls gopls to get the references to the identifier at line -" and col in fname. handler should be a dictionary function that takes a list -" of strings in the form 'file:line:col: message'. handler will be attached to -" a dictionary that manages state (statuslines, sets the winid, etc.). handler -" should take three arguments: an exit_code, a JSON object encoded to a string -" that mimics guru's ouput for `what`, and third mode parameter that only -" exists for compatibility with the guru implementation of SameIDs. -" TODO(bc): refactor to not need the guru adapter. -function! go#lsp#Referrers(fname, line, col, handler) abort - call go#lsp#DidChange(a:fname) - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#References(a:fname, a:line, a:col) - - let l:state = s:newHandlerState('referrers') - - let l:state.handleResult = funcref('s:handleReferences', [function(a:handler, [], l:state)], l:state) - let l:state.error = funcref('s:noop') - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:handleReferences(next, msg) abort dict - call s:handleLocations(a:next, a:msg) -endfunction - -function! s:handleLocations(next, msg) abort - let l:result = [] - - let l:msg = a:msg - - if l:msg is v:null - let l:msg = [] - endif - - call sort(l:msg, funcref('s:compareLocations')) - - for l:loc in l:msg - let l:fname = go#path#FromURI(l:loc.uri) - let l:line = l:loc.range.start.line+1 - let l:bufnr = bufnr(l:fname) - let l:bufinfo = getbufinfo(l:fname) - - try - if l:bufnr == -1 || len(l:bufinfo) == 0 || l:bufinfo[0].loaded == 0 - let l:filecontents = readfile(l:fname, '', l:line) - else - let l:filecontents = getbufline(l:fname, l:line) - endif - - if len(l:filecontents) == 0 - continue - endif - - let l:content = l:filecontents[-1] - catch - call go#util#EchoError(printf('%s (line %s): %s at %s', l:fname, l:line, v:exception, v:throwpoint)) - endtry - - let l:item = printf('%s:%s:%s: %s', go#path#FromURI(l:loc.uri), l:line, go#lsp#lsp#PositionOf(l:content, l:loc.range.start.character), l:content) - - let l:result = add(l:result, l:item) - endfor - - call call(a:next, [0, l:result, '']) -endfunction - -" go#lsp#Implementations calls gopls to get the implementations to the -" identifier at line and col in fname. handler should be a dictionary function -" that takes a list of strings in the form 'file:line:col: message'. handler -" will be attached to a dictionary that manages state (statuslines, sets the -" winid, etc.). handler should take three arguments: an exit_code, a JSON -" object encoded to a string that mimics guru's ouput for guru implements, and -" a third parameter that only exists for compatibility with guru implements. -function! go#lsp#Implements(fname, line, col, handler) abort - call go#lsp#DidChange(a:fname) - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#Implementation(a:fname, a:line, a:col) - - let l:state = s:newHandlerState('implements') - - let l:state.handleResult = funcref('s:handleImplements', [function(a:handler, [], l:state)], l:state) - let l:state.error = funcref('s:handleImplementsError', [function(a:handler, [], l:state)], l:state) - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:handleImplements(next, msg) abort dict - call s:handleLocations(a:next, a:msg) -endfunction - -function! s:handleImplementsError(next, error) abort dict - call call(a:next, [1, [a:error], '']) -endfunction - -function! go#lsp#Hover(fname, line, col, handler) abort - call go#lsp#DidChange(a:fname) - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#Hover(a:fname, a:line, a:col) - let l:state = s:newHandlerState('') - let l:state.handleResult = funcref('s:hoverHandler', [function(a:handler, [], l:state)], l:state) - let l:state.error = funcref('s:noop') - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:hoverHandler(next, msg) abort dict - if a:msg is v:null || !has_key(a:msg, 'contents') - return - endif - - try - let l:value = json_decode(a:msg.contents.value) - let l:args = [l:value.signature] - call call(a:next, l:args) - catch - " TODO(bc): log the message and/or show an error message. - endtry -endfunction - -function! go#lsp#Doc() abort - let l:fname = expand('%:p') - let [l:line, l:col] = go#lsp#lsp#Position() - - call go#lsp#DidChange(l:fname) - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#Hover(l:fname, l:line, l:col) - let l:state = s:newHandlerState('doc') - let l:resultHandler = go#promise#New(function('s:docFromHoverResult', [], l:state), 10000, '') - let l:state.handleResult = l:resultHandler.wrapper - let l:state.error = l:resultHandler.wrapper - call l:lsp.sendMessage(l:msg, l:state) - return l:resultHandler.await() -endfunction - -function! s:docFromHoverResult(msg) abort dict - if type(a:msg) is type('') - return [a:msg, 1] - endif - - if a:msg is v:null || !has_key(a:msg, 'contents') - return ['Undocumented', 0] - endif - - let l:value = json_decode(a:msg.contents.value) - let l:doc = l:value.fullDocumentation - if len(l:doc) is 0 - let l:doc = 'Undocumented' - endif - let l:content = printf("%s\n\n%s", l:value.signature, l:doc) - return [l:content, 0] -endfunction - -function! go#lsp#DocLink() abort - let l:fname = expand('%:p') - let [l:line, l:col] = go#lsp#lsp#Position() - - call go#lsp#DidChange(l:fname) - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#Hover(l:fname, l:line, l:col) - let l:state = s:newHandlerState('doc url') - let l:resultHandler = go#promise#New(function('s:docLinkFromHoverResult', [], l:state), 10000, '') - let l:state.handleResult = l:resultHandler.wrapper - let l:state.error = l:resultHandler.wrapper - call l:lsp.sendMessage(l:msg, l:state) - return l:resultHandler.await() -endfunction - -function! s:docLinkFromHoverResult(msg) abort dict - if type(a:msg) is type('') - return [a:msg, 1] - endif - - if a:msg is v:null || !has_key(a:msg, 'contents') - return - endif - - let l:doc = json_decode(a:msg.contents.value) - return [l:doc.link, ''] -endfunction - -function! go#lsp#Info(showstatus) - let l:fname = expand('%:p') - let [l:line, l:col] = go#lsp#lsp#Position() - - call go#lsp#DidChange(l:fname) - - let l:lsp = s:lspfactory.get() - - if a:showstatus - let l:state = s:newHandlerState('info') - else - let l:state = s:newHandlerState('') - endif - - let l:state.handleResult = funcref('s:infoDefinitionHandler', [function('s:info', [1], l:state), a:showstatus], l:state) - let l:state.error = funcref('s:noop') - let l:msg = go#lsp#message#Definition(l:fname, l:line, l:col) - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! go#lsp#GetInfo() - let l:fname = expand('%:p') - let [l:line, l:col] = go#lsp#lsp#Position() - - call go#lsp#DidChange(l:fname) - - let l:lsp = s:lspfactory.get() - - let l:state = s:newHandlerState('') - - let l:info = go#promise#New(function('s:info', [0], l:state), 10000, '') - - let l:state.handleResult = funcref('s:infoDefinitionHandler', [l:info.wrapper, 0], l:state) - let l:state.error = funcref('s:noop') - let l:msg = go#lsp#message#Definition(l:fname, l:line, l:col) - call l:lsp.sendMessage(l:msg, l:state) - return l:info.await() -endfunction - -function! s:infoDefinitionHandler(next, showstatus, msg) abort dict - " gopls returns a []Location; just take the first one. - if a:msg is v:null || len(a:msg) == 0 - return - endif - - let l:msg = a:msg[0] - - let l:fname = go#path#FromURI(l:msg.uri) - let l:line = l:msg.range.start.line - let l:col = l:msg.range.start.character - - let l:lsp = s:lspfactory.get() - let l:msg = go#lsp#message#Hover(l:fname, l:line, l:col) - - if a:showstatus - let l:state = s:newHandlerState('info') - else - let l:state = s:newHandlerState('') - endif - - let l:state.handleResult = a:next - let l:state.error = funcref('s:noop') - return l:lsp.sendMessage(l:msg, l:state) -endfunction - -function! s:info(show, msg) abort dict - if a:msg is v:null || !has_key(a:msg, 'contents') - return - endif - - let l:value = json_decode(a:msg.contents.value) - let l:content = [l:value.singleLine] - let l:content = s:infoFromHoverContent(l:content) - - if a:show - call go#util#ShowInfo(l:content) - endif - - return l:content -endfunction - -function! s:infoFromHoverContent(content) abort - if len(a:content) < 1 - return '' - endif - - let l:content = a:content[0] - - " strip off the method set and fields of structs and interfaces. - if l:content =~# '^\(type \)\?[^ ]\+ \(struct\|interface\)' - let l:content = substitute(l:content, '{.*', '', '') - endif - - return l:content -endfunction - -function! go#lsp#AddWorkspaceDirectory(...) abort - if a:0 == 0 - return - endif - - call go#lsp#CleanWorkspaces() - - let l:workspaces = [] - for l:dir in a:000 - let l:dir = fnamemodify(l:dir, ':p') - if !isdirectory(l:dir) - continue - endif - - let l:workspaces = add(l:workspaces, l:dir) - endfor - - let l:lsp = s:lspfactory.get() - let l:state = s:newHandlerState('') - let l:lsp.workspaceDirectories = extend(l:lsp.workspaceDirectories, l:workspaces) - let l:msg = go#lsp#message#ChangeWorkspaceFolders(l:workspaces, []) - call l:lsp.sendMessage(l:msg, l:state) - - return 0 -endfunction - -function! go#lsp#CleanWorkspaces() abort - let l:workspaces = [] - - let l:lsp = s:lspfactory.get() - - let l:i = 0 - let l:missing = [] - for l:dir in l:lsp.workspaceDirectories - if !isdirectory(l:dir) - let l:missing = add(l:missing, l:dir) - call remove(l:lsp.workspaceDirectories, l:i) - continue - endif - let l:i += 1 - endfor - - if len(l:missing) == 0 - return 0 - endif - - let l:state = s:newHandlerState('') - let l:msg = go#lsp#message#ChangeWorkspaceFolders([], l:missing) - call l:lsp.sendMessage(l:msg, l:state) - - return 0 -endfunction - -" go#lsp#ResetWorkspaceDiretories removes and then re-adds all workspace -" folders to cause gopls to send configuration requests for all of them again. -" This is useful, for instance, when build tags have been added and gopls -" needs to use them. -function! go#lsp#ResetWorkspaceDirectories() abort - call go#lsp#CleanWorkspaces() - - let l:lsp = s:lspfactory.get() - - let l:state = s:newHandlerState('') - let l:msg = go#lsp#message#ChangeWorkspaceFolders(l:lsp.workspaceDirectories, l:lsp.workspaceDirectories) - call l:lsp.sendMessage(l:msg, l:state) - - return 0 -endfunction - -function! go#lsp#DebugBrowser() abort - let l:lsp = s:lspfactory.get() - let l:port = get(l:lsp, 'debugport', 0) - if !l:port - call go#util#EchoError("gopls was not started with debugging enabled. See :help g:go_debug.") - return - endif - - call go#util#OpenBrowser(printf('http://localhost:%d', l:port)) -endfunction - -function! go#lsp#Exit() abort - call s:exit(0) -endfunction - -function! go#lsp#Restart() abort - call s:exit(1) -endfunction - -function! s:exit(restart) abort - if !go#util#has_job() || len(s:lspfactory) == 0 || !has_key(s:lspfactory, 'current') - return - endif - - let l:lsp = s:lspfactory.get() - - " reset the factory so that future requests don't use the same instance of - " gopls. - call s:lspfactory.reset() - - let l:lsp.restarting = a:restart - - let l:state = s:newHandlerState('exit') - - let l:msg = go#lsp#message#Shutdown() - let l:retval = l:lsp.sendMessage(l:msg, l:state) - - let l:msg = go#lsp#message#Exit() - let l:retval = l:lsp.sendMessage(l:msg, l:state) - - return l:retval -endfunction - -let s:log = [] -function! s:debugasync(timer) abort - if !go#util#HasDebug('lsp') - let s:log = [] - return - endif - - let l:winid = win_getid() - - let l:name = '__GOLSP_LOG__' - let l:log_winid = bufwinid(l:name) - if l:log_winid == -1 - silent keepalt botright 10new - silent file `='__GOLSP_LOG__'` - setlocal buftype=nofile bufhidden=wipe nomodified nobuflisted noswapfile nowrap nonumber nocursorline - setlocal filetype=golsplog - else - call win_gotoid(l:log_winid) - endif - - try - setlocal modifiable - for [l:event, l:data] in s:log - call remove(s:log, 0) - if getline(1) == '' - call setline('$', printf('===== %s =====', l:event)) - else - call append('$', printf('===== %s =====', l:event)) - endif - call append('$', split(l:data, "\r\n")) - endfor - normal! G - setlocal nomodifiable - finally - call win_gotoid(l:winid) - endtry -endfunction - -function! s:debug(event, data) abort - let l:shouldStart = len(s:log) > 0 - let s:log = add(s:log, [a:event, a:data]) - - if l:shouldStart - call timer_start(10, function('s:debugasync', [])) - endif -endfunction - -function! s:compareLocations(left, right) abort - if a:left.uri < a:right.uri - return -1 - endif - - if a:left.uri == a:right.uri && a:left.range.start.line < a:right.range.start.line - return -1 - endif - - if a:left.uri == a:right.uri && a:left.range.start.line == a:right.range.start.line && a:left.range.start.character < a:right.range.start.character - return -1 - endif - - if a:left.uri == a:right.uri && a:left.range.start.line == a:right.range.start.line && a:left.range.start.character == a:right.range.start.character - return 0 - endif - - return 1 -endfunction - -function! go#lsp#Diagnostics(...) abort - if a:0 == 0 - return [] - endif - - let l:dirsToPackages = {} - - let l:lsp = s:lspfactory.get() - - let l:diagnostics = [] - for [l:key, l:val] in items(l:lsp.diagnostics) - let l:dir = fnamemodify(l:key, ':h') - - if !has_key(l:dirsToPackages, l:dir) - let l:pkg = go#package#FromPath(l:dir) - let l:dirsToPackages[l:dir] = l:pkg - else - let l:pkg = l:dirsToPackages[l:dir] - endif - - if type(l:pkg) == type(0) - continue - endif - - for l:arg in a:000 - if l:arg == l:pkg || l:arg == 'all' - let l:diagnostics = extend(l:diagnostics, l:val) - endif - endfor - endfor - - return sort(l:diagnostics) -endfunction - -function! go#lsp#AnalyzeFile(fname) abort - let l:fname = fnamemodify(a:fname, ':p') - if !isdirectory(fnamemodify(l:fname, ':h')) - return [] - endif - - let l:lsp = s:lspfactory.get() - - let l:version = l:lsp.fileVersions[l:fname] - - call go#lsp#DidChange(a:fname) - - let l:diagnostics = go#promise#New(function('s:setDiagnostics', []), 10000, get(l:lsp.diagnostics, l:fname, [])) - let l:lsp.notificationQueue[l:fname] = add(l:lsp.notificationQueue[l:fname], l:diagnostics.wrapper) - return l:diagnostics.await() -endfunction - -function! s:setDiagnostics(...) abort - return a:000 -endfunction - -" s:processDiagnostic converts a diagnostic into an error string. It returns -" the errors string and the match position described in the diagnostic. The -" match position will be an empty list when bufname is not a valid name for -" the current buffer. -function! s:errorFromDiagnostic(diagnostic, bufname, fname) abort - let l:range = a:diagnostic.range - - let l:line = l:range.start.line + 1 - let l:col = go#lsp#lsp#PositionOf(getbufline(a:bufname, l:line)[0], l:range.start.character) - let l:error = printf('%s:%s:%s:%s: %s', a:fname, l:line, l:col, go#lsp#lsp#SeverityToErrorType(a:diagnostic.severity), a:diagnostic.message) - - if !(a:diagnostic.severity == 1 || a:diagnostic.severity == 2) - return [l:error, []] - endif - - " return when the diagnostic is not for the current buffer. - if bufnr(a:bufname) != bufnr('') - return [l:error, []] - end - - let l:endline = l:range.end.line + 1 - " don't bother trying to highlight errors or warnings that span - " the whole file (e.g when there's missing package documentation). - if l:line == 1 && (l:endline) == line('$') - return [l:error, []] - endif - let l:endcol = go#lsp#lsp#PositionOf(getline(l:endline), l:range.end.character) - - " the length of the match is the number of bytes between the start of - " the match and the end of the match. - let l:matchLength = line2byte(l:endline) + l:endcol - (line2byte(l:line) + l:col) - let l:pos = [l:line, l:col, l:matchLength] - - return [l:error, l:pos] -endfunction - -function! s:highlightMatches(errorMatches, warningMatches) abort - " set buffer variables for errors and warnings to zero values - let b:go_diagnostic_matches = {'errors': [], 'warnings': []} - - if hlexists('goDiagnosticError') - " clear the old matches just before adding the new ones to keep flicker - " to a minimum. - call go#util#ClearHighlights('goDiagnosticError') - if go#config#HighlightDiagnosticErrors() - let b:go_diagnostic_matches.errors = copy(a:errorMatches) - call go#util#HighlightPositions('goDiagnosticError', a:errorMatches) - endif - endif - - if hlexists('goDiagnosticWarning') - " clear the old matches just before adding the new ones to keep flicker - " to a minimum. - call go#util#ClearHighlights('goDiagnosticWarning') - if go#config#HighlightDiagnosticWarnings() - let b:go_diagnostic_matches.warnings = copy(a:warningMatches) - call go#util#HighlightPositions('goDiagnosticWarning', a:warningMatches) - endif - endif - - " re-apply matches at the time the buffer is displayed in a new window or - " redisplayed in an existing window: e.g. :edit, - augroup vim-go-diagnostics - autocmd! * - autocmd BufDelete autocmd! vim-go-diagnostics * - if has('textprop') - autocmd BufReadPost nested call s:highlightMatches(b:go_diagnostic_matches.errors, b:go_diagnostic_matches.warnings) - else - autocmd BufWinEnter nested call s:highlightMatches(b:go_diagnostic_matches.errors, b:go_diagnostic_matches.warnings) - endif - augroup end -endfunction - -" ClearDiagnosticHighlights removes all goDiagnosticError and -" goDiagnosticWarning matches. -function! go#lsp#ClearDiagnosticHighlights() abort - call go#util#ClearHighlights('goDiagnosticError') - call go#util#ClearHighlights('goDiagnosticWarning') -endfunction - -" Format formats the current buffer. -function! go#lsp#Format() abort - let l:fname = expand('%:p') - " send the current file so that TextEdits will be relative to the current - " state of the buffer. - call go#lsp#DidChange(l:fname) - - let l:lsp = s:lspfactory.get() - - let l:state = s:newHandlerState('') - let l:handleFormat = go#promise#New(function('s:handleFormat', [], l:state), 10000, '') - let l:state.handleResult = l:handleFormat.wrapper - let l:state.error = l:handleFormat.wrapper - let l:state.handleError = function('s:handleFormatError', [l:fname], l:state) - let l:msg = go#lsp#message#Format(l:fname) - call l:lsp.sendMessage(l:msg, l:state) - - call go#fmt#CleanErrors() - - " await the result to avoid any race conditions among autocmds (e.g. - " BufWritePre and BufWritePost) - call l:handleFormat.await() -endfunction - -" Imports executes the source.organizeImports code action for the current -" buffer. -function! go#lsp#Imports() abort - let l:fname = expand('%:p') - " send the current file so that TextEdits will be relative to the current - " state of the buffer. - call go#lsp#DidChange(l:fname) - - let l:lsp = s:lspfactory.get() - - let l:state = s:newHandlerState('') - let l:handler = go#promise#New(function('s:handleCodeAction', [], l:state), 10000, '') - let l:state.handleResult = l:handler.wrapper - let l:state.error = l:handler.wrapper - let l:state.handleError = function('s:handleCodeActionError', [l:fname], l:state) - let l:msg = go#lsp#message#CodeActionImports(l:fname) - call l:lsp.sendMessage(l:msg, l:state) - - " await the result to avoid any race conditions among autocmds (e.g. - " BufWritePre and BufWritePost) - call l:handler.await() -endfunction - -function! s:handleFormat(msg) abort dict - call go#fmt#CleanErrors() - - if type(a:msg) is type('') - call self.handleError(a:msg) - return - endif - call s:applyTextEdits(a:msg) -endfunction - -function! s:handleCodeAction(msg) abort dict - if type(a:msg) is type('') - call self.handleError(a:msg) - return - endif - - if a:msg is v:null - return - endif - - for l:item in a:msg - if get(l:item, 'kind', '') is 'source.organizeImports' - if !has_key(l:item, 'edit') - continue - endif - if !has_key(l:item.edit, 'documentChanges') - continue - endif - for l:change in l:item.edit.documentChanges - if !has_key(l:change, 'edits') - continue - endif - " TODO(bc): change to the buffer for l:change.textDocument.uri - call s:applyTextEdits(l:change.edits) - endfor - endif - endfor -endfunction - -function s:applyTextEdits(msg) abort - if a:msg is v:null - return - endif - - " process the TextEdit list in reverse order, because the positions are - " based on the current line numbers; processing in forward order would - " require keeping track of how the proper position of each TextEdit would be - " affected by all the TextEdits that came before. - call reverse(sort(a:msg, function('s:textEditLess'))) - for l:msg in a:msg - let l:startline = l:msg.range.start.line+1 - let l:endline = l:msg.range.end.line+1 - let l:text = l:msg.newText - - " handle the deletion of whole lines - if len(l:text) == 0 && l:msg.range.start.character == 0 && l:msg.range.end.character == 0 && l:startline < l:endline - call s:deleteline(l:startline, l:endline-1) - continue - endif - - let l:startcontent = getline(l:startline) - let l:preSliceEnd = 0 - if l:msg.range.start.character > 0 - let l:preSliceEnd = go#lsp#lsp#PositionOf(l:startcontent, l:msg.range.start.character-1) - 1 - let l:startcontent = l:startcontent[:l:preSliceEnd] - elseif l:endline == l:startline && (l:msg.range.end.character == 0 || l:msg.range.start.character == 0) - " l:startcontent should be the empty string when l:text is a - " replacement at the beginning of the line. - let l:startcontent = '' - endif - - let l:endcontent = getline(l:endline) - let l:postSliceStart = 0 - if l:msg.range.end.character > 0 - let l:postSliceStart = go#lsp#lsp#PositionOf(l:endcontent, l:msg.range.end.character-1) - let l:endcontent = l:endcontent[(l:postSliceStart):] - endif - - " There isn't an easy way to replace the text in a byte or character - " range, so append to l:text any text on l:endline starting from - " l:postSliceStart and prepend to l:text any text on l:startline prior to - " l:preSliceEnd, and finally replace the lines with a delete followed by - " and append. - let l:text = printf('%s%s%s', l:startcontent, l:text, l:endcontent) - - " TODO(bc): deal with the undo file - " TODO(bc): deal with folds - - call s:deleteline(l:startline, l:endline) - for l:line in split(l:text, "\n") - call append(l:startline-1, l:line) - let l:startline += 1 - endfor - endfor - - call go#lsp#DidChange(expand('%:p')) - return -endfunction - -function! s:handleFormatError(filename, msg) abort dict - if go#config#FmtFailSilently() - return - endif - - let l:errors = split(a:msg, '\n') - let l:errors = map(l:errors, printf('substitute(v:val, ''^'', ''%s:'', '''')', a:filename)) - let l:errors = join(l:errors, "\n") - call go#fmt#ShowErrors(l:errors) -endfunction - -function! s:handleCodeActionError(filename, msg) abort dict - " TODO(bc): handle the error? -endfunction - -function! s:textEditLess(left, right) abort - " TextEdits in a TextEdit[] never overlap and Vim's sort() is stable. - if a:left.range.start.line < a:right.range.start.line - return -1 - endif - - if a:left.range.start.line > a:right.range.start.line - return 1 - endif - - if a:left.range.start.line == a:right.range.start.line - if a:left.range.start.character < a:right.range.start.character - return -1 - endif - - if a:left.range.start.character > a:right.range.start.character - return 1 - endif - endif - - " return 0, because a:left an a:right refer to the same position. - return 0 -endfunction - -function! s:deleteline(start, end) abort - if exists('*deletebufline') - call deletebufline('', a:start, a:end) - else - call execute(printf('%d,%d d_', a:start, a:end)) - endif -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lsp/completionitemkind.vim b/vim-config/plugins/vim-go/autoload/go/lsp/completionitemkind.vim deleted file mode 100644 index 0202bd26..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lsp/completionitemkind.vim +++ /dev/null @@ -1,63 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:Text = 1 -let s:Method = 2 -let s:Function = 3 -let s:Constructor = 4 -let s:Field = 5 -let s:Variable = 6 -let s:Class = 7 -let s:Interface = 8 -let s:Module = 9 -let s:Property = 10 -let s:Unit = 11 -let s:Value = 12 -let s:Enum = 13 -let s:Keyword = 14 -let s:Snippet = 15 -let s:Color = 16 -let s:File = 17 -let s:Reference = 18 -let s:Folder = 19 -let s:EnumMember = 20 -let s:Constant = 21 -let s:Struct = 22 -let s:Event = 23 -let s:Operator = 24 -let s:TypeParameter = 25 - -function! go#lsp#completionitemkind#Vim(kind) abort - if a:kind == s:Method || a:kind == s:Function || a:kind == s:Constructor - return 'f' - elseif a:kind == s:Variable || a:kind == s:Constant - return 'v' - elseif a:kind == s:Field || a:kind == s:Property - return 'm' - elseif a:kind == s:Class || a:kind == s:Interface || a:kind == s:Struct - return 't' - endif -endfunction - -function! go#lsp#completionitemkind#IsFunction(kind) abort - if a:kind == s:Function - return 1 - endif - - return 0 -endfunction - -function! go#lsp#completionitemkind#IsMethod(kind) abort - if a:kind == s:Method - return 1 - endif - - return 0 -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lsp/lsp.vim b/vim-config/plugins/vim-go/autoload/go/lsp/lsp.vim deleted file mode 100644 index c0cf3e08..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lsp/lsp.vim +++ /dev/null @@ -1,72 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" go#lsp#lsp#Position returns the LSP text position. If no arguments are -" provided, the cursor position is assumed. Otherwise, there should be two -" arguments: the line and the column. -function! go#lsp#lsp#Position(...) - if a:0 < 2 - let [l:line, l:col] = getpos('.')[1:2] - else - let l:line = a:1 - let l:col = a:2 - endif - let l:content = getline(l:line) - - " LSP uses 0-based lines. - return [l:line - 1, s:character(l:line, l:col-1)] -endfunction - -function! s:strlen(str) abort - let l:runes = split(a:str, '\zs') - return len(l:runes) + len(filter(l:runes, 'char2nr(v:val)>=0x10000')) -endfunction - -function! s:character(line, col) abort - return s:strlen(getline(a:line)[:col([a:line, a:col - 1])]) -endfunction - -" go#lsp#PositionOf returns len(content[0:units]) where units is utf-16 code -" units. This is mostly useful for converting LSP text position to vim -" position. -function! go#lsp#lsp#PositionOf(content, units, ...) abort - if a:units == 0 - return 1 - endif - - let l:remaining = a:units - let l:str = '' - for l:rune in split(a:content, '\zs') - if l:remaining < 0 - break - endif - let l:remaining -= 1 - if char2nr(l:rune) >= 0x10000 - let l:remaining -= 1 - endif - let l:str = l:str . l:rune - endfor - - return len(l:str) -endfunction - -function! go#lsp#lsp#SeverityToErrorType(severity) abort - if a:severity == 1 - return 'E' - elseif a:severity == 2 - return 'W' - elseif a:severity == 3 - return 'I' - elseif a:severity == 4 - return 'I' - endif - - return '' -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lsp/lsp_test.vim b/vim-config/plugins/vim-go/autoload/go/lsp/lsp_test.vim deleted file mode 100644 index 24a2a747..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lsp/lsp_test.vim +++ /dev/null @@ -1,32 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -function! Test_PositionOf_Simple() - let l:actual = go#lsp#lsp#PositionOf("just ascii", 3) - call assert_equal(4, l:actual) -endfunc - - -function! Test_PositionOf_MultiByte() - " ⌘ is U+2318, which encodes to three bytes in utf-8 and 1 code unit in - " utf-16. - let l:actual = go#lsp#lsp#PositionOf("⌘⌘ foo", 3) - call assert_equal(8, l:actual) -endfunc - -function! Test_PositionOf_MultipleCodeUnit() - " 𐐀 is U+10400, which encodes to 4 bytes in utf-8 and 2 code units in - " utf-16. - let l:actual = go#lsp#lsp#PositionOf("𐐀 bar", 3) - call assert_equal(6, l:actual) -endfunction - - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lsp/message.vim b/vim-config/plugins/vim-go/autoload/go/lsp/message.vim deleted file mode 100644 index 730901a2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lsp/message.vim +++ /dev/null @@ -1,343 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#lsp#message#Initialize(wd) abort - return { - \ 'notification': 0, - \ 'method': 'initialize', - \ 'params': { - \ 'processId': getpid(), - \ 'rootUri': go#path#ToURI(a:wd), - \ 'capabilities': { - \ 'workspace': { - \ 'workspaceFolders': v:true, - \ 'didChangeConfiguration': { - \ 'dynamicRegistration': v:true, - \ }, - \ 'configuration': v:true, - \ }, - \ 'textDocument': { - \ 'hover': { - \ 'contentFormat': ['plaintext'], - \ }, - \ 'completion': { - \ 'completionItem': { - \ 'snippetSupport': go#config#GoplsUsePlaceholders() ? v:true : v:false, - \ }, - \ }, - \ 'codeAction': { - \ 'codeActionLiteralSupport': { - \ 'codeActionKind': { - \ 'valueSet': ['source.organizeImports'], - \ }, - \ }, - \ }, - \ } - \ }, - \ 'workspaceFolders': [s:workspaceFolder(0, a:wd)], - \ } - \ } -endfunction - -function! go#lsp#message#Initialized() abort - return { - \ 'notification': 1, - \ 'method': 'initialized', - \ 'params': {}, - \ } -endfunction - -function! go#lsp#message#Shutdown() abort - return { - \ 'notification': 0, - \ 'method': 'shutdown', - \ } -endfunction - -function! go#lsp#message#Format(file) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/formatting', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'options': { - \ 'insertSpaces': v:false, - \ }, - \ } - \ } -endfunction - -function! go#lsp#message#CodeActionImports(file) abort - return s:codeAction('source.organizeImports', a:file) -endfunction - -function! s:codeAction(name, file) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/codeAction', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'range': { - \ 'start': {'line': 0, 'character': 0}, - \ 'end': {'line': line('$'), 'character': 0}, - \ }, - \ 'context': { - \ 'only': [a:name], - \ }, - \ } - \ } -endfunction - -function! go#lsp#message#Exit() abort - return { - \ 'notification': 1, - \ 'method': 'exit', - \ } -endfunction - -function! go#lsp#message#WorkspaceFoldersResult(dirs) abort - return map(copy(a:dirs), function('s:workspaceFolder', [])) -endfunction - -function! go#lsp#message#Definition(file, line, col) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/definition', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'position': s:position(a:line, a:col) - \ } - \ } -endfunction - -function! go#lsp#message#TypeDefinition(file, line, col) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/typeDefinition', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'position': s:position(a:line, a:col) - \ } - \ } -endfunction - -function! go#lsp#message#Implementation(file, line, col) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/implementation', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'position': s:position(a:line, a:col) - \ } - \ } -endfunction - -function! go#lsp#message#DidOpen(file, content, version) abort - return { - \ 'notification': 1, - \ 'method': 'textDocument/didOpen', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file), - \ 'languageId': 'go', - \ 'text': a:content, - \ 'version': a:version, - \ } - \ } - \ } -endfunction - -function! go#lsp#message#DidChange(file, content, version) abort - return { - \ 'notification': 1, - \ 'method': 'textDocument/didChange', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file), - \ 'version': a:version, - \ }, - \ 'contentChanges': [ - \ { - \ 'text': a:content, - \ } - \ ] - \ } - \ } -endfunction - -function! go#lsp#message#DidClose(file) abort - return { - \ 'notification': 1, - \ 'method': 'textDocument/didClose', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file), - \ } - \ } - \ } -endfunction - -function! go#lsp#message#Completion(file, line, col) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/completion', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'position': s:position(a:line, a:col), - \ } - \ } -endfunction - -function! go#lsp#message#References(file, line, col) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/references', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'position': s:position(a:line, a:col), - \ 'context': { - \ 'includeDeclaration': v:true, - \ }, - \ } - \ } -endfunction - -function! go#lsp#message#Hover(file, line, col) abort - return { - \ 'notification': 0, - \ 'method': 'textDocument/hover', - \ 'params': { - \ 'textDocument': { - \ 'uri': go#path#ToURI(a:file) - \ }, - \ 'position': s:position(a:line, a:col), - \ } - \ } -endfunction - -function! go#lsp#message#ChangeWorkspaceFolders(add, remove) abort - let l:addDirs = map(copy(a:add), function('s:workspaceFolder', [])) - let l:removeDirs = map(copy(a:remove), function('s:workspaceFolder', [])) - - return { - \ 'notification': 1, - \ 'method': 'workspace/didChangeWorkspaceFolders', - \ 'params': { - \ 'event': { - \ 'removed': l:removeDirs, - \ 'added': l:addDirs, - \ }, - \ } - \ } - -endfunction - -function! go#lsp#message#ConfigurationResult(items) abort - let l:result = [] - - " results must be in the same order as the items - for l:item in a:items - let l:config = { - \ 'buildFlags': [], - \ 'hoverKind': 'Structured', - \ } - let l:buildtags = go#config#BuildTags() - if buildtags isnot '' - let l:config.buildFlags = extend(l:config.buildFlags, ['-tags', go#config#BuildTags()]) - endif - - let l:deepCompletion = go#config#GoplsDeepCompletion() - let l:matcher = go#config#GoplsMatcher() - let l:completeUnimported = go#config#GoplsCompleteUnimported() - let l:staticcheck = go#config#GoplsStaticCheck() - let l:usePlaceholder = go#config#GoplsUsePlaceholders() - let l:tempModfile = go#config#GoplsTempModfile() - let l:analyses = go#config#GoplsAnalyses() - let l:local = go#config#GoplsLocal() - - if l:deepCompletion isnot v:null - if l:deepCompletion - let l:config.deepCompletion = v:true - else - let l:config.deepCompletion = v:false - endif - endif - - if l:matcher isnot v:null - let l:config.matcher = l:matcher - endif - - if l:completeUnimported isnot v:null - if l:completeUnimported - let l:config.completeUnimported = v:true - else - let l:config.completeUnimported = v:false - endif - endif - - if l:staticcheck isnot v:null - if l:staticcheck - let l:config.staticcheck = v:true - else - let l:config.staticcheck = v:false - endif - endif - - if l:usePlaceholder isnot v:null - if l:usePlaceholder - let l:config.usePlaceholders = v:true - else - let l:config.usePlaceholders = v:false - endif - endif - - if l:tempModfile isnot v:null - if l:tempModfile - let l:config.tempModfile = v:true - else - let l:config.tempModfile = v:false - endif - endif - - if l:analyses isnot v:null - let l:config.analyses = l:analyses - endif - - if l:local isnot v:null - let l:config.local = l:local - endif - - let l:result = add(l:result, l:config) - endfor - - return l:result -endfunction - -function s:workspaceFolder(key, val) abort - return {'uri': go#path#ToURI(a:val), 'name': a:val} -endfunction - -function! s:position(line, col) abort - return {'line': a:line, 'character': a:col} -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/lsp_test.vim b/vim-config/plugins/vim-go/autoload/go/lsp_test.vim deleted file mode 100644 index 432099d0..00000000 --- a/vim-config/plugins/vim-go/autoload/go/lsp_test.vim +++ /dev/null @@ -1,81 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -function! Test_GetSimpleTextPosition() - call s:getinfo('lsp text position should align with cursor position after ascii only', 'ascii') -endfunction - -function! Test_GetMultiByteTextPosition() - call s:getinfo('lsp text position should align with cursor position after two place of interest symbols ⌘⌘', 'multi-byte') -endfunction - -function! Test_GetMultipleCodeUnitTextPosition() - call s:getinfo('lsp text position should align with cursor position after Deseret Capital Letter Long I 𐐀', 'multi-code-units') -endfunction - -function! s:getinfo(str, name) - if !go#util#has_job() - return - endif - - try - let g:go_info_mode = 'gopls' - - let l:tmp = gotest#write_file(a:name . '/position/position.go', [ - \ 'package position', - \ '', - \ 'func Example() {', - \ "\tid := " . '"foo"', - \ "\tprintln(" .'"' . a:str . '", id)', - \ '}', - \ ] ) - - let l:expected = 'var id string' - let l:actual = go#lsp#GetInfo() - call assert_equal(l:expected, l:actual) - finally - call delete(l:tmp, 'rf') - unlet g:go_info_mode - endtry -endfunction - -func! Test_Format() abort - try - let expected = join(readfile("test-fixtures/lsp/fmt/format_golden.go"), "\n") - let l:tmp = gotest#load_fixture('lsp/fmt/format.go') - - call go#lsp#Format() - - " this should now contain the formatted code - let actual = join(go#util#GetLines(), "\n") - - call assert_equal(expected, actual) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_Imports() abort - try - let expected = join(readfile("test-fixtures/lsp/imports/imports_golden.go"), "\n") - let l:tmp = gotest#load_fixture('lsp/imports/imports.go') - - call go#lsp#Imports() - - " this should now contain the expected imports code - let actual = join(go#util#GetLines(), "\n") - - call assert_equal(expected, actual) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/mod.vim b/vim-config/plugins/vim-go/autoload/go/mod.vim deleted file mode 100644 index a38aabe1..00000000 --- a/vim-config/plugins/vim-go/autoload/go/mod.vim +++ /dev/null @@ -1,147 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:go_major_version = "" - -function! go#mod#Format() abort - " go mod only exists in `v1.11` - if empty(s:go_major_version) - let tokens = matchlist(go#util#Exec(['go', 'version']), '\d\+.\(\d\+\)\(\.\d\+\)\? ') - if len(tokens) > 0 - let s:go_major_version = str2nr(tokens[1]) - else - let s:go_major_version = "" - endif - endif - - if !empty(s:go_major_version) && s:go_major_version < "11" - call go#util#EchoError("Go v1.11 is required to format go.mod file") - return - endif - - let fname = fnamemodify(expand("%"), ':p:gs?\\?/?') - - " Save cursor position and many other things. - let l:curw = winsaveview() - - " Write current unsaved buffer to a temp file - let l:tmpname = tempname() . '.mod' - call writefile(go#util#GetLines(), l:tmpname) - if go#util#IsWin() - let l:tmpname = tr(l:tmpname, '\', '/') - endif - - let current_col = col('.') - let l:args = ['go', 'mod', 'edit', '--fmt', l:tmpname] - let [l:out, l:err] = go#util#Exec(l:args) - let diff_offset = len(readfile(l:tmpname)) - line('$') - - if l:err == 0 - call go#mod#update_file(l:tmpname, fname) - else - let errors = s:parse_errors(fname, l:out) - call s:show_errors(errors) - endif - - " We didn't use the temp file, so clean up - call delete(l:tmpname) - - " Restore our cursor/windows positions. - call winrestview(l:curw) - - " be smart and jump to the line the new statement was added/removed - call cursor(line('.') + diff_offset, current_col) - - " Syntax highlighting breaks less often. - syntax sync fromstart -endfunction - -" update_file updates the target file with the given formatted source -function! go#mod#update_file(source, target) - " remove undo point caused via BufWritePre - try | silent undojoin | catch | endtry - - let old_fileformat = &fileformat - if exists("*getfperm") - " save file permissions - let original_fperm = getfperm(a:target) - endif - - call rename(a:source, a:target) - - " restore file permissions - if exists("*setfperm") && original_fperm != '' - call setfperm(a:target , original_fperm) - endif - - " reload buffer to reflect latest changes - silent edit! - - let &fileformat = old_fileformat - let &syntax = &syntax - - let l:listtype = go#list#Type("GoModFmt") - - " clean up previous list - if l:listtype == "quickfix" - let l:list_title = getqflist({'title': 1}) - else - let l:list_title = getloclist(0, {'title': 1}) - endif - - if has_key(l:list_title, "title") && l:list_title['title'] == "Format" - call go#list#Clean(l:listtype) - endif -endfunction - -" parse_errors parses the given errors and returns a list of parsed errors -function! s:parse_errors(filename, content) abort - let splitted = split(a:content, '\n') - - " list of errors to be put into location list - let errors = [] - for line in splitted - let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\s*\(.*\)') - if !empty(tokens) - call add(errors,{ - \"filename": a:filename, - \"lnum": tokens[2], - \"text": tokens[3], - \ }) - endif - endfor - - return errors -endfunction - -" show_errors opens a location list and shows the given errors. If the given -" errors is empty, it closes the the location list -function! s:show_errors(errors) abort - let l:listtype = go#list#Type("GoModFmt") - if !empty(a:errors) - call go#list#Populate(l:listtype, a:errors, 'Format') - call go#util#EchoError("GoModFmt returned error") - endif - - " this closes the window if there are no errors or it opens - " it if there is any - call go#list#Window(l:listtype, len(a:errors)) -endfunction - -function! go#mod#ToggleModFmtAutoSave() abort - if go#config#ModFmtAutosave() - call go#config#SetModFmtAutosave(0) - call go#util#EchoProgress("auto mod fmt disabled") - return - end - - call go#config#SetModFmtAutosave(1) - call go#util#EchoProgress("auto mod fmt enabled") -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/package.vim b/vim-config/plugins/vim-go/autoload/go/package.vim deleted file mode 100644 index b700170d..00000000 --- a/vim-config/plugins/vim-go/autoload/go/package.vim +++ /dev/null @@ -1,309 +0,0 @@ -" Copyright 2011 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" This file provides a utility function that performs auto-completion of -" package names, for use by other commands. - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:goos = $GOOS -let s:goarch = $GOARCH - -if len(s:goos) == 0 - if exists('g:golang_goos') - let s:goos = g:golang_goos - elseif has('win32') || has('win64') - let s:goos = 'windows' - elseif has('macunix') - let s:goos = 'darwin' - else - let s:goos = '*' - endif -endif - -if len(s:goarch) == 0 - if exists('g:golang_goarch') - let s:goarch = g:golang_goarch - else - let s:goarch = '*' - endif -endif - -function! s:paths() abort - let dirs = [] - - if !exists("s:goroot") - if executable('go') - let s:goroot = go#util#env("goroot") - if go#util#ShellError() != 0 - call go#util#EchoError('`go env GOROOT` failed') - endif - else - let s:goroot = $GOROOT - endif - endif - - if len(s:goroot) != 0 && isdirectory(s:goroot) - let dirs += [s:goroot] - endif - - let workspaces = split(go#path#Default(), go#util#PathListSep()) - if workspaces != [] - let dirs += workspaces - endif - - return dirs -endfunction - -function! s:module() abort - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-m', '-f', '{{.Dir}}']) - if l:err != 0 - return {} - endif - let l:dir = split(l:out, '\n')[0] - - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-m', '-f', '{{.Path}}']) - if l:err != 0 - return {} - endif - let l:path = split(l:out, '\n')[0] - - return {'dir': l:dir, 'path': l:path} -endfunction - -function! s:vendordirs() abort - let l:vendorsuffix = go#util#PathSep() . 'vendor' - let l:module = s:module() - if empty(l:module) - let [l:root, l:err] = go#util#ExecInDir(['go', 'list', '-f', '{{.Root}}']) - if l:err != 0 - return [] - endif - if empty(l:root) - return [] - endif - - let l:root = split(l:root, '\n')[0] . go#util#PathSep() . 'src' - - let [l:dir, l:err] = go#util#ExecInDir(['go', 'list', '-f', '{{.Dir}}']) - if l:err != 0 - return [] - endif - let l:dir = split(l:dir, '\n')[0] - - let l:vendordirs = [] - while l:dir != l:root - let l:vendordir = l:dir . l:vendorsuffix - if isdirectory(l:vendordir) - let l:vendordirs = add(l:vendordirs, l:vendordir) - endif - - let l:dir = fnamemodify(l:dir, ':h') - endwhile - - return l:vendordirs - endif - - let l:vendordir = l:module.dir . l:vendorsuffix - if !isdirectory(l:vendordir) - return [] - endif - return [l:vendordir] -endfunction - -let s:import_paths = {} -" ImportPath returns the import path of the package for current buffer. It -" returns -1 if the import path cannot be determined. -function! go#package#ImportPath() abort - let l:dir = expand("%:p:h") - if has_key(s:import_paths, dir) - return s:import_paths[l:dir] - endif - - let l:importpath = go#package#FromPath(l:dir) - if type(l:importpath) == type(0) - return -1 - endif - - let s:import_paths[l:dir] = l:importpath - - return l:importpath -endfunction - -" go#package#FromPath returns the import path of arg. -1 is returned when arg -" does not specify a package. -2 is returned when arg is a relative path -" outside of GOPATH, not in a module, and not below the current working -" directory. A relative path is returned when in a null module at or below the -" current working directory.. -function! go#package#FromPath(arg) abort - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd' - let l:dir = getcwd() - - let l:path = fnamemodify(a:arg, ':p') - if !isdirectory(l:path) - let l:path = fnamemodify(l:path, ':h') - endif - - execute l:cd fnameescape(l:path) - try - if glob("*.go") == "" - " There's no Go code in this directory. We might be in a module directory - " which doesn't have any code at this level. To avoid `go list` making a - " bunch of HTTP requests to fetch dependencies, short-circuit `go list` - " and return -1 immediately. - if !empty(s:module()) - return -1 - endif - endif - let [l:out, l:err] = go#util#Exec(['go', 'list']) - if l:err != 0 - return -1 - endif - - let l:importpath = split(l:out, '\n')[0] - finally - execute l:cd fnameescape(l:dir) - endtry - - " go list returns '_CURRENTDIRECTORY' if the directory is in a null module - " (i.e. neither in GOPATH nor in a module). Return a relative import path - " if possible or an error if that is the case. - if l:importpath[0] ==# '_' - let l:relativeimportpath = fnamemodify(l:importpath[1:], ':.') - if go#util#IsWin() - let l:relativeimportpath = substitute(l:relativeimportpath, '\\', '/', 'g') - endif - - if l:relativeimportpath == l:importpath[1:] - return '.' - endif - - if l:relativeimportpath[0] == '/' - return -2 - endif - - let l:importpath= printf('./%s', l:relativeimportpath) - endif - - return l:importpath -endfunction - -function! go#package#CompleteMembers(package, member) abort - let [l:content, l:err] = go#util#Exec(['go', 'doc', a:package]) - if l:err || !len(content) - return [] - endif - - let lines = filter(split(content, "\n"),"v:val !~ '^\\s\\+$'") - try - let mx1 = '^\s\+\(\S+\)\s\+=\s\+.*' - let mx2 = '^\%(const\|var\|type\|func\) \([A-Z][^ (]\+\).*' - let candidates = map(filter(copy(lines), 'v:val =~ mx1'), - \ 'substitute(v:val, mx1, "\\1", "")') - \ + map(filter(copy(lines), 'v:val =~ mx2'), - \ 'substitute(v:val, mx2, "\\1", "")') - return filter(candidates, '!stridx(v:val, a:member)') - catch - return [] - endtry -endfunction - -function! go#package#Complete(ArgLead, CmdLine, CursorPos) abort - let words = split(a:CmdLine, '\s\+', 1) - - " do not complete package members for these commands - let neglect_commands = ["GoImportAs", "GoGuruScope"] - - if len(words) > 2 && index(neglect_commands, words[0]) == -1 - " Complete package members - return go#package#CompleteMembers(words[1], words[2]) - endif - - let dirs = s:paths() - let module = s:module() - - if len(dirs) == 0 && empty(module) - " should not happen - return [] - endif - - let vendordirs = s:vendordirs() - - let ret = {} - for dir in dirs - " this may expand to multiple lines - let root = split(expand(dir . '/pkg/' . s:goos . '_' . s:goarch), "\n") - let root = add(root, expand(dir . '/src'), ) - let root = extend(root, vendordirs) - let root = add(root, module) - for item in root - " item may be a dictionary when operating in a module. - if type(item) == type({}) - if empty(item) - continue - endif - let dir = item.dir - let path = item.path - else - let dir = item - let path = item - endif - - if !empty(module) && dir ==# module.dir - if stridx(a:ArgLead, module.path) == 0 - if len(a:ArgLead) != len(module.path) - let glob = globpath(module.dir, substitute(a:ArgLead, module.path . '/\?', '', '').'*') - else - let glob = module.dir - endif - elseif stridx(module.path, a:ArgLead) == 0 && stridx(module.path, '/', len(a:ArgLead)) < 0 - " use the module directory when a:ArgLead is contained in - " module.path and module.path does not have any path segments after - " a:ArgLead. - let glob = module.dir - else - continue - endif - else - let glob = globpath(dir, a:ArgLead.'*') - endif - for candidate in split(glob) - if isdirectory(candidate) - " TODO(bc): use wildignore instead of filtering out vendor - " directories manually? - if fnamemodify(candidate, ':t') == 'vendor' - continue - endif - let candidate .= '/' - elseif candidate !~ '\.a$' - continue - endif - - if dir !=# path - let candidate = substitute(candidate, '^' . dir, path, 'g') - else - let candidate = candidate[len(dir)+1:] - endif - " replace a backslash with a forward slash and drop .a suffixes - let candidate = substitute(substitute(candidate, '[\\]', '/', 'g'), - \ '\.a$', '', 'g') - - " without this the result can have duplicates in form of - " 'encoding/json' and '/encoding/json/' - let candidate = go#util#StripPathSep(candidate) - - let ret[candidate] = candidate - endfor - endfor - endfor - return sort(keys(ret)) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/package_test.vim b/vim-config/plugins/vim-go/autoload/go/package_test.vim deleted file mode 100644 index 4938d480..00000000 --- a/vim-config/plugins/vim-go/autoload/go/package_test.vim +++ /dev/null @@ -1,58 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_Complete_GOPATH_simple() abort - let $GOPATH = fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package' - silent exe 'edit ' . $GOPATH . '/src/package/package.go' - call s:complete('package', ['package']) -endfunc - -func! Test_Complete_Module_simple() abort - silent exe 'edit ' . fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package/src/package/package.go' - call s:complete('package', ['package']) -endfunc - -func! Test_Complete_GOPATH_subdirs() abort - let $GOPATH = fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package' - silent exe 'edit ' . $GOPATH . '/src/package/package.go' - call s:complete('package/', ['package/bar', 'package/baz']) -endfunc - -func! Test_Complete_Module_subdirs() abort - silent exe 'edit ' . fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package/src/package/package.go' - call s:complete('package/', ['package/bar', 'package/baz']) -endfunc - -func! Test_Complete_GOPATH_baronly() abort - let $GOPATH = fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package' - silent exe 'edit ' . $GOPATH . '/src/package/package.go' - call s:complete('package/bar', ['package/bar']) -endfunc - -func! Test_Complete_Module_baronly() abort - silent exe 'edit ' . fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package/src/package/package.go' - call s:complete('package/bar', ['package/bar']) -endfunc - -func! Test_Complete_GOPATH_vendor() abort - let $GOPATH = fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package' - silent exe 'edit ' . $GOPATH . '/src/package/package.go' - call s:complete('foo', ['foo']) -endfunc - -func! Test_Complete_Module_vendor() abort - silent exe 'edit ' . fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/package/src/package/package.go' - call s:complete('foo', ['foo']) -endfunc - -func! s:complete(arglead, expected) abort - let l:candidates = go#package#Complete(a:arglead, '', 1) - call assert_equal(a:expected, l:candidates) -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/path.vim b/vim-config/plugins/vim-go/autoload/go/path.vim deleted file mode 100644 index 0d81d453..00000000 --- a/vim-config/plugins/vim-go/autoload/go/path.vim +++ /dev/null @@ -1,248 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" initial_go_path is used to store the initial GOPATH that was set when Vim -" was started. It's used with :GoPathClear to restore the GOPATH when the user -" changed it explicitly via :GoPath. Initially it's empty. It's being set when -" :GoPath is used -let s:initial_go_path = "" - -" GoPath sets or echos the current GOPATH. If no arguments are passed it -" echoes the current GOPATH, if an argument is passed it replaces the current -" GOPATH with it. If two double quotes are passed (the empty string in go), -" it'll clear the GOPATH and will restore to the initial GOPATH. -function! go#path#GoPath(...) abort - " no argument, show GOPATH - if len(a:000) == 0 - echo go#path#Default() - return - endif - - " we have an argument, replace GOPATH - " clears the current manually set GOPATH and restores it to the - " initial GOPATH, which was set when Vim was started. - if len(a:000) == 1 && a:1 == '""' - if !empty(s:initial_go_path) - let $GOPATH = s:initial_go_path - let s:initial_go_path = "" - endif - - call go#util#EchoInfo("GOPATH restored to ". $GOPATH) - return - endif - - call go#util#EchoInfo("GOPATH changed to ". a:1) - let s:initial_go_path = $GOPATH - let $GOPATH = a:1 -endfunction - -" Default returns the default GOPATH. If GOPATH is not set, it uses the -" default GOPATH set starting with Go 1.8. This GOPATH can be retrieved via -" 'go env GOPATH' -function! go#path#Default() abort - if $GOPATH == "" - " use default GOPATH via go env - return go#util#env("gopath") - endif - - return $GOPATH -endfunction - -" s:HasPath checks whether the given path exists in GOPATH environment variable -" or not -function! s:HasPath(path) abort - let go_paths = split(go#path#Default(), go#util#PathListSep()) - let last_char = strlen(a:path) - 1 - - " check cases of '/foo/bar/' and '/foo/bar' - if a:path[last_char] == go#util#PathSep() - let withSep = a:path - let noSep = strpart(a:path, 0, last_char) - else - let withSep = a:path . go#util#PathSep() - let noSep = a:path - endif - - let hasA = index(go_paths, withSep) != -1 - let hasB = index(go_paths, noSep) != -1 - return hasA || hasB -endfunction - -" Detect returns the current GOPATH. If a package manager is used, such as -" Godeps, GB, it will modify the GOPATH so those directories take precedence -" over the current GOPATH. It also detects diretories whose are outside -" GOPATH. -function! go#path#Detect() abort - let gopath = go#path#Default() - - let current_dir = fnameescape(expand('%:p:h')) - - " TODO(arslan): this should be changed so folders or files should be - " fetched from a customizable list. The user should define any new package - " management tool by it's own. - - " src folders outside $GOPATH - let src_roots = finddir("src", current_dir .";", -1) - - " for cases like GOPATH/src/foo/src/bar, pick up GOPATH/src instead of - " GOPATH/src/foo/src - let src_root = "" - if len(src_roots) > 0 - let src_root = src_roots[-1] - endif - - if !empty(src_root) - let src_path = fnamemodify(src_root, ':p:h:h') . go#util#PathSep() - - " gb vendor plugin - " (https://github.com/constabulary/gb/tree/master/cmd/gb-vendor) - let gb_vendor_root = src_path . "vendor" . go#util#PathSep() - if isdirectory(gb_vendor_root) && !s:HasPath(gb_vendor_root) - let gopath = gb_vendor_root . go#util#PathListSep() . gopath - endif - - if !s:HasPath(src_path) - let gopath = src_path . go#util#PathListSep() . gopath - endif - endif - - " Godeps - let godeps_root = finddir("Godeps", current_dir .";") - if !empty(godeps_root) - let godeps_path = join([fnamemodify(godeps_root, ':p:h:h'), "Godeps", "_workspace" ], go#util#PathSep()) - - if !s:HasPath(godeps_path) - let gopath = godeps_path . go#util#PathListSep() . gopath - endif - endif - - " Fix up the case where initial $GOPATH is empty, - " and we end up with a trailing : - let gopath = substitute(gopath, ":$", "", "") - return gopath -endfunction - -" BinPath returns the binary path of installed go tools. -function! go#path#BinPath() abort - let bin_path = go#config#BinPath() - if bin_path != "" - return bin_path - endif - - " check if our global custom path is set, if not check if $GOBIN is set so - " we can use it, otherwise use default GOPATH - if $GOBIN != "" - let bin_path = $GOBIN - else - let go_paths = split(go#path#Default(), go#util#PathListSep()) - if len(go_paths) == 0 - return "" "nothing found - endif - let bin_path = expand(go_paths[0] . "/bin/") - endif - - return bin_path -endfunction - -" CheckBinPath checks whether the given binary exists or not and returns the -" path of the binary, respecting the go_bin_path and go_search_bin_path_first -" settings. It returns an empty string if the binary doesn't exist. -function! go#path#CheckBinPath(binpath) abort - " remove whitespaces if user applied something like 'goimports ' - let binpath = substitute(a:binpath, '^\s*\(.\{-}\)\s*$', '\1', '') - - " save original path - let old_path = $PATH - - " check if we have an appropriate bin_path - let go_bin_path = go#path#BinPath() - if !empty(go_bin_path) - " append our GOBIN and GOPATH paths and be sure they can be found there... - " let us search in our GOBIN and GOPATH paths - " respect the ordering specified by go_search_bin_path_first - if go#config#SearchBinPathFirst() - let $PATH = go_bin_path . go#util#PathListSep() . $PATH - else - let $PATH = $PATH . go#util#PathListSep() . go_bin_path - endif - endif - - " if it's in PATH just return it - if executable(binpath) - if exists('*exepath') - let binpath = exepath(binpath) - endif - let $PATH = old_path - - if go#util#IsUsingCygwinShell() == 1 - return s:CygwinPath(binpath) - endif - - return binpath - endif - - " just get the basename - let basename = fnamemodify(binpath, ":t") - if !executable(basename) - call go#util#EchoError(printf("could not find '%s'. Run :GoInstallBinaries to fix it", basename)) - - " restore back! - let $PATH = old_path - return "" - endif - - let $PATH = old_path - - if go#util#IsUsingCygwinShell() == 1 - return s:CygwinPath(a:binpath) - endif - - return go_bin_path . go#util#PathSep() . basename -endfunction - -function! s:CygwinPath(path) - return substitute(a:path, '\\', '/', "g") -endfunction - -" go#path#ToURI converts path to a file URI. path should be an absolute path. -" Relative paths cannot be properly converted to a URI; when path is a -" relative path, the file scheme will not be prepended. -function! go#path#ToURI(path) - let l:absolute = !go#util#IsWin() && a:path[0] is# '/' - let l:prefix = '' - let l:path = a:path - - if go#util#IsWin() && l:path[1:2] is# ':\' - let l:absolute = 1 - let l:prefix = '/' . l:path[0:1] - let l:path = l:path[2:] - endif - - return substitute( - \ (l:absolute ? 'file://' : '') . l:prefix . go#uri#EncodePath(l:path), - \ '\\', - \ '/', - \ 'g', - \) -endfunction - -function! go#path#FromURI(uri) abort - let l:i = len('file://') - let l:encoded_path = a:uri[: l:i - 1] is# 'file://' ? a:uri[l:i :] : a:uri - - let l:path = go#uri#Decode(l:encoded_path) - - " If the path is like /C:/foo/bar, it should be C:\foo\bar instead. - if go#util#IsWin() && l:path =~# '^/[a-zA-Z]:' - let l:path = substitute(l:path[1:], '/', '\\', 'g') - endif - - return l:path -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/play.vim b/vim-config/plugins/vim-go/autoload/go/play.vim deleted file mode 100644 index 980421ef..00000000 --- a/vim-config/plugins/vim-go/autoload/go/play.vim +++ /dev/null @@ -1,76 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#play#Share(count, line1, line2) abort - if !executable('curl') - call go#util#EchoError('cannot share: curl cannot be found') - return - endif - - let content = join(getline(a:line1, a:line2), "\n") - let share_file = tempname() - call writefile(split(content, "\n"), share_file, "b") - - let l:cmd = ['curl', '-s', '-X', 'POST', 'https://play.golang.org/share', - \ '--data-binary', '@' . l:share_file] - let [l:snippet_id, l:err] = go#util#Exec(l:cmd) - - " we can remove the temp file because it's now posted. - call delete(share_file) - - if l:err != 0 - call go#util#EchoError(['A error has occurred. Run this command to see what the problem is:', go#util#Shelljoin(l:cmd)]) - return - endif - - let url = "http://play.golang.org/p/".snippet_id - - " copy to clipboard - if has('unix') && !has('xterm_clipboard') && !has('clipboard') - let @" = url - else - let @+ = url - endif - - if go#config#PlayOpenBrowser() - call go#util#OpenBrowser(url) - endif - - call go#util#EchoInfo('snippet uploaded: ' . url) -endfunction - - -function! s:get_visual_content() abort - let save_regcont = @" - let save_regtype = getregtype('"') - silent! normal! gvy - let content = @" - call setreg('"', save_regcont, save_regtype) - return content -endfunction - -" modified version of -" http://stackoverflow.com/questions/1533565/how-to-get-visually-selected-text-in-vimscript -" another function that returns the content of visual selection, it's not used -" but might be useful in the future -function! s:get_visual_selection() abort - let [lnum1, col1] = getpos("'<")[1:2] - let [lnum2, col2] = getpos("'>")[1:2] - - " check if the the visual mode is used before - if lnum1 == 0 || lnum2 == 0 || col1 == 0 || col2 == 0 - return - endif - - let lines = getline(lnum1, lnum2) - let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)] - let lines[0] = lines[0][col1 - 1:] - return join(lines, "\n") -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/promise.vim b/vim-config/plugins/vim-go/autoload/go/promise.vim deleted file mode 100644 index 76c2f7c3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/promise.vim +++ /dev/null @@ -1,50 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -" New returns a promise. A promise's primary purpose is to make async jobs -" synchronous by awaiting fn. -" -" A promise is a dictionary with two keys: -" 'wrapper': -" A function that wraps fn. It can be used in place of fn. -" 'await': -" A function that waits for wrapper to be called and returns the value -" returned by fn. Returns default if timeout expires. -function! go#promise#New(fn, timeout, default) abort - let l:state = {} - - " explicitly bind to state so that within l:promise's methods, self will - " always refer to state. See :help Partial for more information. - return { - \ 'wrapper': function('s:wrapper', [a:fn], l:state), - \ 'await': function('s:await', [a:timeout, a:default], l:state), - \ } -endfunction - -function! s:wrapper(fn, ...) dict - let self.retval = call(a:fn, a:000) - return self.retval -endfunction - -function! s:await(timeout, default) dict - let l:timer = timer_start(a:timeout, function('s:setretval', [a:default], self)) - while !has_key(self, 'retval') - sleep 50m - endwhile - call timer_stop(l:timer) - - return self.retval -endfunction - -function! s:setretval(val, timer) dict - let self.retval = a:val -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/promise_test.vim b/vim-config/plugins/vim-go/autoload/go/promise_test.vim deleted file mode 100644 index f4473fe6..00000000 --- a/vim-config/plugins/vim-go/autoload/go/promise_test.vim +++ /dev/null @@ -1,41 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_PromiseNew() abort - let l:sut = go#promise#New(function('s:work', []), 100, -1) - call assert_true(has_key(l:sut, 'wrapper')) - call assert_true(has_key(l:sut, 'await')) -endfunc - -func! Test_PromiseAwait() abort - let l:expected = 1 - let l:default = -1 - let l:sut = go#promise#New(function('s:work', [l:expected]), 100, l:default) - - call timer_start(10, l:sut.wrapper) - - let l:actual = call(l:sut.await, []) - call assert_equal(l:expected, l:actual) -endfunc - -func! Test_PromiseAwait_Timeout() abort - let l:desired = 1 - let l:expected = -1 - let l:sut = go#promise#New(function('s:work', [l:desired]), 10, l:expected) - - call timer_start(100, l:sut.wrapper) - - let l:actual = call(l:sut.await, []) - call assert_equal(l:expected, l:actual) -endfunc - -func! s:work(val, timer) - return a:val -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/referrers.vim b/vim-config/plugins/vim-go/autoload/go/referrers.vim deleted file mode 100644 index 223fec6a..00000000 --- a/vim-config/plugins/vim-go/autoload/go/referrers.vim +++ /dev/null @@ -1,43 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#referrers#Referrers(selected) abort - let l:mode = go#config#ReferrersMode() - if l:mode == 'guru' - call go#guru#Referrers(a:selected) - return - elseif l:mode == 'gopls' - if !go#config#GoplsEnabled() - call go#util#EchoError("go_referrers_mode is 'gopls', but gopls is disabled") - endif - let [l:line, l:col] = getpos('.')[1:2] - let [l:line, l:col] = go#lsp#lsp#Position(l:line, l:col) - let l:fname = expand('%:p') - call go#lsp#Referrers(l:fname, l:line, l:col, funcref('s:parse_output')) - return - else - call go#util#EchoWarning('unknown value for g:go_referrers_mode') - endif -endfunction - -" This uses Vim's errorformat to parse the output and put it into a quickfix -" or locationlist. -function! s:parse_output(exit_val, output, title) abort - if a:exit_val - call go#util#EchoError(a:output) - return - endif - - let errformat = ",%f:%l:%c:\ %m" - let l:listtype = go#list#Type("GoReferrers") - call go#list#ParseFormat(l:listtype, errformat, a:output, a:title, 0) - - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) -endfunction -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/rename.vim b/vim-config/plugins/vim-go/autoload/go/rename.vim deleted file mode 100644 index 57186981..00000000 --- a/vim-config/plugins/vim-go/autoload/go/rename.vim +++ /dev/null @@ -1,140 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#rename#Rename(bang, ...) abort - let to_identifier = "" - if a:0 == 0 - let ask = printf("vim-go: rename '%s' to: ", expand("")) - let prefill = go#config#GorenamePrefill() - if prefill != '' - let to_identifier = input(ask, eval(prefill)) - else - let to_identifier = input(ask) - endif - redraw! - if empty(to_identifier) - return - endif - else - let to_identifier = a:1 - endif - - let l:bin = go#config#RenameCommand() - - " return with a warning if the bin doesn't exist - let bin_path = go#path#CheckBinPath(l:bin) - if empty(bin_path) - return - endif - - let fname = expand('%:p') - let pos = go#util#OffsetCursor() - let offset = printf('%s:#%d', fname, pos) - - let args = [] - if l:bin == 'gorename' - let l:args = extend(l:args, ['-tags', go#config#BuildTags(), '-offset', offset, '-to', to_identifier]) - elseif l:bin == 'gopls' - " TODO(bc): use -tags when gopls supports it - let l:args = extend(l:args, ['rename', '-w', l:offset, to_identifier]) - else - call go#util#EchoWarning('unexpected rename command') - endif - - let l:cmd = extend([l:bin_path], l:args) - - if go#util#has_job() - call s:rename_job({ - \ 'cmd': cmd, - \ 'bang': a:bang, - \}) - return - endif - - let [l:out, l:err] = go#util#ExecInDir(l:cmd) - call s:parse_errors(l:err, a:bang, split(l:out, '\n')) -endfunction - -function s:rename_job(args) - let l:job_opts = { - \ 'bang': a:args.bang, - \ 'for': 'GoRename', - \ 'statustype': 'gorename', - \ } - - " autowrite is not enabled for jobs - call go#cmd#autowrite() - let l:cbs = go#job#Options(l:job_opts) - - " wrap l:cbs.exit_cb in s:exit_cb. - let l:cbs.exit_cb = funcref('s:exit_cb', [l:cbs.exit_cb]) - - call go#job#Start(a:args.cmd, l:cbs) -endfunction - -function! s:reload_changed() abort - " reload all files to reflect the new changes. We explicitly call - " checktime to trigger a reload of all files. See - " http://www.mail-archive.com/vim@vim.org/msg05900.html for more info - " about the autoread bug - let current_autoread = &autoread - set autoread - silent! checktime - let &autoread = current_autoread -endfunction - -" s:exit_cb reloads any changed buffers and then calls next. -function! s:exit_cb(next, job, exitval) abort - call s:reload_changed() - call call(a:next, [a:job, a:exitval]) -endfunction - -function s:parse_errors(exit_val, bang, out) - " reload all files to reflect the new changes. We explicitly call - " checktime to trigger a reload of all files. See - " http://www.mail-archive.com/vim@vim.org/msg05900.html for more info - " about the autoread bug - let current_autoread = &autoread - set autoread - silent! checktime - let &autoread = current_autoread - - let l:listtype = go#list#Type("GoRename") - if a:exit_val != 0 - let errors = go#util#ParseErrors(a:out) - call go#list#Populate(l:listtype, errors, 'Rename') - call go#list#Window(l:listtype, len(errors)) - if !empty(errors) && !a:bang - call go#list#JumpToFirst(l:listtype) - elseif empty(errors) - " failed to parse errors, output the original content - call go#util#EchoError(a:out) - endif - - return - endif - - " strip out newline on the end that gorename puts. If we don't remove, it - " will trigger the 'Hit ENTER to continue' prompt - call go#list#Clean(l:listtype) - call go#util#EchoSuccess(a:out[0]) - - " refresh the buffer so we can see the new content - silent execute ":e" -endfunction - -" Commandline completion: original, unexported camelCase, and exported -" CamelCase. -function! go#rename#Complete(lead, cmdline, cursor) - let l:word = expand('') - return filter(uniq(sort( - \ [l:word, go#util#camelcase(l:word), go#util#pascalcase(l:word)])), - \ 'strpart(v:val, 0, len(a:lead)) == a:lead') -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/statusline.vim b/vim-config/plugins/vim-go/autoload/go/statusline.vim deleted file mode 100644 index 9779d763..00000000 --- a/vim-config/plugins/vim-go/autoload/go/statusline.vim +++ /dev/null @@ -1,124 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" Statusline -"""""""""""""""""""""""""""""""" - -" s:statuses is a global reference to all statuses. It stores the statuses per -" import paths (map[string]status), where each status is unique per its -" type. Current status dict is in form: -" { -" 'desc' : 'Job description', -" 'state' : 'Job state, such as success, failure, etc..', -" 'type' : 'Job type, such as build, test, etc..' -" 'created_at' : 'Time it was created as seconds since 1st Jan 1970' -" } -let s:statuses = {} - -" timer_id for cleaner -let s:timer_id = 0 - -" last_status stores the last generated text per status -let s:last_status = "" - -" Show returns the current status of the job for 20 seconds (configurable). It -" displays it in form of 'desc: [type|state]' if there is any state available, -" if not it returns an empty string. This function should be plugged directly -" into the statusline. -function! go#statusline#Show() abort - " lazy initialization of the cleaner - if !s:timer_id - let interval = go#config#StatuslineDuration() - let s:timer_id = timer_start(interval, function('go#statusline#Clear'), {'repeat': -1}) - endif - - " nothing to show - if empty(s:statuses) - return '' - endif - - let status_dir = expand('%:p:h') - - if !has_key(s:statuses, status_dir) - return '' - endif - - let status = s:statuses[status_dir] - if !has_key(status, 'desc') || !has_key(status, 'state') || !has_key(status, 'type') - return '' - endif - - let status_text = printf("[%s|%s]", status.type, status.state) - if empty(status_text) - return '' - endif - - " only update highlight if status has changed. - if status_text != s:last_status - if status.state =~ "success" || status.state =~ "finished" || status.state =~ "pass" || status.state =~ 'initialized' - hi goStatusLineColor cterm=bold ctermbg=76 ctermfg=22 guibg=#5fd700 guifg=#005f00 - elseif status.state =~ "started" || status.state =~ "analysing" || status.state =~ "compiling" || status.state =~ 'initializing' - hi goStatusLineColor cterm=bold ctermbg=208 ctermfg=88 guibg=#ff8700 guifg=#870000 - elseif status.state =~ "failed" - hi goStatusLineColor cterm=bold ctermbg=196 ctermfg=52 guibg=#ff0000 guifg=#5f0000 - endif - endif - - let s:last_status = status_text - return status_text -endfunction - -" Update updates (adds) the statusline for the given status_dir with the -" given status dict. It overrides any previously set status. -function! go#statusline#Update(status_dir, status) abort - let a:status.created_at = reltime() - let s:statuses[a:status_dir] = a:status - - " force to update the statusline, otherwise the user needs to move the - " cursor - exe 'let &ro = &ro' - - " before we stop the timer, check if we have any previous jobs to be cleaned - " up. Otherwise every job will reset the timer when this function is called - " and thus old jobs will never be cleaned - call s:clear() - - " also reset the timer, so the user has time to see it in the statusline. - " Setting the timer_id to 0 will cause a new timer to be created the next - " time the go#statusline#Show() is called. - call timer_stop(s:timer_id) - let s:timer_id = 0 -endfunction - -" Clear clears all currently stored statusline data. The timer_id argument is -" just a placeholder so we can pass it to a timer_start() function if needed. -function! go#statusline#Clear(timer_id) abort - call s:clear() -endfunction - -function! s:clear() - for [status_dir, status] in items(s:statuses) - let elapsed_time = reltimestr(reltime(status.created_at)) - " strip whitespace - let elapsed_time = substitute(elapsed_time, '^\s*\(.\{-}\)\s*$', '\1', '') - - if str2nr(elapsed_time) > 10 - call remove(s:statuses, status_dir) - endif - endfor - - if len(s:statuses) == 0 - let s:statuses = {} - endif - - " force to update the statusline, otherwise the user needs to move the - " cursor - exe 'let &ro = &ro' -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/tags.vim b/vim-config/plugins/vim-go/autoload/go/tags.vim deleted file mode 100644 index 2feeaa53..00000000 --- a/vim-config/plugins/vim-go/autoload/go/tags.vim +++ /dev/null @@ -1,224 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" mapped to :GoAddTags -function! go#tags#Add(start, end, count, ...) abort - let fname = fnamemodify(expand("%"), ':p:gs?\\?/?') - let offset = 0 - if a:count == -1 - let offset = go#util#OffsetCursor() - endif - - let test_mode = 0 - call call("go#tags#run", [a:start, a:end, offset, "add", fname, test_mode] + a:000) -endfunction - -" mapped to :GoRemoveTags -function! go#tags#Remove(start, end, count, ...) abort - let fname = fnamemodify(expand("%"), ':p:gs?\\?/?') - let offset = 0 - if a:count == -1 - let offset = go#util#OffsetCursor() - endif - - let test_mode = 0 - call call("go#tags#run", [a:start, a:end, offset, "remove", fname, test_mode] + a:000) -endfunction - -" run runs gomodifytag. This is an internal test so we can test it -function! go#tags#run(start, end, offset, mode, fname, test_mode, ...) abort - " do not split this into multiple lines, somehow tests fail in that case - let args = {'mode': a:mode,'start': a:start,'end': a:end,'offset': a:offset,'fname': a:fname,'cmd_args': a:000} - - if &modified - let args["modified"] = 1 - endif - - let l:result = s:create_cmd(args) - if has_key(result, 'err') - call go#util#EchoError(result.err) - return -1 - endif - - if &modified - let filename = expand("%:p:gs!\\!/!") - let content = join(go#util#GetLines(), "\n") - let in = filename . "\n" . strlen(content) . "\n" . content - let [l:out, l:err] = go#util#Exec(l:result.cmd, in) - else - let [l:out, l:err] = go#util#Exec(l:result.cmd) - endif - - if l:err != 0 - call go#util#EchoError(out) - return - endif - - if a:test_mode - exe 'edit ' . a:fname - endif - - call s:write_out(out) - - if a:test_mode - exe 'write! ' . a:fname - endif -endfunc - - -" write_out writes back the given output to the current buffer -func s:write_out(out) abort - " not a json output - if a:out[0] !=# '{' - return - endif - - " nothing to do - if empty(a:out) || type(a:out) != type("") - return - endif - - let result = json_decode(a:out) - if type(result) != type({}) - call go#util#EchoError(printf("malformed output from gomodifytags: %s", a:out)) - return - endif - - let lines = result['lines'] - let start_line = result['start'] - let end_line = result['end'] - - let index = 0 - for line in range(start_line, end_line) - call setline(line, lines[index]) - let index += 1 - endfor - - if has_key(result, 'errors') - let l:winnr = winnr() - let l:listtype = go#list#Type("GoModifyTags") - call go#list#ParseFormat(l:listtype, "%f:%l:%c:%m", result['errors'], "gomodifytags", 0) - call go#list#Window(l:listtype, len(result['errors'])) - - "prevent jumping to quickfix list - exe l:winnr . "wincmd w" - endif -endfunc - - -" create_cmd returns a dict that contains the command to execute gomodifytags -func s:create_cmd(args) abort - if !exists("*json_decode") - return {'err': "requires 'json_decode'. Update your Vim/Neovim version."} - endif - - let bin_path = go#path#CheckBinPath('gomodifytags') - if empty(bin_path) - return {'err': "gomodifytags does not exist"} - endif - - let l:start = a:args.start - let l:end = a:args.end - let l:offset = a:args.offset - let l:mode = a:args.mode - let l:cmd_args = a:args.cmd_args - let l:modifytags_transform = go#config#AddtagsTransform() - let l:modifytags_skip_unexported = go#config#AddtagsSkipUnexported() - - " start constructing the command - let cmd = [bin_path] - call extend(cmd, ["-format", "json"]) - call extend(cmd, ["-file", a:args.fname]) - call extend(cmd, ["-transform", l:modifytags_transform]) - - if l:modifytags_skip_unexported - call extend(cmd, ["-skip-unexported"]) - endif - - if has_key(a:args, "modified") - call add(cmd, "-modified") - endif - - if l:offset != 0 - call extend(cmd, ["-offset", l:offset]) - else - let range = printf("%d,%d", l:start, l:end) - call extend(cmd, ["-line", range]) - endif - - if l:mode == "add" - let l:tags = [] - let l:options = [] - - if !empty(l:cmd_args) - for item in l:cmd_args - let splitted = split(item, ",") - - " tag only - if len(splitted) == 1 - call add(l:tags, splitted[0]) - endif - - " options only - if len(splitted) == 2 - call add(l:tags, splitted[0]) - call add(l:options, printf("%s=%s", splitted[0], splitted[1])) - endif - endfor - endif - - " default value - if empty(l:tags) - let l:tags = ["json"] - endif - - " construct tags - call extend(cmd, ["-add-tags", join(l:tags, ",")]) - - " construct options - if !empty(l:options) - call extend(cmd, ["-add-options", join(l:options, ",")]) - endif - elseif l:mode == "remove" - if empty(l:cmd_args) - call add(cmd, "-clear-tags") - else - let l:tags = [] - let l:options = [] - for item in l:cmd_args - let splitted = split(item, ",") - - " tag only - if len(splitted) == 1 - call add(l:tags, splitted[0]) - endif - - " options only - if len(splitted) == 2 - call add(l:options, printf("%s=%s", splitted[0], splitted[1])) - endif - endfor - - " construct tags - if !empty(l:tags) - call extend(cmd, ["-remove-tags", join(l:tags, ",")]) - endif - - " construct options - if !empty(l:options) - call extend(cmd, ["-remove-options", join(l:options, ",")]) - endif - endif - else - return {'err': printf("unknown mode: %s", l:mode)} - endif - - return {'cmd': cmd} -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/tags_test.vim b/vim-config/plugins/vim-go/autoload/go/tags_test.vim deleted file mode 100644 index 17aec410..00000000 --- a/vim-config/plugins/vim-go/autoload/go/tags_test.vim +++ /dev/null @@ -1,52 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! TestAddTags() abort - try - let l:tmp = gotest#load_fixture('tags/add_all_input.go') - silent call go#tags#run(0, 0, 40, "add", bufname(''), 1) - call gotest#assert_fixture('tags/add_all_golden.go') - finally - call delete(l:tmp, 'rf') - endtry -endfunc - - -func! TestAddTags_WithOptions() abort - try - let l:tmp = gotest#load_fixture('tags/add_all_input.go') - silent call go#tags#run(0, 0, 40, "add", bufname(''), 1, 'json,omitempty') - call gotest#assert_fixture('tags/add_all_golden_options.go') - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! TestAddTags_AddOptions() abort - try - let l:tmp = gotest#load_fixture('tags/add_all_input.go') - silent call go#tags#run(0, 0, 40, "add", bufname(''), 1, 'json') - call gotest#assert_fixture('tags/add_all_golden.go') - silent call go#tags#run(0, 0, 40, "add", bufname(''), 1, 'json,omitempty') - call gotest#assert_fixture('tags/add_all_golden_options.go') - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_remove_tags() abort - try - let l:tmp = gotest#load_fixture('tags/remove_all_input.go') - silent call go#tags#run(0, 0, 40, "remove", bufname(''), 1) - call gotest#assert_fixture('tags/remove_all_golden.go') - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim:ts=2:sts=2:sw=2:et diff --git a/vim-config/plugins/vim-go/autoload/go/template.vim b/vim-config/plugins/vim-go/autoload/go/template.vim deleted file mode 100644 index 404047ae..00000000 --- a/vim-config/plugins/vim-go/autoload/go/template.vim +++ /dev/null @@ -1,61 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:current_file = expand("") - -function! go#template#create() abort - let l:go_template_use_pkg = go#config#TemplateUsePkg() - let l:root_dir = fnamemodify(s:current_file, ':h:h:h') - - let l:package_name = go#tool#PackageName() - - " if we can't figure out any package name (i.e. no Go files in the directory) - " from the directory create the template or use the directory as the name. - if l:package_name == -1 - if l:go_template_use_pkg == 1 - let l:path = fnamemodify(expand('%:p:h'), ':t') - let l:content = printf("package %s", l:path) - call append(0, l:content) - else - let l:filename = expand('%:t') - if l:filename =~ "_test.go$" - let l:template_file = go#config#TemplateTestFile() - else - let l:template_file = go#config#TemplateFile() - endif - " If template_file is an absolute path, use it as-is. This is to support - " overrides pointing to templates outside of the vim-go plugin dir - if fnamemodify(l:template_file, ':p') != l:template_file - let l:template_file = go#util#Join(l:root_dir, "templates", l:template_file) - endif - - silent exe 'keepalt 0r ' . fnameescape(l:template_file) - endif - else - let l:content = printf("package %s", l:package_name) - call append(0, l:content) - endif - " checking that the last line is empty shouldn't be necessary, but for some - " reason the last line isn't the expected empty line when run via tests. - if getline('$') is '' - $delete _ - endif -endfunction - -function! go#template#ToggleAutoCreate() abort - if go#config#TemplateAutocreate() - call go#config#SetTemplateAutocreate(0) - call go#util#EchoProgress("auto template create disabled") - return - end - - call go#config#SetTemplateAutocreate(1) - call go#util#EchoProgress("auto template create enabled") -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/template_test.vim b/vim-config/plugins/vim-go/autoload/go/template_test.vim deleted file mode 100644 index 2e02580d..00000000 --- a/vim-config/plugins/vim-go/autoload/go/template_test.vim +++ /dev/null @@ -1,62 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_TemplateCreate() abort - try - let l:tmp = gotest#write_file('foo/empty.txt', ['']) - - edit foo/bar.go - - call gotest#assert_buffer(1, [ - \ 'func main() {', - \ '\tfmt.Println("vim-go")', - \ '}']) - finally - call delete(l:tmp, 'rf') - endtry - - try - let l:tmp = gotest#write_file('foo/empty.txt', ['']) - edit foo/bar_test.go - - call gotest#assert_buffer(1, [ - \ 'func TestHelloWorld(t *testing.T) {', - \ '\t// t.Fatal("not implemented")', - \ '}']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_TemplateCreate_UsePkg() abort - try - let l:tmp = gotest#write_file('foo/empty.txt', ['']) - - let g:go_template_use_pkg = 1 - edit foo/bar.go - - call gotest#assert_buffer(0, ['package foo']) - finally - unlet g:go_template_use_pkg - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_TemplateCreate_PackageExists() abort - try - let l:tmp = gotest#write_file('quux/quux.go', ['package foo']) - - edit quux/bar.go - - call gotest#assert_buffer(0, ['package foo']) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/term.vim b/vim-config/plugins/vim-go/autoload/go/term.vim deleted file mode 100644 index 94091d9e..00000000 --- a/vim-config/plugins/vim-go/autoload/go/term.vim +++ /dev/null @@ -1,229 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" new creates a new terminal with the given command. Mode is set based on the -" global variable g:go_term_mode, which is by default set to :vsplit -function! go#term#new(bang, cmd, errorformat) abort - return go#term#newmode(a:bang, a:cmd, a:errorformat, go#config#TermMode()) -endfunction - -" go#term#newmode creates a new terminal with the given command and window mode. -function! go#term#newmode(bang, cmd, errorformat, mode) abort - let l:mode = a:mode - if empty(l:mode) - let l:mode = go#config#TermMode() - endif - - let l:state = { - \ 'cmd': a:cmd, - \ 'bang' : a:bang, - \ 'winid': win_getid(winnr()), - \ 'stdout': [], - \ 'stdout_buf': '', - \ 'errorformat': a:errorformat, - \ } - - " execute go build in the files directory - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let l:dir = getcwd() - - execute l:cd . fnameescape(expand("%:p:h")) - - execute l:mode . ' __go_term__' - setlocal filetype=goterm - setlocal bufhidden=delete - setlocal winfixheight - " TODO(bc)?: setlocal winfixwidth - setlocal noswapfile - setlocal nobuflisted - - " setup job for nvim - if has('nvim') - " explicitly bind callbacks to state so that within them, self will always - " refer to state. See :help Partial for more information. - " - " Don't set an on_stderr, because it will be passed the same data as - " on_stdout. See https://github.com/neovim/neovim/issues/2836 - let l:job = { - \ 'on_stdout': function('s:on_stdout', [], state), - \ 'on_exit' : function('s:on_exit', [], state), - \ } - let l:state.id = termopen(a:cmd, l:job) - let l:state.termwinid = win_getid(winnr()) - execute l:cd . fnameescape(l:dir) - - " resize new term if needed. - let l:height = go#config#TermHeight() - let l:width = go#config#TermWidth() - - " Adjust the window width or height depending on whether it's a vertical or - " horizontal split. - if l:mode =~ "vertical" || l:mode =~ "vsplit" || l:mode =~ "vnew" - exe 'vertical resize ' . l:width - elseif mode =~ "split" || mode =~ "new" - exe 'resize ' . l:height - endif - " we also need to resize the pty, so there you go... - call jobresize(l:state.id, l:width, l:height) - - " setup term for vim8 - elseif has('terminal') - let l:term = { - \ 'out_cb': function('s:out_cb', [], state), - \ 'exit_cb' : function('s:exit_cb', [], state), - \ 'curwin': 1, - \ } - - if l:mode =~ "vertical" || l:mode =~ "vsplit" || l:mode =~ "vnew" - let l:term["vertical"] = l:mode - endif - - let l:state.id = term_start(a:cmd, l:term) - let l:state.termwinid = win_getid(bufwinnr(l:state.id)) - execute l:cd . fnameescape(l:dir) - - " resize new term if needed. - let l:height = go#config#TermHeight() - let l:width = go#config#TermWidth() - - " Adjust the window width or height depending on whether it's a vertical or - " horizontal split. - if l:mode =~ "vertical" || l:mode =~ "vsplit" || l:mode =~ "vnew" - exe 'vertical resize ' . l:width - elseif mode =~ "split" || mode =~ "new" - exe 'resize ' . l:height - endif - "if exists(*term_setsize) - "call term_setsize(l:state.id, l:height, l:width) - "endif - endif - - call win_gotoid(l:state.winid) - return l:state.id -endfunction - -" out_cb continually concat's the self.stdout_buf on recv of stdout -" and sets self.stdout to the new-lined split content in self.stdout_buf -func! s:out_cb(channel, msg) dict abort - let self.stdout_buf = self.stdout_buf . a:msg - let self.stdout = split(self.stdout_buf, '\n') -endfunction - -function! s:on_stdout(job_id, data, event) dict abort - " A single empty string means EOF was reached. The first item will never be - " the empty string except for when it's the only item and is signaling that - " EOF was reached. - if len(a:data) == 1 && a:data[0] == '' - " when there's nothing buffered, return early so that an - " erroneous message will not be added. - if self.stdout_buf == '' - return - endif - - let self.stdout = add(self.stdout, self.stdout_buf) - else - let l:data = copy(a:data) - let l:data[0] = self.stdout_buf . l:data[0] - - " The last element may be a partial line; save it for next time. - let self.stdout_buf = l:data[-1] - let self.stdout = extend(self.stdout, l:data[:-2]) - endif -endfunction - -" vim8 exit callback -function! s:exit_cb(job_id, exit_status) dict abort - call s:handle_exit(a:job_id, a:exit_status, self) -endfunction - -" nvim exit callback -function! s:on_exit(job_id, exit_status, event) dict abort - call s:handle_exit(a:job_id, a:exit_status, self) -endfunction - -" handle_exit implements both vim8 and nvim exit callbacks -func s:handle_exit(job_id, exit_status, state) abort - let l:winid = win_getid(winnr()) - call win_gotoid(a:state.winid) - - let l:listtype = go#list#Type("_term") - - if a:exit_status == 0 - call go#list#Clean(l:listtype) - call win_gotoid(l:winid) - return - endif - - let l:bufdir = fnameescape(expand('%:p:h')) - if !isdirectory(l:bufdir) - call go#term#Warn('terminal job failure not processed, because the job''s working directory no longer exists') - call win_gotoid(l:winid) - return - endif - - " change to directory where the command was run. If we do not do this the - " quickfix items will have the incorrect paths. - " see: https://github.com/fatih/vim-go/issues/2400 - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let l:dir = getcwd() - execute l:cd . l:bufdir - - let l:title = a:state.cmd - if type(l:title) == v:t_list - let l:title = join(a:state.cmd) - endif - - let l:i = 0 - while l:i < len(a:state.stdout) - let a:state.stdout[l:i] = substitute(a:state.stdout[l:i], "\r$", '', 'g') - let l:i += 1 - endwhile - - call go#list#ParseFormat(l:listtype, a:state.errorformat, a:state.stdout, l:title, 0) - let l:errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(l:errors)) - - " close terminal; we don't need it anymore - if go#config#TermCloseOnExit() - call win_gotoid(a:state.termwinid) - close! - endif - - if empty(l:errors) - call go#util#EchoError( '[' . l:title . '] ' . "FAIL") - execute l:cd l:dir - call win_gotoid(l:winid) - return - endif - - if a:state.bang - execute l:cd l:dir - call win_gotoid(l:winid) - return - endif - - call win_gotoid(a:state.winid) - call go#list#JumpToFirst(l:listtype) - - " change back to original working directory - execute l:cd l:dir -endfunction - -function! go#term#ToggleCloseOnExit() abort - if go#config#TermCloseOnExit() - call go#config#SetTermCloseOnExit(0) - call go#util#EchoProgress("term close on exit disabled") - return - endif - - call go#config#SetTermCloseOnExit(1) - call go#util#EchoProgress("term close on exit enabled") - return -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/term_test.vim b/vim-config/plugins/vim-go/autoload/go/term_test.vim deleted file mode 100644 index 66b117e5..00000000 --- a/vim-config/plugins/vim-go/autoload/go/term_test.vim +++ /dev/null @@ -1,60 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_GoTermNewMode() - if !(has('nvim') || has('terminal')) - return - endif - - try - let l:filename = 'term/term.go' - let l:tmp = gotest#load_fixture(l:filename) - exe 'cd ' . l:tmp . '/src/term' - - let expected = expand('%:p') - - let cmd = "go run ". go#util#Shelljoin(go#tool#Files()) - - set nosplitright - call go#term#new(0, cmd, &errorformat) - let actual = expand('%:p') - call assert_equal(actual, l:expected) - - finally - sleep 50m - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_GoTermNewMode_SplitRight() - if !(has('nvim') || has('terminal')) - return - endif - - try - let l:filename = 'term/term.go' - let l:tmp = gotest#load_fixture(l:filename) - exe 'cd ' . l:tmp . '/src/term' - - let expected = expand('%:p') - - let cmd = "go run ". go#util#Shelljoin(go#tool#Files()) - - set splitright - call go#term#new(0, cmd, &errorformat) - let actual = expand('%:p') - call assert_equal(actual, l:expected) - - finally - sleep 50m - call delete(l:tmp, 'rf') - set nosplitright - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/cmd/bad.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/cmd/bad.go deleted file mode 100644 index a1cc46ea..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/cmd/bad.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func main() { - notafunc() -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/complete/complete.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/complete/complete.go deleted file mode 100644 index f25063fe..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/complete/complete.go +++ /dev/null @@ -1,9 +0,0 @@ -package complete - -type T struct { - V string -} - -func Example(s string) { - Example("") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/buildtags.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/buildtags.go deleted file mode 100644 index 5bf7a888..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/buildtags.go +++ /dev/null @@ -1,5 +0,0 @@ -package config - -func Example() { - foo() -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/constrainedfoo.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/constrainedfoo.go deleted file mode 100644 index 1a7b3f21..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/constrainedfoo.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build constrained - -package config - -// foo is constrained and this comment exists to make the line numbers different than foo.go -func foo() { - println("foo") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/foo.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/foo.go deleted file mode 100644 index 69266c7b..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/foo.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !constrained - -package config - -func foo() { - println("foo") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/go.mod b/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/go.mod deleted file mode 100644 index d930dc72..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/config/buildtags/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module config - -go 1.13 diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/debug/compilerror/main.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/debug/compilerror/main.go deleted file mode 100644 index 3f3dc7c2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/debug/compilerror/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go" -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/debug/debugmain/debugmain.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/debug/debugmain/debugmain.go deleted file mode 100644 index 50e8d8d3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/debug/debugmain/debugmain.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/def/jump.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/def/jump.go deleted file mode 100644 index 50e8d8d3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/def/jump.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/hello.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/hello.go deleted file mode 100644 index 3be42f6a..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/hello.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - - func main() { -fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go deleted file mode 100644 index 50e8d8d3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/goimports.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/goimports.go deleted file mode 100644 index eec47f82..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/goimports.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - -import ( - "fmt" -) - -func Foo(log *logging.TestLogger) { -log.Debug("vim-go") -} - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/goimports_golden.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/goimports_golden.go deleted file mode 100644 index 3719f6b3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/goimports_golden.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import ( - "fmt" - - logging "gh.com/gi/foo-logging" -) - -func Foo(log *logging.TestLogger) { - log.Debug("vim-go") -} - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/vendor/gh.com/gi/foo-logging/logger.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/vendor/gh.com/gi/foo-logging/logger.go deleted file mode 100644 index 13960188..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/fmt/src/imports/vendor/gh.com/gi/foo-logging/logger.go +++ /dev/null @@ -1,12 +0,0 @@ -package logging - -import "fmt" - -type TestLogger struct { - Value string -} - -func (l *TestLogger) Debug(msg string) { - fmt.Println(msg) - fmt.Println(l.Value) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/job/dir has spaces/main.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/job/dir has spaces/main.go deleted file mode 100644 index 5d31fef0..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/job/dir has spaces/main.go +++ /dev/null @@ -1,6 +0,0 @@ -package main - -func main() { - notafunc() - println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/compilererror/compilererror.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/compilererror/compilererror.go deleted file mode 100644 index 3f3dc7c2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/compilererror/compilererror.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go" -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/errcheck.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/errcheck.go deleted file mode 100644 index 72d7fc32..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/errcheck.go +++ /dev/null @@ -1,10 +0,0 @@ -package errcheck - -import ( - "io" - "os" -) - -func foo() { - io.Copy(os.Stdout, os.Stdin) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/errcheck_test.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/errcheck_test.go deleted file mode 100644 index 445d9e55..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/errcheck/errcheck_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package errcheck - -import ( - "io" - "os" - "testing" -) - -func TestFoo(t *testing.T) { - io.Copy(os.Stdout, os.Stdin) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/foo/foo.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/foo/foo.go deleted file mode 100644 index 594af18f..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/foo/foo.go +++ /dev/null @@ -1,7 +0,0 @@ -package foo - -import "fmt" - -func MissingFooDoc() { - fmt.Println("missing doc") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/baz.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/baz.go deleted file mode 100644 index ffff9fe2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/baz.go +++ /dev/null @@ -1,3 +0,0 @@ -package lint - -func baz() {} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/importabs/ok.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/importabs/ok.go deleted file mode 100644 index 8e4d5c6b..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/importabs/ok.go +++ /dev/null @@ -1,3 +0,0 @@ -package problems - -func bar() {} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/importabs/problems.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/importabs/problems.go deleted file mode 100644 index 995f3ee0..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/importabs/problems.go +++ /dev/null @@ -1,5 +0,0 @@ -package problems - -import "/quux" - -func baz() {} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/multiple/problems.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/multiple/problems.go deleted file mode 100644 index 4ec38e7f..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/multiple/problems.go +++ /dev/null @@ -1,9 +0,0 @@ -package problems - -import ( - "time" -) - -func mySleep(time int) { - time.Sleep(500 * time.Millisecond) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/shadow/problems.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/shadow/problems.go deleted file mode 100644 index bdd138a6..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/golangci-lint/problems/shadow/problems.go +++ /dev/null @@ -1,5 +0,0 @@ -package problems - -func mySleep(time int) { - time.Sleep(500 * time.Millisecond) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/lint.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/lint.go deleted file mode 100644 index 52446f52..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/lint.go +++ /dev/null @@ -1,7 +0,0 @@ -package lint - -import "fmt" - -func MissingDoc() { - fmt.Println("missing doc") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/quux.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/quux.go deleted file mode 100644 index 85c411d8..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/lint/quux.go +++ /dev/null @@ -1,7 +0,0 @@ -package lint - -import "fmt" - -func AlsoMissingDoc() { - fmt.Println("missing doc") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/vet/compilererror/compilererror.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/vet/compilererror/compilererror.go deleted file mode 100644 index 3f3dc7c2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/vet/compilererror/compilererror.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go" -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/vet/vet.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/vet/vet.go deleted file mode 100644 index d3a8e04e..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lint/src/vet/vet.go +++ /dev/null @@ -1,8 +0,0 @@ -package main - -import "fmt" - -func main() { - str := "hello world!" - fmt.Printf("%d\n", str) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/fmt/format.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/fmt/format.go deleted file mode 100644 index 3be42f6a..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/fmt/format.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - - func main() { -fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/fmt/format_golden.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/fmt/format_golden.go deleted file mode 100644 index 50e8d8d3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/fmt/format_golden.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/imports/imports.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/imports/imports.go deleted file mode 100644 index f068a3e7..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/imports/imports.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "fmt" -) - -func main() { - io.Copy(ioutil.Discard, os.Stdin) - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/imports/imports_golden.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/imports/imports_golden.go deleted file mode 100644 index 51755147..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/lsp/imports/imports_golden.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - -import ( - "fmt" - "io" - "io/ioutil" - "os" -) - -func main() { - io.Copy(ioutil.Discard, os.Stdin) - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/bar/.gitkeep b/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/bar/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/baz/.gitkeep b/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/baz/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/go.mod b/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/go.mod deleted file mode 100644 index d414eac7..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module package - -go 1.12 diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/package.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/package.go deleted file mode 100644 index 50e8d8d3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/package.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/vendor/foo/.gitkeep b/vim-config/plugins/vim-go/autoload/go/test-fixtures/package/src/package/vendor/foo/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_golden.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_golden.go deleted file mode 100644 index eaa3e7b3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_golden.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -type Server struct { - Name string `json:"name"` - ID int `json:"id"` - MyHomeAddress string `json:"my_home_address"` - SubDomains []string `json:"sub_domains"` - Empty string `json:"empty"` - Example int64 `json:"example"` - Example2 string `json:"example_2"` - Bar struct { - Four string `json:"four"` - Five string `json:"five"` - } `json:"bar"` - Lala interface{} `json:"lala"` -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_golden_options.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_golden_options.go deleted file mode 100644 index 86d296b3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_golden_options.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -type Server struct { - Name string `json:"name,omitempty"` - ID int `json:"id,omitempty"` - MyHomeAddress string `json:"my_home_address,omitempty"` - SubDomains []string `json:"sub_domains,omitempty"` - Empty string `json:"empty,omitempty"` - Example int64 `json:"example,omitempty"` - Example2 string `json:"example_2,omitempty"` - Bar struct { - Four string `json:"four,omitempty"` - Five string `json:"five,omitempty"` - } `json:"bar,omitempty"` - Lala interface{} `json:"lala,omitempty"` -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_input.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_input.go deleted file mode 100644 index bfc4d3e5..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/add_all_input.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -type Server struct { - Name string - ID int - MyHomeAddress string - SubDomains []string - Empty string - Example int64 - Example2 string - Bar struct { - Four string - Five string - } - Lala interface{} -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/remove_all_golden.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/remove_all_golden.go deleted file mode 100644 index de570858..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/remove_all_golden.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -type Server struct { - Name string - ID int - MyHomeAddress string - SubDomains []string - Empty string - Example int64 - Example2 string - Bar struct { - Four string - Five string - } - Lala interface{} -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/remove_all_input.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/remove_all_input.go deleted file mode 100644 index eaa3e7b3..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/tags/remove_all_input.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -type Server struct { - Name string `json:"name"` - ID int `json:"id"` - MyHomeAddress string `json:"my_home_address"` - SubDomains []string `json:"sub_domains"` - Empty string `json:"empty"` - Example int64 `json:"example"` - Example2 string `json:"example_2"` - Bar struct { - Four string `json:"four"` - Five string `json:"five"` - } `json:"bar"` - Lala interface{} `json:"lala"` -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/term/term.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/term/term.go deleted file mode 100644 index 73d83e64..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/term/term.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func main() { - println("hello, world") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/.gitignore b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/.gitignore deleted file mode 100644 index fc5bd908..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/pkg diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/compilerror/compilerror.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/compilerror/compilerror.go deleted file mode 100644 index 3f3dc7c2..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/compilerror/compilerror.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go" -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/example/example_test.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/example/example_test.go deleted file mode 100644 index bdcc2e10..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/example/example_test.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "fmt" -) - -func ExampleHelloWorld() { - fmt.Println("Hello, World") - // Output: What's shakin -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/play/mock/controller.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/play/mock/controller.go deleted file mode 100644 index 893d6e90..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/play/mock/controller.go +++ /dev/null @@ -1,7 +0,0 @@ -package mock - -import "testing" - -func Fail(t *testing.T) { - t.Fatal("another package badness") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/play/play_test.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/play/play_test.go deleted file mode 100644 index 0270e89e..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/play/play_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package play - -import ( - "sync" - "testing" - - "play/mock" -) - -func TestTopSubHelper(t *testing.T) { - t.Run("sub", func(t *testing.T) { - t.Log("log message") - t.Error("sub badness") - }) - t.Error("badness") - helper(t) -} - -func TestMultiline(t *testing.T) { - t.Error("this is an error\nand a second line, too") - t.Error("\nthis is another error") -} - -func TestSub(t *testing.T) { - t.Run("indented", func(t *testing.T) { - t.Error("this is a sub-test error\nand a second line, too") - }) -} - -func TestOK(t *testing.T) { - t.Run("log", func(t *testing.T) { - t.Log("goodness") - }) -} - -// TestMocked tests behavior similar to what users may experience when using -// github.com/golang/mock/gomock. -func TestMocked(t *testing.T) { - mock.Fail(t) -} - -func TestPanic(t *testing.T) { - panic("worst ever") -} - -func TestConcurrentPanic(t *testing.T) { - var wg sync.WaitGroup - wg.Add(1) - go func() { - panic("concurrent fail") - wg.Done() - }() - wg.Wait() -} - -func helper(t *testing.T) { - t.Helper() - t.Fatal("helper badness") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/showname/showname_test.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/showname/showname_test.go deleted file mode 100644 index b1290cea..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/showname/showname_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import "testing" - -func TestHelloWorld(t *testing.T) { - t.Error("so long") - - t.Run("sub", func(t *testing.T) { - t.Error("thanks for all the fish") - }) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/testcompilerror/testcompilerror_test.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/testcompilerror/testcompilerror_test.go deleted file mode 100644 index 75fdade0..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/testcompilerror/testcompilerror_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "io/ioutil" - "testing" -) - -func TestSomething(t *testing.T) { - r := struct{}{} - ioutil.ReadAll(r) -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/timeout/timeout_test.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/timeout/timeout_test.go deleted file mode 100644 index 502c39e8..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/timeout/timeout_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// Run a few parallel tests, all in parallel, using multiple techniques for -// causing the test to take a while so that the stacktraces resulting from a -// test timeout will contain several goroutines to avoid giving a false sense -// of confidence or creating error formats that don't account for the more -// complex scenarios that can occur with timeouts. - -package main - -import ( - "testing" - "time" -) - -func TestSleep(t *testing.T) { - t.Parallel() - time.Sleep(15 * time.Second) - t.Log("expected panic if run with timeout < 15s") -} - -func TestRunning(t *testing.T) { - t.Parallel() - c := time.After(15 * time.Second) -Loop: - for { - select { - case <-c: - break Loop - default: - } - } - - t.Log("expected panic if run with timeout < 15s") -} - -func TestRunningAlso(t *testing.T) { - t.Parallel() - c := time.After(15 * time.Second) -Loop: - for { - select { - case <-c: - break Loop - default: - } - } - t.Log("expected panic if run with timeout < 15s") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/veterror/veterror.go b/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/veterror/veterror.go deleted file mode 100644 index 8c585f22..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test-fixtures/test/src/veterror/veterror.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Errorf("%v") -} diff --git a/vim-config/plugins/vim-go/autoload/go/test.vim b/vim-config/plugins/vim-go/autoload/go/test.vim deleted file mode 100644 index 89dcda6b..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test.vim +++ /dev/null @@ -1,340 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" Test runs `go test` in the current directory. If compile is true, it'll -" compile the tests instead of running them (useful to catch errors in the -" test files). Any other argument is appended to the final `go test` command. -function! go#test#Test(bang, compile, ...) abort - let args = ["test"] - if len(go#config#BuildTags()) > 0 - call extend(args, ["-tags", go#config#BuildTags()]) - endif - - " don't run the test, only compile it. Useful to capture and fix errors. - if a:compile - let testfile = tempname() . ".vim-go.test" - call extend(args, ["-c", "-o", testfile]) - endif - - if a:0 - let goargs = a:000 - - " do not expand for coverage mode as we're passing the arg ourself - if a:1 != '-coverprofile' - " expand all wildcards(i.e: '%' to the current file name) - let goargs = map(copy(a:000), "expand(v:val)") - endif - - call extend(args, goargs, 1) - else - " only add this if no custom flags are passed - let timeout = go#config#TestTimeout() - call add(args, printf("-timeout=%s", timeout)) - endif - - if go#config#TermEnabled() - call go#term#new(a:bang, ["go"] + args, s:errorformat()) - return - endif - - if go#util#has_job() - " use vim's job functionality to call it asynchronously - let job_options = { - \ 'bang': a:bang, - \ 'for': 'GoTest', - \ 'statustype': 'test', - \ 'errorformat': s:errorformat(), - \ } - - if a:compile - let job_options.statustype = 'compile ' . job_options.statustype - endif - - call s:test_job(['go'] + args, job_options) - return - endif - - if go#config#EchoCommandInfo() - if a:compile - call go#util#EchoProgress("compiling tests ...") - else - call go#util#EchoProgress("testing...") - endif - endif - - call go#cmd#autowrite() - redraw - - let l:cmd = ['go'] + l:args - - let [l:out, l:err] = go#util#ExecInDir(l:cmd) - " TODO(bc): When the output is JSON, the JSON should be run through a - " filter to produce lines that are more easily described by errorformat. - - let l:listtype = go#list#Type("GoTest") - - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - execute cd fnameescape(expand("%:p:h")) - - if l:err != 0 - let l:winid = win_getid(winnr()) - call go#list#ParseFormat(l:listtype, s:errorformat(), split(out, '\n'), l:cmd, 0) - let errors = go#list#Get(l:listtype) - call go#list#Window(l:listtype, len(errors)) - if empty(errors) - " failed to parse errors, output the original content - call go#util#EchoError(out) - elseif a:bang - call win_gotoid(l:winid) - else - call go#list#JumpToFirst(l:listtype) - endif - else - call go#list#Clean(l:listtype) - - if a:compile - call go#util#EchoSuccess("[test] SUCCESS") - else - call go#util#EchoSuccess("[test] PASS") - endif - endif - execute cd . fnameescape(dir) -endfunction - -" Testfunc runs a single test that surrounds the current cursor position. -" Arguments are passed to the `go test` command. -function! go#test#Func(bang, ...) abort - " search flags legend (used only) - " 'b' search backward instead of forward - " 'c' accept a match at the cursor position - " 'n' do Not move the cursor - " 'W' don't wrap around the end of the file - " - " for the full list - " :help search - let test = search('func \(Test\|Example\)', "bcnW") - - if test == 0 - echo "vim-go: [test] no test found immediate to cursor" - return - end - - let line = getline(test) - let name = split(split(line, " ")[1], "(")[0] - let args = [a:bang, 0, "-run", name . "$"] - - if a:0 - call extend(args, a:000) - else - " only add this if no custom flags are passed - let timeout = go#config#TestTimeout() - call add(args, printf("-timeout=%s", timeout)) - endif - - call call('go#test#Test', args) -endfunction - -function! s:test_job(cmd, args) abort - " autowrite is not enabled for jobs - call go#cmd#autowrite() - - call go#job#Spawn(a:cmd, a:args) -endfunction - -let s:efm = "" -let s:go_test_show_name = 0 - -function! s:errorformat() abort - " NOTE(arslan): once we get JSON output everything will be easier :). - " TODO(bc): When the output is JSON, the JSON should be run through a - " filter to produce lines that are more easily described by errorformat. - " https://github.com/golang/go/issues/2981. - let goroot = go#util#goroot() - - let show_name = go#config#TestShowName() - if s:efm != "" && s:go_test_show_name == show_name - return s:efm - endif - let s:go_test_show_name = show_name - - " each level of test indents the test output 4 spaces. Capturing groups - " (e.g. \(\)) cannot be used in an errorformat, but non-capturing groups can - " (e.g. \%(\)). - let indent = '%\\%( %\\)' - - " ignore `go test -v` output for starting tests - let format = "%-G=== RUN %.%#" - " ignore `go test -v` output for passing tests - let format .= ",%-G" . indent . "%#--- PASS: %.%#" - - " Match failure lines. - - " Example failures start with '--- FAIL: ', followed by the example name - " followed by a space , followed by the duration of the example in - " parantheses. They aren't nested, though, so don't check for indentation. - " The errors from them also aren't indented and don't report file location - " or line numbers, so those won't show up. This will at least let the user - " know which example failed, though. - let format .= ',%G--- FAIL: %\\%(Example%\\)%\\@=%m (%.%#)' - - " Test failures start with '--- FAIL: ', followed by the test name followed - " by a space, followed by the duration of the test in parentheses. - " - " e.g.: - " '--- FAIL: TestSomething (0.00s)' - if show_name - let format .= ",%G" . indent . "%#--- FAIL: %m (%.%#)" - else - let format .= ",%-G" . indent . "%#--- FAIL: %.%#" - endif - - " Go 1.10 test output {{{1 - " Matches test output lines. - " - " All test output lines start with the test indentation and a tab, followed - " by the filename, a colon, the line number, another colon, a space, and the - " message. e.g.: - " '\ttime_test.go:30: Likely problem: the time zone files have not been installed.' - let format .= ",%A" . indent . "%#%\\t%\\+%f:%l: %m" - " also match lines that don't have a message (i.e. the message begins with a - " newline or is the empty string): - " e.g.: - " t.Errorf("\ngot %v; want %v", actual, expected) - " t.Error("") - let format .= ",%A" . indent . "%#%\\t%\\+%f:%l: " - - " Match the 2nd and later lines of multi-line output. These lines are - " indented the number of spaces for the level of nesting of the test, - " followed by two tabs, followed by the message. - " - " Treat these lines as if they are stand-alone lines of output by using %G. - " It would also be valid to treat these lines as if they were the - " continuation of a multi-line error by using %C instead of %G, but that - " would also require that all test errors using a %A or %E modifier to - " indicate that they're multiple lines of output, but in that case the lines - " get concatenated in the quickfix list, which is not what users typically - " want when writing a newline into their test output. - let format .= ",%G" . indent . "%#%\\t%\\{2}%m" - " }}}1 - - " Go 1.14 test verbose output {{{1 - " Match test output lines similarly to Go 1.11 test output lines, but they - " have the test name followed by a colon before the filename when run with - " the -v flag. - let format .= ",%A" . indent . "%\\+%[%^:]%\\+: %f:%l: %m" - let format .= ",%A" . indent . "%\\+%[%^:]%\\+: %f:%l: " - " }}}1 - - " Go 1.11 test output {{{1 - " Match test output lines similarly to Go 1.10 test output lines, but they - " use an indent level where the Go 1.10 test output uses tabs, so they'll - " always have at least one level indentation... - let format .= ",%A" . indent . "%\\+%f:%l: %m" - let format .= ",%A" . indent . "%\\+%f:%l: " - let format .= ",%G" . indent . "%\\{2\\,}%m" - " }}}1 - - " set the format for panics. - - " handle panics from test timeouts - let format .= ",%+Gpanic: test timed out after %.%\\+" - - " handle non-timeout panics - " In addition to 'panic', check for 'fatal error' to support older versions - " of Go that used 'fatal error'. - " - " Panics come in two flavors. When the goroutine running the tests panics, - " `go test` recovers and tries to exit more cleanly. In that case, the panic - " message is suffixed with ' [recovered]'. If the panic occurs in a - " different goroutine, it will not be suffixed with ' [recovered]'. - let format .= ",%+Afatal error: %.%# [recovered]" - let format .= ",%+Apanic: %.%# [recovered]" - let format .= ",%+Afatal error: %.%#" - let format .= ",%+Apanic: %.%#" - - " Match address lines in stacktraces produced by panic. - " - " Address lines in the stack trace have leading tabs, followed by the path - " to the file. The file path is followed by a colon and then the line number - " within the file where the panic occurred. After that there's a space and - " hexadecimal number. - " - " e.g.: - " '\t/usr/local/go/src/time.go:1313 +0x5d' - - " panicaddress and readyaddress are identical except for - " panicaddress sets the filename and line number. - let panicaddress = "%\\t%f:%l +0x%[0-9A-Fa-f]%\\+" - let readyaddress = "%\\t%\\f%\\+:%\\d%\\+ +0x%[0-9A-Fa-f]%\\+" - " stdlib address is identical to readyaddress, except it matches files - " inside GOROOT. - let stdlibaddress = "%\\t" . goroot . "%\\f%\\+:%\\d%\\+ +0x%[0-9A-Fa-f]%\\+" - - " Match and ignore the running goroutine line. - let format .= ",%-Cgoroutine %\\d%\\+ [running]:" - " Match address lines that refer to stdlib, but consider them informational - " only. This is to catch the lines after the first address line in the - " running goroutine of a panic stack trace. Ideally, this wouldn't be - " necessary, but when a panic happens in the goroutine running a test, it's - " recovered and another panic is created, so the stack trace actually has - " the line that caused the original panic a couple of addresses down the - " stack. - let format .= ",%-C" . stdlibaddress - " Match address lines in the first matching goroutine. This means the panic - " message will only be shown as the error message in the first address of - " the running goroutine's stack. - let format .= ",%Z" . panicaddress - - " Match and ignore errors from runtime.goparkunlock(). These started - " appearing in stack traces from Go 1.12 test timeouts. - let format .= ",%-Gruntime.goparkunlock(%.%#" - let format .= ",%-G%\\t" . goroot . "%\\f%\\+:%\\d%\\+" - - " Match and ignore panic address without being part of a multi-line message. - " This is to catch those lines that come after the top most non-standard - " library line in stack traces. - let format .= ",%-G" . readyaddress - - " Match and ignore exit status lines (produced when go test panics) whether - " part of a multi-line message or not, because these lines sometimes come - " before and sometimes after panic stacktraces. - let format .= ",%-Cexit status %[0-9]%\\+" - "let format .= ",exit status %[0-9]%\\+" - - " Match and ignore failure lines whether part of a multi-line message - " or not, because these lines sometimes come before and sometimes after - " panic stacktraces. - let format .= ",%-CFAIL%\\t%.%#" - "let format .= ",FAIL%\\t%.%#" - - " match compiler errors. - " These are very smilar to errors from <=go1.10 test output, but lack - " leading tabs for the first line of an error, and subsequent lines only - " have one tab instead of two. - let format .= ",%A%f:%l:%c: %m" - let format .= ",%A%f:%l: %m" - " It would be nice if this weren't necessary, but panic lines from tests are - " prefixed with a single leading tab, making them very similar to 2nd and - " later lines of a multi-line compiler error. Swallow it so that it doesn't - " cause a quickfix entry since the next %G entry can add a quickfix entry - " for 2nd and later lines of a multi-line compiler error. - let format .= ",%-C%\\tpanic: %.%#" - let format .= ",%G%\\t%m" - - " Match and ignore everything else in multi-line messages. - let format .= ",%-C%.%#" - " Match and ignore everything else not in a multi-line message: - let format .= ",%-G%.%#" - - let s:efm = format - - return s:efm -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/test_test.vim b/vim-config/plugins/vim-go/autoload/go/test_test.vim deleted file mode 100644 index 322abed6..00000000 --- a/vim-config/plugins/vim-go/autoload/go/test_test.vim +++ /dev/null @@ -1,143 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_GoTest() abort - let expected = [ - \ {'lnum': 12, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'log message'}, - \ {'lnum': 13, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'sub badness'}, - \ {'lnum': 15, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'badness'}, - \ {'lnum': 16, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'helper badness'}, - \ {'lnum': 20, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'this is an error'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'and a second line, too'}, - \ {'lnum': 21, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': ''}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'this is another error'}, - \ {'lnum': 26, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'this is a sub-test error'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'and a second line, too'}, - \ {'lnum': 6, 'bufnr': 3, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'another package badness'}, - \ {'lnum': 43, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'panic: worst ever [recovered]'} - \ ] - call s:test('play/play_test.go', expected) -endfunc - -func! Test_GoTestConcurrentPanic() - let expected = [ - \ {'lnum': 50, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'panic: concurrent fail'} - \ ] - call s:test('play/play_test.go', expected, "-run", "TestConcurrentPanic") -endfunc - -func! Test_GoTestVerbose() abort - let expected = [ - \ {'lnum': 12, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'log message'}, - \ {'lnum': 13, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'sub badness'}, - \ {'lnum': 15, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'badness'}, - \ {'lnum': 16, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'helper badness'}, - \ {'lnum': 20, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'this is an error'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'and a second line, too'}, - \ {'lnum': 21, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': ''}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'this is another error'}, - \ {'lnum': 26, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'this is a sub-test error'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'and a second line, too'}, - \ {'lnum': 32, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'goodness'}, - \ {'lnum': 6, 'bufnr': 3, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'another package badness'}, - \ {'lnum': 43, 'bufnr': 2, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'panic: worst ever [recovered]'} - \ ] - call s:test('play/play_test.go', expected, "-v") -endfunc - -func! Test_GoTestCompilerError() abort - let expected = [ - \ {'lnum': 6, 'bufnr': 6, 'col': 22, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'syntax error: unexpected newline, expecting comma or )'} - \ ] - call s:test('compilerror/compilerror_test.go', expected) -endfunc - -func! Test_GoTestTimeout() abort - let expected = [ - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'panic: test timed out after 500ms'} - \ ] - - let g:go_test_timeout="500ms" - call s:test('timeout/timeout_test.go', expected) - unlet g:go_test_timeout -endfunc - -func! Test_GoTestShowName() abort - let expected = [ - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'TestHelloWorld'}, - \ {'lnum': 6, 'bufnr': 8, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'so long'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'TestHelloWorld/sub'}, - \ {'lnum': 9, 'bufnr': 8, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'thanks for all the fish'}, - \ ] - - let g:go_test_show_name=1 - call s:test('showname/showname_test.go', expected) - unlet g:go_test_show_name -endfunc - -func! Test_GoTestVet() abort - let expected = [ - \ {'lnum': 6, 'bufnr': 11, 'col': 2, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'Errorf format %v reads arg #1, but call has 0 args'}, - \ ] - call s:test('veterror/veterror.go', expected) -endfunc - -func! Test_GoTestTestCompilerError() abort - let expected = [ - \ {'lnum': 10, 'bufnr': 9, 'col': 16, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'cannot use r (type struct {}) as type io.Reader in argument to ioutil.ReadAll:'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'struct {} does not implement io.Reader (missing Read method)'} - \ ] - - call s:test('testcompilerror/testcompilerror_test.go', expected) -endfunc - -func! Test_GoTestExample() abort - let expected = [ - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'ExampleHelloWorld'} - \ ] - call s:test('example/example_test.go', expected) -endfunc - -func! s:test(file, expected, ...) abort - let $GOPATH = fnameescape(fnamemodify(getcwd(), ':p')) . 'test-fixtures/test' - silent exe 'e ' . $GOPATH . '/src/' . a:file - - " clear the quickfix lists - call setqflist([], 'r') - - let args = [1,0] - if a:0 - let args += a:000 - endif - - " run the tests - silent call call(function('go#test#Test'), args) - - let actual = getqflist() - let start = reltime() - while len(actual) == 0 && reltimefloat(reltime(start)) < 10 - sleep 100m - let actual = getqflist() - endwhile - - for item in actual - let item.text = s:normalize_durations(item.text) - endfor - - for item in a:expected - let item.text = s:normalize_durations(item.text) - endfor - - call gotest#assert_quickfix(actual, a:expected) -endfunc - -func! s:normalize_durations(str) abort - return substitute(a:str, '[0-9]\+\(\.[0-9]\+\)\?s', '0.000s', 'g') -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/textobj.vim b/vim-config/plugins/vim-go/autoload/go/textobj.vim deleted file mode 100644 index 9a38c95b..00000000 --- a/vim-config/plugins/vim-go/autoload/go/textobj.vim +++ /dev/null @@ -1,284 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" ( ) motions -" { } motions -" s for sentence -" p for paragraph -" < > -" t for tag - -function! go#textobj#Comment(mode) abort - let l:fname = expand('%:p') - - try - if &modified - let l:tmpname = tempname() - call writefile(go#util#GetLines(), l:tmpname) - let l:fname = l:tmpname - endif - - let l:cmd = ['motion', - \ '-format', 'json', - \ '-file', l:fname, - \ '-offset', go#util#OffsetCursor(), - \ '-mode', 'comment', - \ ] - - let [l:out, l:err] = go#util#Exec(l:cmd) - if l:err - call go#util#EchoError(l:out) - return - endif - finally - if exists("l:tmpname") - call delete(l:tmpname) - endif - endtry - - let l:result = json_decode(l:out) - if type(l:result) != 4 || !has_key(l:result, 'comment') - return - endif - - let l:info = l:result.comment - call cursor(l:info.startLine, l:info.startCol) - - " Adjust cursor to exclude start comment markers. Try to be a little bit - " clever when using multi-line '/*' markers. - if a:mode is# 'i' - " trim whitespace so matching below works correctly - let l:line = substitute(getline('.'), '^\s*\(.\{-}\)\s*$', '\1', '') - - " //text - if l:line[:2] is# '// ' - call cursor(l:info.startLine, l:info.startCol+3) - " // text - elseif l:line[:1] is# '//' - call cursor(l:info.startLine, l:info.startCol+2) - " /* - " text - elseif l:line =~# '^/\* *$' - call cursor(l:info.startLine+1, 0) - " /* - " * text - if getline('.')[:2] is# ' * ' - call cursor(l:info.startLine+1, 4) - " /* - " *text - elseif getline('.')[:1] is# ' *' - call cursor(l:info.startLine+1, 3) - endif - " /* text - elseif l:line[:2] is# '/* ' - call cursor(l:info.startLine, l:info.startCol+3) - " /*text - elseif l:line[:1] is# '/*' - call cursor(l:info.startLine, l:info.startCol+2) - endif - endif - - normal! v - - " Exclude trailing newline. - if a:mode is# 'i' - let l:info.endCol -= 1 - endif - - call cursor(l:info.endLine, l:info.endCol) - - " Exclude trailing '*/'. - if a:mode is# 'i' - let l:line = getline('.') - " text - " */ - if l:line =~# '^ *\*/$' - call cursor(l:info.endLine - 1, len(getline(l:info.endLine - 1))) - " text */ - elseif l:line[-3:] is# ' */' - call cursor(l:info.endLine, l:info.endCol - 3) - " text*/ - elseif l:line[-2:] is# '*/' - call cursor(l:info.endLine, l:info.endCol - 2) - endif - endif -endfunction - -" Select a function in visual mode. -function! go#textobj#Function(mode) abort - let l:fname = expand("%:p") - if &modified - let l:tmpname = tempname() - call writefile(go#util#GetLines(), l:tmpname) - let l:fname = l:tmpname - endif - - let l:cmd = ['motion', - \ '-format', 'vim', - \ '-file', l:fname, - \ '-offset', go#util#OffsetCursor(), - \ '-mode', 'enclosing', - \ ] - - if go#config#TextobjIncludeFunctionDoc() - let l:cmd += ['-parse-comments'] - endif - - let [l:out, l:err] = go#util#Exec(l:cmd) - if l:err - call go#util#EchoError(out) - return - endif - - " if exists, delete it as we don't need it anymore - if exists("l:tmpname") - call delete(l:tmpname) - endif - - " convert our string dict representation into native Vim dictionary type - let result = eval(out) - if type(result) != 4 || !has_key(result, 'fn') - return - endif - - let info = result.fn - - if a:mode == 'a' - " anonymous functions doesn't have associated doc. Also check if the user - " want's to include doc comments for function declarations - if has_key(info, 'doc') && go#config#TextobjIncludeFunctionDoc() - call cursor(info.doc.line, info.doc.col) - elseif info['sig']['name'] == '' && go#config#TextobjIncludeVariable() - " one liner anonymous functions - if info.lbrace.line == info.rbrace.line - " jump to first nonblack char, to get the correct column - call cursor(info.lbrace.line, 0 ) - normal! ^ - call cursor(info.func.line, col(".")) - else - call cursor(info.func.line, info.rbrace.col) - endif - else - call cursor(info.func.line, info.func.col) - endif - - normal! v - call cursor(info.rbrace.line, info.rbrace.col) - return - endif - - " rest is inner mode, a:mode == 'i' - - " if the function is a one liner we need to select only that portion - if info.lbrace.line == info.rbrace.line - call cursor(info.lbrace.line, info.lbrace.col+1) - normal! v - call cursor(info.rbrace.line, info.rbrace.col-1) - return - endif - - call cursor(info.lbrace.line+1, 1) - normal! V - call cursor(info.rbrace.line-1, 1) -endfunction - -" Get the location of the previous or next function. -function! go#textobj#FunctionLocation(direction, cnt) abort - let l:fname = expand("%:p") - if &modified - " Write current unsaved buffer to a temp file and use the modified content - let l:tmpname = tempname() - call writefile(go#util#GetLines(), l:tmpname) - let l:fname = l:tmpname - endif - - let l:cmd = ['motion', - \ '-format', 'vim', - \ '-file', l:fname, - \ '-offset', go#util#OffsetCursor(), - \ '-shift', a:cnt, - \ '-mode', a:direction, - \ ] - - if go#config#TextobjIncludeFunctionDoc() - let l:cmd += ['-parse-comments'] - endif - - let [l:out, l:err] = go#util#Exec(l:cmd) - if l:err - call go#util#EchoError(out) - return - endif - - " if exists, delete it as we don't need it anymore - if exists("l:tmpname") - call delete(l:tmpname) - endif - - let l:result = json_decode(out) - if type(l:result) != 4 || !has_key(l:result, 'fn') - return 0 - endif - - return l:result -endfunction - -function! go#textobj#FunctionJump(mode, direction) abort - " get count of the motion. This should be done before all the normal - " expressions below as those reset this value(because they have zero - " count!). We abstract -1 because the index starts from 0 in motion. - let l:cnt = v:count1 - 1 - - " set context mark so we can jump back with '' or `` - normal! m' - - " select already previously selected visual content and continue from there. - " If it's the first time starts with the visual mode. This is needed so - " after selecting something in visual mode, every consecutive motion - " continues. - if a:mode == 'v' - normal! gv - endif - - let l:result = go#textobj#FunctionLocation(a:direction, l:cnt) - if l:result is 0 - return - endif - - " we reached the end and there are no functions. The usual [[ or ]] jumps to - " the top or bottom, we'll do the same. - if type(result) == 4 && has_key(result, 'err') && result.err == "no functions found" - if a:direction == 'next' - keepjumps normal! G - else " 'prev' - keepjumps normal! gg - endif - return - endif - - let info = result.fn - - " if we select something ,select all function - if a:mode == 'v' && a:direction == 'next' - keepjumps call cursor(info.rbrace.line, 1) - return - endif - - if a:mode == 'v' && a:direction == 'prev' - if has_key(info, 'doc') && go#config#TextobjIncludeFunctionDoc() - keepjumps call cursor(info.doc.line, 1) - else - keepjumps call cursor(info.func.line, 1) - endif - return - endif - - keepjumps call cursor(info.func.line, 1) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/tool.vim b/vim-config/plugins/vim-go/autoload/go/tool.vim deleted file mode 100644 index 50ea2b49..00000000 --- a/vim-config/plugins/vim-go/autoload/go/tool.vim +++ /dev/null @@ -1,149 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" From "go list -h". -function! go#tool#ValidFiles(...) - let l:list = ["GoFiles", "CgoFiles", "IgnoredGoFiles", "CFiles", "CXXFiles", - \ "MFiles", "HFiles", "FFiles", "SFiles", "SwigFiles", "SwigCXXFiles", - \ "SysoFiles", "TestGoFiles", "XTestGoFiles"] - - " Used as completion - if len(a:000) > 0 - let l:list = filter(l:list, 'strpart(v:val, 0, len(a:1)) == a:1') - endif - - return l:list -endfunction - -function! go#tool#Files(...) abort - if len(a:000) > 0 - let source_files = a:000 - else - let source_files = ['GoFiles'] - endif - - let combined = '' - for sf in source_files - " Strip dot in case people used ":GoFiles .GoFiles". - let sf = substitute(sf, '^\.', '', '') - - " Make sure the passed options are valid. - if index(go#tool#ValidFiles(), sf) == -1 - echoerr "unknown source file variable: " . sf - endif - - if go#util#IsWin() - let combined .= '{{range $f := .' . sf . '}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}' - else - let combined .= "{{range $f := ." . sf . "}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}" - endif - endfor - - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', l:combined]) - return split(l:out, '\n') -endfunction - -function! go#tool#Deps() abort - if go#util#IsWin() - let format = '{{range $f := .Deps}}{{$f}}{{printf \"\n\"}}{{end}}' - else - let format = "{{range $f := .Deps}}{{$f}}\n{{end}}" - endif - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', l:format]) - return split(l:out, '\n') -endfunction - -function! go#tool#Imports() abort - let imports = {} - if go#util#IsWin() - let format = '{{range $f := .Imports}}{{$f}}{{printf \"\n\"}}{{end}}' - else - let format = "{{range $f := .Imports}}{{$f}}{{printf \"\\n\"}}{{end}}" - endif - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', l:format]) - if l:err != 0 - echo out - return imports - endif - - for package_path in split(out, '\n') - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', '{{.Name}}', l:package_path]) - if l:err != 0 - echo out - return imports - endif - let package_name = substitute(l:out, '\n$', '', '') - let imports[package_name] = package_path - endfor - - return imports -endfunction - -function! go#tool#Info(showstatus) abort - let l:mode = go#config#InfoMode() - if l:mode == 'guru' - call go#guru#DescribeInfo(a:showstatus) - elseif l:mode == 'gopls' - if !go#config#GoplsEnabled() - call go#util#EchoError("go_info_mode is 'gopls', but gopls is disabled") - return - endif - call go#lsp#Info(a:showstatus) - else - call go#util#EchoError('go_info_mode value: '. l:mode .' is not valid. Valid values are: [gocode, guru, gopls]') - endif -endfunction - -function! go#tool#PackageName() abort - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', '{{.Name}}']) - if l:err != 0 - return -1 - endif - - return split(out, '\n')[0] -endfunction - -" Exists checks whether the given importpath exists or not. It returns 0 if -" the importpath exists under GOPATH. -function! go#tool#Exists(importpath) abort - let [l:out, l:err] = go#util#ExecInDir(['go', 'list', a:importpath]) - if l:err != 0 - return -1 - endif - - return 0 -endfunction - -function! go#tool#DescribeBalloon() - let l:fname = fnamemodify(bufname(v:beval_bufnr), ':p') - - let l:winid = win_getid() - - call win_gotoid(bufwinid(v:beval_bufnr)) - - let [l:line, l:col] = go#lsp#lsp#Position(v:beval_lnum, v:beval_col) - call go#lsp#Hover(l:fname, l:line, l:col, funcref('s:balloon', [])) - - call win_gotoid(l:winid) - return '' -endfunction - -function! s:balloon(msg) - let l:msg = a:msg - if has('balloon_eval') - if has('balloon_multiline') - let l:msg = join(a:msg, "\n") - else - let l:msg = substitute(join(map(deepcopy(a:msg), 'substitute(v:val, "\t", "", "")'), '; '), '{;', '{', '') - endif - endif - - call balloon_show(l:msg) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/tool_test.vim b/vim-config/plugins/vim-go/autoload/go/tool_test.vim deleted file mode 100644 index 42b86304..00000000 --- a/vim-config/plugins/vim-go/autoload/go/tool_test.vim +++ /dev/null @@ -1,31 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -func! Test_ExecuteInDir() abort - let l:tmp = gotest#write_file('a/a.go', ['package a']) - try - let l:out = go#util#ExecInDir(['pwd']) - call assert_equal([l:tmp . "/src/a\n", 0], l:out) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -func! Test_ExecuteInDir_nodir() abort - let l:tmp = go#util#tempdir("executeindir") - exe ':e ' . l:tmp . '/new-dir/a' - - try - let l:out = go#util#ExecInDir(['pwd']) - call assert_equal(['', 1], l:out) - finally - call delete(l:tmp, 'rf') - endtry -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/ui.vim b/vim-config/plugins/vim-go/autoload/go/ui.vim deleted file mode 100644 index 9d5b249e..00000000 --- a/vim-config/plugins/vim-go/autoload/go/ui.vim +++ /dev/null @@ -1,122 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let s:buf_nr = -1 - -"OpenWindow opens a new scratch window and put's the content into the window -function! go#ui#OpenWindow(title, content, filetype) abort - " Ensure there's only one return window in this session/tabpage - call go#util#Windo("unlet! w:vim_go_return_window") - " Mark the window we're leaving as such - let w:vim_go_return_window = 1 - - " reuse existing buffer window if it exists otherwise create a new one - if !bufexists(s:buf_nr) - execute 'botright new' - file `="[" . a:title . "]"` - let s:buf_nr = bufnr('%') - elseif bufwinnr(s:buf_nr) == -1 - execute 'botright new' - execute s:buf_nr . 'buffer' - elseif bufwinnr(s:buf_nr) != bufwinnr('%') - execute bufwinnr(s:buf_nr) . 'wincmd w' - endif - - " Resize window to content length - exe 'resize' . len(a:content) - - execute "setlocal filetype=".a:filetype - - " some sane default values for a readonly buffer - setlocal bufhidden=delete - setlocal buftype=nofile - setlocal noswapfile - setlocal nobuflisted - setlocal winfixheight - setlocal cursorline " make it easy to distinguish - setlocal nonumber - setlocal norelativenumber - setlocal showbreak="" - - " we need this to purge the buffer content - setlocal modifiable - - "delete everything first from the buffer - %delete _ - - " add the content - call append(0, a:content) - - " delete last line that comes from the append call - $delete _ - - " set it back to non modifiable - setlocal nomodifiable - - " Remove the '... [New File]' message line from the command line - echon -endfunction - -function! go#ui#GetReturnWindow() abort - for l:wn in range(1, winnr("$")) - if !empty(getwinvar(l:wn, "vim_go_return_window")) - return l:wn - endif - endfor -endfunction - -" CloseWindow closes the current window -function! go#ui#CloseWindow() abort - " Close any window associated with the ui buffer, if it's there - if bufexists(s:buf_nr) - let ui_window_number = bufwinnr(s:buf_nr) - if ui_window_number != -1 - execute ui_window_number . 'close' - endif - endif - - "return to original window, if it's there - let l:rw = go#ui#GetReturnWindow() - if !empty(l:rw) - execute l:rw . 'wincmd w' - unlet! w:vim_go_return_window - endif -endfunction - -" OpenDefinition parses the current line and jumps to it by openening a new -" tab -function! go#ui#OpenDefinition(filter) abort - let curline = getline('.') - - " don't touch our first line or any blank line - if curline =~ a:filter || curline =~ "^$" - " suppress information about calling this function - echo "" - return - endif - - " format: 'interface file:lnum:coln' - let mx = '^\(^\S*\)\s*\(.\{-}\):\(\d\+\):\(\d\+\)' - - " parse it now into the list - let tokens = matchlist(curline, mx) - - " convert to: 'file:lnum:coln' - let expr = tokens[2] . ":" . tokens[3] . ":" . tokens[4] - - " jump to it in a new tab, we use explicit lgetexpr so we can later change - " the behaviour via settings (like opening in vsplit instead of tab) - lgetexpr expr - tab split - ll 1 - - " center the word - norm! zz -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/uri.vim b/vim-config/plugins/vim-go/autoload/go/uri.vim deleted file mode 100644 index 74d72fb9..00000000 --- a/vim-config/plugins/vim-go/autoload/go/uri.vim +++ /dev/null @@ -1,55 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! go#uri#Encode(value) abort - return s:encode(a:value, '[^A-Za-z0-9_.~-]') -endfunction - -function! go#uri#EncodePath(value) abort - let l:separator = '/' - if go#util#IsWin() - let l:separator = '\\' - endif - return s:encode(a:value, '[^' . l:separator . 'A-Za-z0-9_.~-]') -endfunction - -function! s:encode(value, unreserved) - return substitute( - \ a:value, - \ a:unreserved, - \ '\=s:encodechar(submatch(0))', - \ 'g' - \) -endfunction - -function! go#uri#Decode(value) abort - return substitute( - \ a:value, - \ '%\(\x\x\)', - \ '\=s:decodehex(submatch(1))', - \ 'g' - \) -endfunction - -function! s:encodechar(value) - let l:idx = 0 - let l:encoded = '' - while l:idx < strlen(a:value) - let l:byte = strpart(a:value, l:idx, 1) - let l:encoded = printf('%s%%%02X', l:encoded, char2nr(l:byte)) - let l:idx += 1 - endwhile - - return l:encoded -endfunction - -function! s:decodehex(value) - return eval(printf('"\x%s"', a:value)) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/uri_test.vim b/vim-config/plugins/vim-go/autoload/go/uri_test.vim deleted file mode 100644 index 279f0459..00000000 --- a/vim-config/plugins/vim-go/autoload/go/uri_test.vim +++ /dev/null @@ -1,56 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -scriptencoding utf-8 - -func! Test_EncodePath_simple() abort - let l:uri = '/simple/foo' - let l:expected = '/simple/foo' - - let l:actual = go#uri#EncodePath(l:uri) - call assert_equal(l:expected, l:actual) -endfunc - -func! Test_EncodePath_multibyte() abort - let l:uri = '/multi-byte/⌘⌘' - let l:expected = '/multi-byte/%E2%8C%98%E2%8C%98' - - let l:actual = go#uri#EncodePath(l:uri) - call assert_equal(l:expected, l:actual) -endfunc - -func! Test_Decode_simple() abort - let l:uri = '/simple/foo' - let l:expected = '/simple/foo' - - let l:actual = go#uri#Decode(l:uri) - call assert_equal(l:expected, l:actual) -endfunc - -func! Test_Decode_multibyte() abort - let l:uri = '/multi-byte/%E2%8C%98%E2%8C%98' - let l:expected = '/multi-byte/⌘⌘' - let l:actual = go#uri#Decode(l:uri) - call assert_equal(l:expected, l:actual) -endfunc - -func! Test_Roundtrip_simple() abort - let l:expected = '/simple/foo' - - let l:actual = go#uri#Decode(go#uri#EncodePath(l:expected)) - call assert_equal(l:expected, l:actual) -endfunc - -func! Test_Roundtrip_multibyte() abort - let l:expected = '/multi-byte/⌘⌘' - - let l:actual = go#uri#Decode(go#uri#EncodePath(l:expected)) - call assert_equal(l:expected, l:actual) -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/go/util.vim b/vim-config/plugins/vim-go/autoload/go/util.vim deleted file mode 100644 index 20242f39..00000000 --- a/vim-config/plugins/vim-go/autoload/go/util.vim +++ /dev/null @@ -1,694 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" PathSep returns the appropriate OS specific path separator. -function! go#util#PathSep() abort - if go#util#IsWin() - return '\' - endif - return '/' -endfunction - -" PathListSep returns the appropriate OS specific path list separator. -function! go#util#PathListSep() abort - if go#util#IsWin() - return ";" - endif - return ":" -endfunction - -" LineEnding returns the correct line ending, based on the current fileformat -function! go#util#LineEnding() abort - if &fileformat == 'dos' - return "\r\n" - elseif &fileformat == 'mac' - return "\r" - endif - - return "\n" -endfunction - -" Join joins any number of path elements into a single path, adding a -" Separator if necessary and returns the result -function! go#util#Join(...) abort - return join(a:000, go#util#PathSep()) -endfunction - -" IsWin returns 1 if current OS is Windows or 0 otherwise -" Note that has('win32') is always 1 when has('win64') is 1, so has('win32') is enough. -function! go#util#IsWin() abort - return has('win32') -endfunction - -" IsMac returns 1 if current OS is macOS or 0 otherwise. -function! go#util#IsMac() abort - return has('mac') || - \ has('macunix') || - \ has('gui_macvim') || - \ go#util#Exec(['uname'])[0] =~? '^darwin' -endfunction - - " Checks if using: - " 1) Windows system, - " 2) And has cygpath executable, - " 3) And uses *sh* as 'shell' -function! go#util#IsUsingCygwinShell() - return go#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*' -endfunction - -" Check if Vim jobs API is supported. -" -" The (optional) first parameter can be added to indicate the 'cwd' or 'env' -" parameters will be used, which wasn't added until a later version. -function! go#util#has_job(...) abort - return has('job') || has('nvim') -endfunction - -let s:env_cache = {} - -" env returns the go environment variable for the given key. Where key can be -" GOARCH, GOOS, GOROOT, etc... It caches the result and returns the cached -" version. -function! go#util#env(key) abort - let l:key = tolower(a:key) - if has_key(s:env_cache, l:key) - return s:env_cache[l:key] - endif - - if executable('go') - let l:var = call('go#util#'.l:key, []) - if go#util#ShellError() != 0 - call go#util#EchoError(printf("'go env %s' failed", toupper(l:key))) - return '' - endif - else - let l:var = eval("$".toupper(a:key)) - endif - - let s:env_cache[l:key] = l:var - return l:var -endfunction - -" goarch returns 'go env GOARCH'. This is an internal function and shouldn't -" be used. Instead use 'go#util#env("goarch")' -function! go#util#goarch() abort - return substitute(s:exec(['go', 'env', 'GOARCH'])[0], '\n', '', 'g') -endfunction - -" goos returns 'go env GOOS'. This is an internal function and shouldn't -" be used. Instead use 'go#util#env("goos")' -function! go#util#goos() abort - return substitute(s:exec(['go', 'env', 'GOOS'])[0], '\n', '', 'g') -endfunction - -" goroot returns 'go env GOROOT'. This is an internal function and shouldn't -" be used. Instead use 'go#util#env("goroot")' -function! go#util#goroot() abort - return substitute(s:exec(['go', 'env', 'GOROOT'])[0], '\n', '', 'g') -endfunction - -" gopath returns 'go env GOPATH'. This is an internal function and shouldn't -" be used. Instead use 'go#util#env("gopath")' -function! go#util#gopath() abort - return substitute(s:exec(['go', 'env', 'GOPATH'])[0], '\n', '', 'g') -endfunction - -" gomod returns 'go env GOMOD'. gomod changes depending on the folder. Don't -" use go#util#env as it caches the value. -function! go#util#gomod() abort - return substitute(s:exec(['go', 'env', 'GOMOD'])[0], '\n', '', 'g') -endfunction - -function! go#util#osarch() abort - return go#util#env("goos") . '_' . go#util#env("goarch") -endfunction - -" go#util#ModuleRoot returns the root directory of the module of the current -" buffer. -function! go#util#ModuleRoot() abort - let [l:out, l:err] = go#util#ExecInDir(['go', 'env', 'GOMOD']) - if l:err != 0 - return -1 - endif - - let l:module = split(l:out, '\n', 1)[0] - - " When run with `GO111MODULE=on and not in a module directory, the module will be reported as /dev/null. - let l:fakeModule = '/dev/null' - if go#util#IsWin() - let l:fakeModule = 'NUL' - endif - - if l:fakeModule == l:module - return expand('%:p:h') - endif - - return fnamemodify(l:module, ':p:h') -endfunction - -" Run a shell command. -" -" It will temporary set the shell to /bin/sh for Unix-like systems if possible, -" so that we always use a standard POSIX-compatible Bourne shell (and not e.g. -" csh, fish, etc.) See #988 and #1276. -function! s:system(cmd, ...) abort - " Preserve original shell, shellredir and shellcmdflag values - let l:shell = &shell - let l:shellredir = &shellredir - let l:shellcmdflag = &shellcmdflag - - if !go#util#IsWin() && executable('/bin/sh') - set shell=/bin/sh shellredir=>%s\ 2>&1 shellcmdflag=-c - endif - - if go#util#IsWin() - if executable($COMSPEC) - let &shell = $COMSPEC - set shellcmdflag=/C - endif - endif - - try - return call('system', [a:cmd] + a:000) - finally - " Restore original values - let &shell = l:shell - let &shellredir = l:shellredir - let &shellcmdflag = l:shellcmdflag - endtry -endfunction - -" System runs a shell command "str". Every arguments after "str" is passed to -" stdin. -function! go#util#System(str, ...) abort - return call('s:system', [a:str] + a:000) -endfunction - -" Exec runs a shell command "cmd", which must be a list, one argument per item. -" Every list entry will be automatically shell-escaped -" Every other argument is passed to stdin. -function! go#util#Exec(cmd, ...) abort - if len(a:cmd) == 0 - call go#util#EchoError("go#util#Exec() called with empty a:cmd") - return ['', 1] - endif - - let l:bin = a:cmd[0] - - " Lookup the full path, respecting settings such as 'go_bin_path'. On errors, - " CheckBinPath will show a warning for us. - let l:bin = go#path#CheckBinPath(l:bin) - if empty(l:bin) - return ['', 1] - endif - - " Finally execute the command using the full, resolved path. Do not pass the - " unmodified command as the correct program might not exist in $PATH. - return call('s:exec', [[l:bin] + a:cmd[1:]] + a:000) -endfunction - -function! go#util#ExecInDir(cmd, ...) abort - if !isdirectory(expand("%:p:h")) - return ['', 1] - endif - - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd . fnameescape(expand("%:p:h")) - let [l:out, l:err] = call('go#util#Exec', [a:cmd] + a:000) - finally - execute cd . fnameescape(l:dir) - endtry - return [l:out, l:err] -endfunction - -function! s:exec(cmd, ...) abort - let l:bin = a:cmd[0] - let l:cmd = go#util#Shelljoin([l:bin] + a:cmd[1:]) - if go#util#HasDebug('shell-commands') - call go#util#EchoInfo('shell command: ' . l:cmd) - endif - - let l:out = call('s:system', [l:cmd] + a:000) - return [l:out, go#util#ShellError()] -endfunction - -function! go#util#ShellError() abort - return v:shell_error -endfunction - -" StripPath strips the path's last character if it's a path separator. -" example: '/foo/bar/' -> '/foo/bar' -function! go#util#StripPathSep(path) abort - let last_char = strlen(a:path) - 1 - if a:path[last_char] == go#util#PathSep() - return strpart(a:path, 0, last_char) - endif - - return a:path -endfunction - -" StripTrailingSlash strips the trailing slash from the given path list. -" example: ['/foo/bar/'] -> ['/foo/bar'] -function! go#util#StripTrailingSlash(paths) abort - return map(copy(a:paths), 'go#util#StripPathSep(v:val)') -endfunction - -" Shelljoin returns a shell-safe string representation of arglist. The -" {special} argument of shellescape() may optionally be passed. -function! go#util#Shelljoin(arglist, ...) abort - try - let ssl_save = &shellslash - set noshellslash - if a:0 - return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ') - endif - - return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ') - finally - let &shellslash = ssl_save - endtry -endfunction - -fu! go#util#Shellescape(arg) - try - let ssl_save = &shellslash - set noshellslash - return shellescape(a:arg) - finally - let &shellslash = ssl_save - endtry -endf - -" Shelllist returns a shell-safe representation of the items in the given -" arglist. The {special} argument of shellescape() may optionally be passed. -function! go#util#Shelllist(arglist, ...) abort - try - let ssl_save = &shellslash - set noshellslash - if a:0 - return map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')') - endif - return map(copy(a:arglist), 'shellescape(v:val)') - finally - let &shellslash = ssl_save - endtry -endfunction - -" Returns the byte offset for line and column -function! go#util#Offset(line, col) abort - if &encoding != 'utf-8' - let sep = go#util#LineEnding() - let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep) - let buf .= a:col == 1 ? '' : getline('.')[:a:col-2] - return len(iconv(buf, &encoding, 'utf-8')) - endif - return line2byte(a:line) + (a:col-2) -endfunction -" -" Returns the byte offset for the cursor -function! go#util#OffsetCursor() abort - return go#util#Offset(line('.'), col('.')) -endfunction - -" Windo is like the built-in :windo, only it returns to the window the command -" was issued from -function! go#util#Windo(command) abort - let s:currentWindow = winnr() - try - execute "windo " . a:command - finally - execute s:currentWindow. "wincmd w" - unlet s:currentWindow - endtry -endfunction - -" snippetcase converts the given word to given preferred snippet setting type -" case. -function! go#util#snippetcase(word) abort - let l:snippet_case = go#config#AddtagsTransform() - if l:snippet_case == "snakecase" - return go#util#snakecase(a:word) - elseif l:snippet_case == "camelcase" - return go#util#camelcase(a:word) - else - return a:word " do nothing - endif -endfunction - -" snakecase converts a string to snake case. i.e: FooBar -> foo_bar -" Copied from tpope/vim-abolish -function! go#util#snakecase(word) abort - let word = substitute(a:word, '::', '/', 'g') - let word = substitute(word, '\(\u\+\)\(\u\l\)', '\1_\2', 'g') - let word = substitute(word, '\(\l\|\d\)\(\u\)', '\1_\2', 'g') - let word = substitute(word, '[.-]', '_', 'g') - let word = tolower(word) - return word -endfunction - -" camelcase converts a string to camel case. e.g. FooBar or foo_bar will become -" fooBar. -" Copied from tpope/vim-abolish. -function! go#util#camelcase(word) abort - let word = substitute(a:word, '-', '_', 'g') - if word !~# '_' && word =~# '\l' - return substitute(word, '^.', '\l&', '') - else - return substitute(word, '\C\(_\)\=\(.\)', '\=submatch(1)==""?tolower(submatch(2)) : toupper(submatch(2))','g') - endif -endfunction - -" pascalcase converts a string to 'PascalCase'. e.g. fooBar or foo_bar will -" become FooBar. -function! go#util#pascalcase(word) abort - let word = go#util#camelcase(a:word) - return toupper(word[0]) . word[1:] -endfunction - -" Echo a message to the screen and highlight it with the group in a:hi. -" -" The message can be a list or string; every line with be :echomsg'd separately. -function! s:echo(msg, hi) - let l:msg = [] - if type(a:msg) != type([]) - let l:msg = split(a:msg, "\n") - else - let l:msg = a:msg - endif - - " Tabs display as ^I or <09>, so manually expand them. - let l:msg = map(l:msg, 'substitute(v:val, "\t", " ", "")') - - exe 'echohl ' . a:hi - for line in l:msg - echom "vim-go: " . line - endfor - echohl None -endfunction - -function! go#util#EchoSuccess(msg) - call s:echo(a:msg, 'Function') -endfunction -function! go#util#EchoError(msg) - call s:echo(a:msg, 'ErrorMsg') -endfunction -function! go#util#EchoWarning(msg) - call s:echo(a:msg, 'WarningMsg') -endfunction -function! go#util#EchoProgress(msg) - redraw - call s:echo(a:msg, 'Identifier') -endfunction -function! go#util#EchoInfo(msg) - call s:echo(a:msg, 'Debug') -endfunction - -" Get all lines in the buffer as a a list. -function! go#util#GetLines() - let buf = getline(1, '$') - if &encoding != 'utf-8' - let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")') - endif - if &l:fileformat == 'dos' - " XXX: line2byte() depend on 'fileformat' option. - " so if fileformat is 'dos', 'buf' must include '\r'. - let buf = map(buf, 'v:val."\r"') - endif - return buf -endfunction - -" Convert the current buffer to the "archive" format of -" golang.org/x/tools/go/buildutil: -" https://godoc.org/golang.org/x/tools/go/buildutil#ParseOverlayArchive -" -" > The archive consists of a series of files. Each file consists of a name, a -" > decimal file size and the file contents, separated by newlinews. No newline -" > follows after the file contents. -function! go#util#archive() - let l:buffer = join(go#util#GetLines(), "\n") - return expand("%:p:gs!\\!/!") . "\n" . strlen(l:buffer) . "\n" . l:buffer -endfunction - -" Make a named temporary directory which starts with "prefix". -" -" Unfortunately Vim's tempname() is not portable enough across various systems; -" see: https://github.com/mattn/vim-go/pull/3#discussion_r138084911 -function! go#util#tempdir(prefix) abort - " See :help tempfile - if go#util#IsWin() - let l:dirs = [$TMP, $TEMP, 'c:\tmp', 'c:\temp'] - else - let l:dirs = [$TMPDIR, '/tmp', './', $HOME] - endif - - let l:dir = '' - for l:d in dirs - if !empty(l:d) && filewritable(l:d) == 2 - let l:dir = l:d - break - endif - endfor - - if l:dir == '' - call go#util#EchoError('Unable to find directory to store temporary directory in') - return - endif - - " Not great randomness, but "good enough" for our purpose here. - let l:rnd = sha256(printf('%s%s', reltimestr(reltime()), fnamemodify(bufname(''), ":p"))) - let l:tmp = printf("%s/%s%s", l:dir, a:prefix, l:rnd) - call mkdir(l:tmp, 'p', 0700) - return l:tmp -endfunction - -" Report if the user enabled a debug flag in g:go_debug. -function! go#util#HasDebug(flag) - return index(go#config#Debug(), a:flag) >= 0 -endfunction - -function! go#util#OpenBrowser(url) abort - let l:cmd = go#config#PlayBrowserCommand() - if len(l:cmd) == 0 - redraw - echohl WarningMsg - echo "It seems that you don't have general web browser. Open URL below." - echohl None - echo a:url - return - endif - - " if setting starts with a !. - if l:cmd =~ '^!' - let l:cmd = substitute(l:cmd, '%URL%', '\=escape(shellescape(a:url), "#")', 'g') - silent! exec l:cmd - elseif cmd =~ '^:[A-Z]' - let l:cmd = substitute(l:cmd, '%URL%', '\=escape(a:url,"#")', 'g') - exec l:cmd - else - let l:cmd = substitute(l:cmd, '%URL%', '\=shellescape(a:url)', 'g') - call go#util#System(l:cmd) - endif -endfunction - -function! go#util#ParseErrors(lines) abort - let errors = [] - - for line in a:lines - let fatalerrors = matchlist(line, '^\(fatal error:.*\)$') - let tokens = matchlist(line, '^\s*\(.\{-}\):\(\d\+\):\s*\(.*\)') - - if !empty(fatalerrors) - call add(errors, {"text": fatalerrors[1]}) - elseif !empty(tokens) - " strip endlines of form ^M - let out = substitute(tokens[3], '\r$', '', '') - - call add(errors, { - \ "filename" : fnamemodify(tokens[1], ':p'), - \ "lnum" : tokens[2], - \ "text" : out, - \ }) - elseif !empty(errors) - " Preserve indented lines. - " This comes up especially with multi-line test output. - if match(line, '^\s') >= 0 - call add(errors, {"text": substitute(line, '\r$', '', '')}) - endif - endif - endfor - - return errors -endfunction - -function! go#util#ShowInfo(info) - if empty(a:info) - return - endif - - echo "vim-go: " | echohl Function | echon a:info | echohl None -endfunction - -" go#util#SetEnv takes the name of an environment variable and what its value -" should be and returns a function that will restore it to its original value. -function! go#util#SetEnv(name, value) abort - let l:state = {} - - if len(a:name) == 0 - return function('s:noop', [], l:state) - endif - - let l:remove = 0 - if exists('$' . a:name) - let l:oldvalue = eval('$' . a:name) - else - let l:remove = 1 - endif - - " wrap the value in single quotes so that it will work on windows when there - " are backslashes present in the value (e.g. $PATH). - call execute('let $' . a:name . " = '" . a:value . "'") - - if l:remove - return function('s:unset', [a:name], l:state) - endif - - return function('go#util#SetEnv', [a:name, l:oldvalue], l:state) -endfunction - -function! go#util#ClearHighlights(group) abort - if has('textprop') - " the property type may not exist when syntax highlighting is not enabled. - if empty(prop_type_get(a:group)) - return - endif - if !has('patch-8.1.1035') - return prop_remove({'type': a:group, 'all': 1}, 1, line('$')) - endif - return prop_remove({'type': a:group, 'all': 1}) - endif - - if exists("*matchaddpos") - return s:clear_group_from_matches(a:group) - endif -endfunction - -function! s:clear_group_from_matches(group) abort - let l:cleared = 0 - - let m = getmatches() - for item in m - if item['group'] == a:group - call matchdelete(item['id']) - let l:cleared = 1 - endif - endfor - - return l:cleared -endfunction - -function! s:unset(name) abort - try - " unlet $VAR was introducted in Vim 8.0.1832, which is newer than the - " minimal version that vim-go supports. Set the environment variable to - " the empty string in that case. It's not perfect, but it will work fine - " for most things, and is really the best alternative that's available. - if !has('patch-8.0.1832') - call go#util#SetEnv(a:name, '') - return - endif - - call execute('unlet $' . a:name) - catch - call go#util#EchoError(printf('could not unset $%s: %s', a:name, v:exception)) - endtry -endfunction - -function! s:noop(...) abort dict -endfunction - -" go#util#HighlightPositions highlights using text properties if possible and -" falls back to matchaddpos() if necessary. It works around matchaddpos()'s -" limit of only 8 positions per call by calling matchaddpos() with no more -" than 8 positions per call. -" -" pos should be a list of 3 element lists. The lists should be [line, col, -" length] as used by matchaddpos(). -function! go#util#HighlightPositions(group, pos) abort - if has('textprop') - for l:pos in a:pos - " use a single line prop by default - let l:prop = {'type': a:group, 'length': l:pos[2]} - - let l:line = getline(l:pos[0]) - - " l:max is the 1-based index within the buffer of the first character after l:pos. - let l:max = line2byte(l:pos[0]) + l:pos[1] + l:pos[2] - 1 - if has('patch-8.2.115') - " Use byte2line as long as 8.2.115 (which resolved - " https://github.com/vim/vim/issues/5334) is available. - let l:end_lnum = byte2line(l:max) - - " specify end line and column if needed. - if l:pos[0] != l:end_lnum - let l:end_col = l:max - line2byte(l:end_lnum) - let l:prop = {'type': a:group, 'end_lnum': l:end_lnum, 'end_col': l:end_col} - endif - elseif l:pos[1] + l:pos[2] - 1 > len(l:line) - let l:end_lnum = l:pos[0] - while line2byte(l:end_lnum+1) < l:max - let l:end_lnum += 1 - endwhile - - " l:end_col is the full length - the byte position of l:end_lnum + - " the number of newlines (number of newlines is l:end_lnum - - " l:pos[0]. - let l:end_col = l:max - line2byte(l:end_lnum) + l:end_lnum - l:pos[0] - let l:prop = {'type': a:group, 'end_lnum': l:end_lnum, 'end_col': l:end_col} - endif - call prop_add(l:pos[0], l:pos[1], l:prop) - endfor - return - endif - - if exists('*matchaddpos') - return s:matchaddpos(a:group, a:pos) - endif -endfunction - -" s:matchaddpos works around matchaddpos()'s limit of only 8 positions per -" call by calling matchaddpos() with no more than 8 positions per call. -function! s:matchaddpos(group, pos) abort - let l:partitions = [] - let l:partitionsIdx = 0 - let l:posIdx = 0 - for l:pos in a:pos - if l:posIdx % 8 == 0 - let l:partitions = add(l:partitions, []) - let l:partitionsIdx = len(l:partitions) - 1 - endif - let l:partitions[l:partitionsIdx] = add(l:partitions[l:partitionsIdx], l:pos) - let l:posIdx = l:posIdx + 1 - endfor - - for l:positions in l:partitions - call matchaddpos(a:group, l:positions) - endfor -endfunction - -function! go#util#Chdir(dir) abort - if !exists('*chdir') - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - execute cd . a:dir - return - endif - call chdir(a:dir) -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/gotest.vim b/vim-config/plugins/vim-go/autoload/gotest.vim deleted file mode 100644 index 5915a045..00000000 --- a/vim-config/plugins/vim-go/autoload/gotest.vim +++ /dev/null @@ -1,154 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" Write a Go file to a temporary directory and append this directory to $GOPATH. -" -" The file will written to a:path, which is relative to the temporary directory, -" and this file will be loaded as the current buffer. -" -" The cursor will be placed on the character before any 0x1f byte. -" -" The full path to the created directory is returned, it is the caller's -" responsibility to clean that up! -fun! gotest#write_file(path, contents) abort - let l:dir = go#util#tempdir("vim-go-test/testrun/") - let $GOPATH .= ':' . l:dir - let l:full_path = l:dir . '/src/' . a:path - - call mkdir(fnamemodify(l:full_path, ':h'), 'p') - call writefile(a:contents, l:full_path) - call go#util#Chdir(l:dir . '/src') - - silent exe 'e! ' . a:path - - " Set cursor. - let l:lnum = 1 - for l:line in a:contents - let l:m = stridx(l:line, "\x1f") - if l:m > -1 - let l:byte = line2byte(l:lnum) + l:m - exe 'goto '. l:byte - call setline('.', substitute(getline('.'), "\x1f", '', '')) - silent noautocmd w! - - call go#lsp#DidClose(expand('%:p')) - call go#lsp#DidOpen(expand('%:p')) - - break - endif - - let l:lnum += 1 - endfor - - return l:dir -endfun - -" Load a fixture file from test-fixtures. -" -" The file will be copied to a new GOPATH-compliant temporary directory and -" loaded as the current buffer. -fun! gotest#load_fixture(path) abort - if go#util#has_job() - call go#lsp#CleanWorkspaces() - endif - let l:dir = go#util#tempdir("vim-go-test/testrun/") - let $GOPATH .= ':' . l:dir - let l:full_path = l:dir . '/src/' . a:path - - call mkdir(fnamemodify(l:full_path, ':h'), 'p') - call go#util#Chdir(l:dir . '/src') - silent exe 'noautocmd e ' . a:path - silent exe printf('read %s/test-fixtures/%s', g:vim_go_root, a:path) - silent noautocmd w! - if go#util#has_job() - call go#lsp#AddWorkspaceDirectory(fnamemodify(l:full_path, ':p:h')) - endif - - return l:dir -endfun - -" Diff the contents of the current buffer to a:want, which should be a list. -" If a:skipHeader is true we won't bother with the package and import -" declarations; so e.g.: -" -" let l:diff = s:diff_buffer(1, ['_ = mail.Address{}']) -" -" will pass, whereas otherwise you'd have to: -" -" let l:diff = s:diff_buffer(0, ['package main', 'import "net/mail", '_ = mail.Address{}']) -fun! gotest#assert_buffer(skipHeader, want) abort - let l:buffer = go#util#GetLines() - - if a:skipHeader - for l:lnum in range(0, len(l:buffer) - 1) - " Bit rudimentary, but works reasonably well. - if match(l:buffer[l:lnum], '^\v(func|var|const|import \(|\))') > -1 - " vint bug: https://github.com/Kuniwak/vint/issues/179 - " vint: -ProhibitUsingUndeclaredVariable - let l:buffer = l:buffer[l:lnum:len(l:buffer)] - break - endif - endfor - endif - - " Using ' is often easier so we don't have to escape ". - let l:want = map(a:want, 'substitute(v:val, "\\\\t", "\t", "")') - - let l:tmp = go#util#tempdir('assert_buffer') - try - call writefile(l:buffer, l:tmp . '/have') - call writefile(l:want, l:tmp . '/want') - call go#fmt#run('gofmt', l:tmp . '/have', l:tmp . '/have') - call go#fmt#run('gofmt', l:tmp . '/want', l:tmp . '/want') - let [l:out, l:err] = go#util#Exec(["diff", "-u", l:tmp . '/have', l:tmp . '/want']) - finally - call delete(l:tmp . '/have') - call delete(l:tmp . '/want') - call delete(l:tmp, 'd') - endtry - - if l:err || l:out != '' - let v:errors = extend(v:errors, split(l:out, "\n")) - endif -endfun - -" Diff the contents of the current buffer to the fixture file in a:path. -fun! gotest#assert_fixture(path) abort - let l:want = readfile(printf('%s/test-fixtures/%s', g:vim_go_root, a:path)) - call gotest#assert_buffer(0, l:want) -endfun - -func! gotest#assert_quickfix(got, want) abort - call assert_equal(len(a:want), len(a:got), "number of errors") - if len(a:want) != len(a:got) - return assert_equal(a:want, a:got) - endif - - let l:retval = 0 - let i = 0 - - while i < len(a:want) - let want_item = a:want[i] - let got_item = a:got[i] - let i += 1 - - let l:retval = assert_equal(want_item.bufnr, got_item.bufnr, "bufnr") || l:retval - let l:retval = assert_equal(want_item.lnum, got_item.lnum, "lnum") || l:retval - let l:retval = assert_equal(want_item.col, got_item.col, "col") || l:retval - let l:retval = assert_equal(want_item.vcol, got_item.vcol, "vcol") || l:retval - let l:retval = assert_equal(want_item.nr, got_item.nr, "nr") || l:retval - let l:retval = assert_equal(want_item.pattern, got_item.pattern, "pattern") || l:retval - let l:retval = assert_equal(want_item.text, got_item.text, "text") || l:retval - let l:retval = assert_equal(want_item.type, got_item.type, "type") || l:retval - let l:retval = assert_equal(want_item.valid, got_item.valid, "valid") || l:retval - endwhile - - return l:retval -endfunc - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/autoload/unite/sources/decls.vim b/vim-config/plugins/vim-go/autoload/unite/sources/decls.vim deleted file mode 100644 index 31138085..00000000 --- a/vim-config/plugins/vim-go/autoload/unite/sources/decls.vim +++ /dev/null @@ -1,70 +0,0 @@ -let s:save_cpo = &cpoptions -set cpoptions&vim - -let s:source = { - \ 'name': 'decls', - \ 'description': 'GoDecls implementation for unite', - \ 'syntax': 'uniteSource__Decls', - \ 'action_table': {}, - \ 'hooks': {}, - \ } - -function! unite#sources#decls#define() - return s:source -endfunction - -function! s:source.gather_candidates(args, context) abort - let l:bin_path = go#path#CheckBinPath('motion') - if empty(l:bin_path) - return [] - endif - - let l:path = expand(get(a:args, 0, '%:p:h')) - if isdirectory(l:path) - let l:mode = 'dir' - elseif filereadable(l:path) - let l:mode = 'file' - else - return [] - endif - - let l:include = go#config#DeclsIncludes() - let l:command = printf('%s -format vim -mode decls -include %s -%s %s', l:bin_path, l:include, l:mode, shellescape(l:path)) - let l:candidates = [] - try - let l:result = eval(unite#util#system(l:command)) - let l:candidates = get(l:result, 'decls', []) - catch - call unite#print_source_error(['command returned invalid response.', v:exception], s:source.name) - endtry - - return map(l:candidates, "{ - \ 'word': printf('%s :%d :%s', fnamemodify(v:val.filename, ':~:.'), v:val.line, v:val.full), - \ 'kind': 'jump_list', - \ 'action__path': v:val.filename, - \ 'action__line': v:val.line, - \ 'action__col': v:val.col, - \ }") -endfunction - -function! s:source.hooks.on_syntax(args, context) abort - syntax match uniteSource__Decls_Filepath /[^:]*\ze:/ contained containedin=uniteSource__Decls - syntax match uniteSource__Decls_Line /\d\+\ze :/ contained containedin=uniteSource__Decls - syntax match uniteSource__Decls_WholeFunction /\vfunc %(\([^)]+\) )?[^(]+/ contained containedin=uniteSource__Decls - syntax match uniteSource__Decls_Function /\S\+\ze(/ contained containedin=uniteSource__Decls_WholeFunction - syntax match uniteSource__Decls_WholeType /type \S\+/ contained containedin=uniteSource__Decls - syntax match uniteSource__Decls_Type /\v( )@<=\S+/ contained containedin=uniteSource__Decls_WholeType - highlight default link uniteSource__Decls_Filepath Comment - highlight default link uniteSource__Decls_Line LineNr - highlight default link uniteSource__Decls_Function Function - highlight default link uniteSource__Decls_Type Type - - syntax match uniteSource__Decls_Separator /:/ contained containedin=uniteSource__Decls conceal - syntax match uniteSource__Decls_SeparatorFunction /func / contained containedin=uniteSource__Decls_WholeFunction conceal - syntax match uniteSource__Decls_SeparatorType /type / contained containedin=uniteSource__Decls_WholeType conceal -endfunction - -let &cpoptions = s:save_cpo -unlet s:save_cpo - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/compiler/go.vim b/vim-config/plugins/vim-go/compiler/go.vim deleted file mode 100644 index 0bd6a154..00000000 --- a/vim-config/plugins/vim-go/compiler/go.vim +++ /dev/null @@ -1,48 +0,0 @@ -" Copyright 2013 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" compiler/go.vim: Vim compiler file for Go. - -if exists("g:current_compiler") - finish -endif -let g:current_compiler = "go" - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -if exists(":CompilerSet") != 2 - command -nargs=* CompilerSet setlocal -endif - -let s:save_cpo = &cpo -set cpo-=C -if filereadable("makefile") || filereadable("Makefile") - CompilerSet makeprg=make -else - CompilerSet makeprg=go\ build -endif - -" Define the patterns that will be recognized by QuickFix when parsing the -" output of Go command that use this errorforamt (when called make, cexpr or -" lmake, lexpr). This is the global errorformat, however some command might -" use a different output, for those we define them directly and modify the -" errorformat ourselves. More information at: -" http://vimdoc.sourceforge.net/htmldoc/quickfix.html#errorformat -CompilerSet errorformat =%-G#\ %.%# " Ignore lines beginning with '#' ('# command-line-arguments' line sometimes appears?) -CompilerSet errorformat+=%-G%.%#panic:\ %m " Ignore lines containing 'panic: message' -CompilerSet errorformat+=%Ecan\'t\ load\ package:\ %m " Start of multiline error string is 'can\'t load package' -CompilerSet errorformat+=%A%\\%%(%[%^:]%\\+:\ %\\)%\\?%f:%l:%c:\ %m " Start of multiline unspecified string is 'filename:linenumber:columnnumber:' -CompilerSet errorformat+=%A%\\%%(%[%^:]%\\+:\ %\\)%\\?%f:%l:\ %m " Start of multiline unspecified string is 'filename:linenumber:' -CompilerSet errorformat+=%C%*\\s%m " Continuation of multiline error message is indented -CompilerSet errorformat+=%-G%.%# " All lines not matching any of the above patterns are ignored -let &cpo = s:save_cpo -unlet s:save_cpo - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/doc/vim-go.txt b/vim-config/plugins/vim-go/doc/vim-go.txt deleted file mode 100644 index e18129d6..00000000 --- a/vim-config/plugins/vim-go/doc/vim-go.txt +++ /dev/null @@ -1,2692 +0,0 @@ -*vim-go.txt* Go development plugin -*vim-go* - -============================================================================== -# # -# ## ## #### ## ## ###### ####### # -# ## ## ## ### ### ## ## ## ## # -# ## ## ## #### #### ## ## ## # -# ## ## ## ## ### ## ####### ## #### ## ## # -# ## ## ## ## ## ## ## ## ## # -# ## ## ## ## ## ## ## ## ## # -# ### #### ## ## ###### ####### # -# # -============================================================================== -CONTENTS *go-contents* - - 1. Intro........................................|go-intro| - 2. Install......................................|go-install| - 3. Commands.....................................|go-commands| - 4. Mappings.....................................|go-mappings| - 5. Text Objects.................................|go-text-objects| - 6. Functions....................................|go-functions| - 7. Settings.....................................|go-settings| - 8. Syntax highlighting..........................|go-syntax| - 9. Debugger.....................................|go-debug| - 10. FAQ/Troubleshooting..........................|go-troubleshooting| - 11. Development..................................|go-development| - 12. Donation.....................................|go-donation| - 13. Credits......................................|go-credits| - -============================================================================== -INTRO *go-intro* - -Go (golang) support for Vim. vim-go comes with sensible predefined settings -(e.g. automatic `gofmt` on save), has code completion, snippet support, -improved syntax highlighting, go toolchain commands, etc. It is highly -customizable, and individual features can be toggled easily. vim-go leverages -a number of tools developed by the Go community to provide a seamless Vim -experience. - - * Compile your package with |:GoBuild|, install it with |:GoInstall| or - test it with |:GoTest|. Run a single test with |:GoTestFunc|). - * Quickly execute your current file(s) with |:GoRun|. - * Improved syntax highlighting and folding. - * Debug programs with integrated `delve` support with |:GoDebugStart|. - * Code completion support via `gocode` and `gopls`. - * `gofmt` or `goimports` on save keeps the cursor position and undo history. - * Go to symbol/declaration with |:GoDef|. - * Look up documentation with |:GoDoc| or |:GoDocBrowser|. - * Easily import packages via |:GoImport|, remove them via |:GoDrop|. - * Precise type-safe renaming of identifiers with |:GoRename|. - * See which code is covered by tests with |:GoCoverage|. - * Add or remove tags on struct fields with |:GoAddTags| and |:GoRemoveTags|. - * Call `golangci-lint` with |:GoMetaLinter| to invoke all possible linters - (`golint`, `vet`, `errcheck`, `deadcode`, etc.) and put the result in the - quickfix or location list. - * Lint your code with |:GoLint|, run your code through |:GoVet| to catch - static errors, or make sure errors are checked with |:GoErrCheck|. - * Advanced source analysis tools utilizing `guru`, such as |:GoImplements|, - |:GoCallees|, and |:GoReferrers|. - * Automatic `GOPATH` detection which works with `gb` and `godep`. Change or - display `GOPATH` with |:GoPath|. - * Integrated and improved snippets, supporting `ultisnips`, `neosnippet`, - and `vim-minisnip`. - * Share your current code to play.golang.org with |:GoPlay|. - * On-the-fly information about the word under the cursor. Plug it into your - custom Vim function. - * Text objects such as "a function" (|go-af|) or "inner function" (|go-if|). - * Most commands are run asynchronous in Neovim and Vim 8. Fully async - building and testing. - * Integrated with the Neovim terminal, launch |:GoRun| and other Go commands - in a terminal buffer. - * Switch between `file.go` and `file_test.go` code with |:GoAlternate|. - * Supports integration with the Tagbar and ctrlp.vim plugins. - * ...and more... - -============================================================================== -INSTALL *go-install* - -vim-go requires at least Vim 8.0.1453 or Neovim 0.4.0. On macOS, if you are -still using your system version of vim, you can use homebrew to keep your -version of Vim up-to-date with the following terminal command: -> - brew install vim - -The latest stable release, https://github.com/fatih/vim-go/releases/latest, is -the recommended version to use. If you choose to use the master branch -instead, please do so with caution; it is a _development_ branch. - -vim-go follows the standard runtime path structure and should work with any of -the major plugin managers. - -For Pathogen or Vim |packages|, just clone the repo. For other plugin managers -you may also need to add the lines to your vimrc to execute the plugin -manager's install command. - -* Vim 8 |packages| > - - git clone https://github.com/fatih/vim-go.git \ - ~/.vim/pack/plugins/start/vim-go -< -* https://github.com/tpope/vim-pathogen > - - git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go -< -* https://github.com/junegunn/vim-plug > - - Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } -< -* https://github.com/Shougo/neobundle.vim > - - NeoBundle 'fatih/vim-go' -< -* https://github.com/gmarik/vundle > - - Plugin 'fatih/vim-go' -< -* Manual (not recommended) > - - Copy all of the files into your `~/.vim` directory -< - -You will also need to install all the necessary binaries. vim-go makes it easy -to install all of them by providing a command, |:GoInstallBinaries|, to -`go get` all the required binaries. The binaries will be installed to $GOBIN -or $GOPATH/bin (default: $HOME/go/bin). It requires `git`. - -Depending on your installation method, you may have to generate the plugin's -|:helptags| manually (e.g. `:helptags ALL`). - -Code completion is enabled by default via 'omnifunc', which you can trigger -with |i_CTRL-X_CTRL-O| (``). - -Supported Go plugins~ *vim-go-plugins* - -The following plugins are supported for use with vim-go: - -* Real-time completion (Vim): - https://github.com/Shougo/neocomplete.vim - -* Real-time completion (Neovim and Vim 8): - https://github.com/Shougo/deoplete.nvim - - Add the following line to your vimrc. This instructs deoplete to use omni - completion for Go files. - - call deoplete#custom#option('omni_patterns', { 'go': '[^. *\t]\.\w*' }) - -* Display source code navigation in a sidebar: - https://github.com/majutsushi/tagbar - -* Snippets: - https://github.com/Shougo/neosnippet.vim or - https://github.com/SirVer/ultisnips or - https://github.com/joereynolds/vim-minisnip - -* Interactive |:GoDecls| and |:GoDeclsDir|: - https://github.com/ctrlpvim/ctrlp.vim or - https://github.com/junegunn/fzf.vim or - https://github.com/Shougo/unite.vim or - https://github.com/Shougo/denite.nvim - -============================================================================== -COMMANDS *go-commands* - - *:GoReportGitHubIssue* -:GoReportGitHubIssue - GoReportGitHubIssue opens the default browser and starts a new bug report - with useful system information. - - *:GoPath* -:GoPath [path] - - GoPath sets and overrides GOPATH with the given {path}. If no {path} is - given it shows the current GOPATH. If `""` is given as path, it clears - current `GOPATH` which was set with |:GoPath| and restores `GOPATH` back - to the initial value which was sourced when Vim was started. - - *:GoImport* -:GoImport[!] [path] - - Import ensures that the provided package {path} is imported in the current - Go buffer, using proper style and ordering. If {path} is already being - imported, an error will be displayed and the buffer will be untouched. - - If [!] is given it will download the package with `go get` - - *:GoImportAs* -:GoImportAs [localname] [path] - - Same as Import, but uses a custom local name for the package. - - *:GoDrop* -:GoDrop [path] - - Remove the import line for the provided package {path}, if present in the - current Go buffer. If {path} is not being imported, an error will be - displayed and the buffer will be untouched. - - *:GoLint* -:GoLint! [packages] - - Run golint for the directory under your current file, or for the given - packages. - - If [!] is not given the first error is jumped to. - - *:GoDoc* -:GoDoc [word] - - Open the relevant GoDoc in split window for either the word[s] passed to - the command or by default, the word under the cursor. - - *:GoDocBrowser* -:GoDocBrowser [word] - - Open the relevant GoDoc in browser for either the word[s] passed to the - command or by default, the word under the cursor. By default it opens the - documentation in 'https://godoc.org'. To change it see |'g:go_doc_url'|. - - *:GoFmt* -:GoFmt - - Filter the current Go buffer through gofmt. It tries to preserve cursor - position and avoids replacing the buffer with stderr output. - - *:GoImports* -:GoImports - - Filter the current Go buffer through goimports (needs to be installed). - `goimports` automatically discards/add import path based on the code. Like - |:GoFmt|, It tries to preserve cursor position and avoids replacing the - buffer with stderr output. - - *:GoPlay* -:[range]GoPlay - - Share snippet to play.golang.org. If no [range] is given it shares - the whole file, otherwise the selected lines are shared. Snippet URL - is copied to system clipboard if Vim is compiled with 'clipboard' or - 'xterm-clipboard' otherwise it's get yanked into the `""` register. - - *:GoVet* -:GoVet[!] [options] - - Run `go vet` for the directory under your current file. Vet examines Go - source code and reports suspicious constructs, such as Printf calls whose - arguments do not align with the format string. Vet uses heuristics that do - not guarantee all reports are genuine problems, but it can find errors not - caught by the compilers. - - You may optionally pass any valid go vet flags/options. - - If [!] is not given the first error is jumped to. - - *:GoDef* -:GoDef -gd -CTRL-] -g - - - Go to declaration/definition for the identifier under the cursor. By - default the CTRL-] shortcut, the mapping `gd` and , - g are enabled to invoke :GoDef for the identifier under the - cursor. See |'g:go_def_mapping_enabled'| to disable them. No explicit - arguments are supported. - - vim-go also keeps a per-window location stack, roughly analogous to how - Vim's internal |tags| functionality works. This is pushed to every time a - jump is made using the GoDef functionality. In essence, this is a LIFO - list of file locations you have visited with :GoDef that is retained to - help you navigate software. - - The per-window location stack is shared with |:GoDefType|. - - *:GoDefType* -:GoDefType - - Go to type definition for the identifier under the cursor. - - The per-window location stack is shared with |:GoDef|. - *:GoDefStack* -:GoDefStack [number] - - This command Jumps to a given location in the jumpstack, retaining all - other entries. Jumps to non-existent entries will print an informative - message, but are otherwise a noop. - - If no argument is given, it will print out an interactive list of all - items in the stack. Its output looks like this: - - 1 /path/first/file.go|1187 col 16|AddThing func(t *Thing) - > 2 /path/thing/thing.go|624 col 19|String() string - 3 /path/thing/thing.go|744 col 6|func Sprintln(a ...interface{}) string - - This list shows the identifiers that you jumped to and the file and cursor - position before that jump. The older jumps are at the top, the newer at - the bottom. - - The '>' points to the active entry. This entry and any newer entries - below it will be replaced if |:GoDef| is done from this location. The - CTRL-t and |:GoDefPop| command will jump to the position above the active - entry. - - Jumps to non-existent entries will print an informative message, but are - otherwise a noop. - - *:GoDefStackClear* -:GoDefStackClear - - Clears the current stack list and resets it. - - *:GoDefPop* -:GoDefPop [count] -CTRL-t - - Navigate to the [count] earlier entry in the jump stack, retaining the - newer entries. If no argument is given, it will jump to the next most - recent entry (`:GoDefPop 1`). If [count] is greater than the number of - prior entries, an error will be printed and no jump will be performed. - - If you have used :GoDefPop to jump to an earlier location, and you issue - another :GoDef command, the current entry will be replaced, and all newer - entries will be removed, effectively resuming the stack at that location. - - By default [count]CTRL-t is enabled to invoke :GoDefPop. Similarly, - hitting CTRL-t without a prior count is equivalent to `:GoDefPop 1`. See - |'g:go_def_mapping_enabled'| to disable this. - - *:GoRun* -:GoRun[!] [expand] - - Build and run your current main package. By default all main files for the - current file is used. If an argument is passed, [expand] is used as file - selector. For example use `:GoRun %` to select the current file only. - - You may optionally pass any valid go run flags/options. For a full list - please see `go help run`. - - If [!] is not given the first error is jumped to. - - If using neovim then `:GoRun` will run in a new terminal according to - |'g:go_term_mode'|. - - *:GoBuild* -:GoBuild[!] [expand] - - Build your package with `go build`. Errors are populated in the quickfix - window. It automatically builds only the files that depends on the current - file. `:GoBuild` doesn't produce a result file. - Use |:make| to create a result file. - - You may optionally pass any valid go build flags/options. For a full list - please see `go help build`. Options are expanded with [expand]. - - If [!] is not given the first error is jumped to. - - If using neovim then this command is fully async, it does not block the - UI. - - *:GoGenerate* -:GoGenerate[!] [expand] - - Creates or updates your auto-generated source files by running `go - generate`. - - You may optionally pass any valid go generate flags/options. For a full - list please see `go help generate`. Options are expanded with [expand]. - - If [!] is not given the first error is jumped to. - - *:GoInfo* -:GoInfo - Show type information about the identifier under the cursor. For example - putting it above a function call is going to show the full function - signature. By default it uses `gopls` to get the type informations. To - change the underlying tool from `gopls` to another tool, see - |'g:go_info_mode'|. - - - *:GoInstall* -:GoInstall[!] [options] - - Install your package with `go install`. - - You may optionally pass any valid go install flags/options. For a full - list please see `go help install`. - - If [!] is not given the first error is jumped to. - - *:GoTest* -:GoTest[!] [expand] - - Run the tests on your _test.go files via in your current directory. Errors - are populated in the quickfix window. If an argument is passed, [expand] - is used as file selector (useful for cases like `:GoTest ./...`). - - You may optionally pass any valid go test flags/options. For a full list - please see `go help test`. - - GoTest times out automatically after 10 seconds. To customize the timeout - use |'g:go_test_timeout'|. This feature is disabled if any arguments are - passed to the `:GoTest` command. - - If [!] is not given the first error is jumped to. - - If using neovim `:GoTest` will run in a new terminal or run asynchronously - in the background according to |'g:go_term_enabled'|. You can set the mode - of the new terminal with |'g:go_term_mode'|. - - *:GoTestFunc* -:GoTestFunc[!] [expand] - - Runs :GoTest, but only on the single test function immediate to your - cursor using 'go test's '-run' flag. - - Lookup is done starting at the cursor (including that line) moving up till - a matching `func Test` pattern is found or top of file is reached. Search - will not wrap around when at the top of the file. - - If [!] is not given the first error is jumped to. - - If using neovim `:GoTestFunc` will run in a new terminal or run - asynchronously in the background according to |'g:go_term_enabled'|. You - can set the mode of the new terminal with |'g:go_term_mode'|. - - *:GoTestCompile* -:GoTestCompile[!] [expand] - - Compile your _test.go files via in your current directory. Errors are - populated in the quickfix window. If an argument is passed, [expand] is - used as file selector (useful for cases like `:GoTest ./...`). Useful to - not run the tests and capture/fix errors before running the tests or to - create test binary. - - If [!] is not given the first error is jumped to. - - If using neovim `:GoTestCompile` will run in a new terminal or run - asynchronously in the background according to |'g:go_term_enabled'|. You - can set the mode of the new terminal with |'g:go_term_mode'|. - - *:GoCoverage* -:GoCoverage[!] [options] - - Create a coverage profile and annotates the current file's source code. If - called again it rerurns the tests. - - If [!] is not given the first error is jumped to. - - *:GoCoverageToggle* -:GoCoverageToggle[!] [options] - - Create a coverage profile and annotates the current file's source code. If - called again clears the annotation (works as a toggle). - - If [!] is not given the first error is jumped to. - - *:GoCoverageClear* -:GoCoverageClear [options] - - Clears the coverage annotation. - - - *:GoCoverageBrowser* -:GoCoverageBrowser[!] [options] - - Create a coverage profile and open a browser to display the annotated - source code of the current package. - - You may optionally pass any valid go test flags/options, such as - `-covermode set,count,atomic`. For a full list please see `go help test`. - - If [!] is not given the first error is jumped to. - - *:GoErrCheck* -:GoErrCheck! [options] - - Check for unchecked errors in you current package. Errors are populated in - the quickfix window. - - You may optionally pass any valid errcheck flags/options. See - `errcheck -h` for a full list. - - If [!] is not given the first error is jumped to. - - *:GoFiles* -:GoFiles [source_files] - - Show source files for the current package. The [source_files] specifies - which file types to list. See the "// Source files" section of - `go list -h` for possible values; multiple values are accepted. - Command-line completion also works for this command. - The default is to use `GoFiles` if no arguments are given. - - *:GoDeps* -:GoDeps - - Show dependencies for the current package. - - *:GoInstallBinaries* -:GoInstallBinaries [binaries] - - Download and install all necessary Go tool binaries such as `godef`, - `goimports`, `gopls`, etc. under |'g:go_bin_path'|. If [binaries] is - supplied, then only the specified binaries will be installed. The default - is to install everything. - - Set |'g:go_get_update'| to disable updating dependencies. - - *:GoUpdateBinaries* -:GoUpdateBinaries [binaries] - - Download and update previously installed Go tool binaries such as `godef`, - `goimports`, `gopls`, etc. under |'g:go_bin_path'|. If [binaries] is - supplied, then only the specified binaries will be updated. The default is - to update everything. - - Set |'g:go_get_update'| to disable updating dependencies. - - *:GoImplements* -:GoImplements - - Show "implements" relation for a selected package. A list of interfaces - for the type that implements an interface under the cursor (or selected - package) is shown in a location list. - *:GoRename* -:GoRename[!] [to] - - Rename the identifier under the cursor to the desired new name. If no - argument is given a prompt will ask for the desired identifier. - - If [!] is not given the first error is jumped to. - - - *:GoGuruScope* -:GoGuruScope [pattern] ... - - Changes the custom |'g:go_guru_scope'| setting and overrides it with the - given package patterns. The custom scope is cleared (unset) if `""` is - given as the only path. If no arguments is given it prints the current - custom scope. Example patterns are: -> - golang.org/x/tools/cmd/guru # a single package - golang.org/x/tools/... # all packages beneath dir - ... # the entire workspace. -< - Example usage, the following sets the scope to a `github.com/fatih/color` - and to all packages under `golang.org/x/tools/`: -> - :GoGuruScope github.com/fatih/color golang.org/x/tools/... -< - The following sets it to the entire workspace: -> - :GoGuruScope ... -< - Under the hood, the patterns are all joined to a comma-separated list and - passed to `guru`'s `-scope` flag. - - Also see |go-guru-scope|. - - *:GoCallees* -:GoCallees - - Show "callees" relation for a selected package. A list of possible call - targets for the type under the cursor (or selected package) is shown in a - location list. - - *:GoCallers* -:GoCallers - - Show "callers" relation for a selected function. A list of possible - callers for the selected function under the cursor is shown in a location - list. - - *:GoDescribe* -:GoDescribe - - Shows various properties of the selected syntax: its syntactic kind, its - type (for an expression), its value (for a constant expression), its size, - alignment, method set and interfaces (for a type), its declaration (for an - identifier), etc. Almost any piece of syntax may be described, and the - guru will try to print all the useful information it can. - - *:GoCallstack* -:GoCallstack - - Shows "callstack" relation for the selected function. An arbitrary path - from the root of the callgraph to the selected function is shown in a - location list. This may be useful to understand how the function is - reached in a given program. - - *:GoFreevars* -:GoFreevars - - Enumerates the free variables of the selection. "Free variables" is a - technical term meaning the set of variables that are referenced but not - defined within the selection, or loosely speaking, its inputs. - - This information is useful when considering whether to refactor the - selection into a function of its own, as the free variables would be the - necessary parameters of that function. It's also useful when you want to - understand what the inputs are to a complex block of code even if you - don’t plan to change it. - - *:GoChannelPeers* -:GoChannelPeers - - Shows the set of possible sends/receives on the channel operand of the - selected send or receive operation; the selection must be a `<-` token. - - For example, visually select a channel operand in the form of: -> - done <- true -< - And call |:GoChannelPeers| on it. It will show where it was allocated, and - the sending and receiving endings. - - *:GoReferrers* -:GoReferrers - - The referrers query shows the set of identifiers that refer to the same - object as does the selected identifier. - - *:GoSameIds* -:GoSameIds - - Highlights all identifiers that are equivalent to the identifier under the - cursor. - - *:GoSameIdsClear* -:GoSameIdsClear - - Clears all SameIds highlights from a |:GoSameIds| call. - - *:GoSameIdsToggle* -:GoSameIdsToggle - - Toggle between |:GoSameIds| and |:GoSameIdsClear|. - - *:GoSameIdsAutoToggle* -:GoSameIdsAutoToggle - - Enables or disables automatic highlighting of |:GoSameIds| while moving - the cursor. This basically toggles the option |'g:go_auto_sameids'| - on/off. - If enabled it starts highlighting whenever your cursor is staying at the - same position for a configurable period of time (see |'g:go_updatetime'|). - If disabled it clears and stops automatic highlighting. - - *:GoMetaLinter* -:GoMetaLinter! [path] - - Calls the underlying `golangci-lint` tool and displays all warnings and - errors in the |quickfix| window. By default the following linters are - enabled: `vet`, `golint`, and `errcheck`. This can be changed with the - |'g:go_metalinter_enabled'| variable. To override the command completely - use the variable |'g:go_metalinter_command'|. To override the maximum - linters execution time use |'g:go_metalinter_deadline'| variable. - - If [!] is not given the first error is jumped to. - - *:GoDiagnostics* -:GoDiagnostics! [packages] - - Displays the diagnostics from `gopls` for the given packages in a - |quickfix| window. The diagnostics for the current package are displayed - when no package is given. The diagnostics for all packages will be - displayed when `all` is as an argument. - - Disabled when |'g:go_diagnostics_enabled'| is not set. - - If [!] is not given the first error is jumped to. - - *:GoBuildTags* -:GoBuildTags [tags] - - Changes the build tags for various commands. If you have any file that - uses a custom build tag, such as `// +build integration` , this command - can be used to pass it to all tools that accepts tags, such as gopls, - guru, gorename, etc. - - The build tags is cleared (unset) if `""` is given. If no arguments are - given it prints the current build tags. - - *:AsmFmt* -:AsmFmt - - Filter the current Go asm buffer through asmfmt. It tries to preserve - cursor position and avoids replacing the buffer with stderr output. - - *:GoAlternate* -:GoAlternate[!] - - Alternates between the implementation and test code. For example if in - main.go, switch to main_test.go. Uses the |'g:go_alternate_mode'| setting - as the command to open the file. - - If [!] is given then it switches to the new file even if it does not - exist. - - If you would like to override the traditional commands for alternating, - add the following to your .vimrc: -> - augroup go - autocmd! - autocmd Filetype go - \ command! -bang A call go#alternate#Switch(0, 'edit') - \| command! -bang AV call go#alternate#Switch(0, 'vsplit') - \| command! -bang AS call go#alternate#Switch(0, 'split') - augroup END -< - - *:GoPointsTo* -:GoPointsTo - - Show all variables to which the pointer under the cursor may point to. - - *:GoWhicherrs* -:GoWhicherrs - - Show the list of possible constants, global variables, and concrete types - for the error type under the cursor in a location list. - - *:GoDecls* -:GoDecls [file] - - Show all function and type declarations for the current file. If - [file] is non empty it parses the given file. - Requires `ctrlp.vim` or `fzf`; it will autodetect the plugin if installed, - but you can use |'g:go_decls_mode'| to force using one or the other. - By default `type` and `func` declarations are shown. This can be changed - via |'g:go_decls_includes'|. Also see |unite-decls|, |denite-decls|. - - *:GoDeclsDir* -:GoDeclsDir [dir] - - Show all function and type declarations for the current directory. If - [dir] is given it parses the given directory. - - *unite-decls* - *denite-decls* -:Unite decls[:path] -:Denite decls[:path] - - Only enabled if `unite.vim` or `denite.nvim` is installed. Show - declarations for all functions and types on the current file or directory - or for [path] if given. - - Note: `denite.nvim` requires NeoVim or Vim 8 with |:python3| enabled. -> - " show declarations on the parent directory of the current file - :Unite decls - :Denite decls - - " show declarations in the file. - :Unite decls:foo/bar.go - :Denite decls:foo/bar.go - - " show declarations in the directory "foo". - :Unite decls:foo - :Denite decls:foo -< - *:GoImpl* -:GoImpl [receiver] [interface] - - Generates method stubs for implementing an interface. If no arguments is - passed it takes the identifier under the cursor to be the receiver and - asks for the interface type to be generated. If used with arguments, the - receiver and the interface needs to be specified. Example usages: -> - :GoImpl f *Foo io.Writer - :GoImpl t Type io.ReadWriteCloser -< - *:GoAddTags* -:[range]GoAddTags [key],[option] [key1],[option] ... - - Adds field tags for the fields of a struct. If called inside a struct it - automatically add field tags with the `json` key and the value - automatically generated based on the field name. An error message is given - if it's called outside a struct definition or if the file is not correctly - formatted. - - If [range] is given, only the selected fields will be changed. - - The default `json` can be changed by providing one or more [key] - arguments. An example of adding `xml` and `db` would be: -> - :GoAddTags xml db -< - If [option] is passed it'll either add a new tag with an option or will - modify existing tags. An example of adding `omitempty` to all `json` - fields would be: -> - :GoAddTags json,omitempty -< - You can define a constant value instead of the default field based value. - For example the following command will add ``valid:"1"`` to all fields. -> - :GoAddTags valid=1 -< - *:GoRemoveTags* -:[range]GoRemoveTags [key],[option] [key1],[option1] ... - - Remove field tags for the fields of a struct. If called inside a struct it - automatically remove all field tags. An error message is given if it's - called outside a struct definition or if the file is not correctly - formatted - - If [range] is given, only the selected fields will be changed. - - If [key] is given, it will only remove those keys. Example: -> - :GoRemoveTags json -< - If [option] is passed with a [key], it will only remove the options. - Example, this will only remove `omitempty` options from fields containing - `json`: -> - :GoRemoveTags json,omitempty -< - *:GoAutoTypeInfoToggle* -:GoAutoTypeInfoToggle - - Toggles |'g:go_auto_type_info'|. - - *:GoFmtAutoSaveToggle* -:GoFmtAutoSaveToggle - - Toggles |'g:go_fmt_autosave'|. - - *:GoModFmtAutoSaveToggle* -:GoModFmtAutoSaveToggle - - Toggles |'g:go_mod_fmt_autosave'|. - - *:GoAsmFmtAutoSaveToggle* -:GoAsmFmtAutoSaveToggle - - Toggles |'g:go_asmfmt_autosave'|. - - *:GoMetaLinterAutoSaveToggle* -:GoMetaLinterAutoSaveToggle - - Toggles |'g:go_metalinter_autosave'|. - - By default, `golangci-lint` messages will be shown in the |location-list| - window. The list to use can be set using |'g:go_list_type_commands'|. - - *:GoTemplateAutoCreateToggle* -:GoTemplateAutoCreateToggle - - Toggles |'g:go_template_autocreate'|. - - *:GoKeyify* -:GoKeyify - - Uses `keyify` to turn unkeyed struct literals into keyed ones. - - For example: -> - Person{"John", "Smith"} -< - Becomes: -> - Person{ - Name: "John", - Surname: "Smith", - } -< - *:GoFillStruct* -:GoFillStruct - - Use `fillstruct` to fill a struct literal with default values. Existing - values (if any) are preserved. The cursor must be on the struct you wish - to fill. - - For example: -> - addr := net.Address{Name: "Ford Prefect"} -< - Becomes: -> - addr := net.Address{ - Name: "Ford Prefect", - Email: "", - } -< - - *:GoIfErr* -:GoIfErr - - Generate if err != nil { return ... } automatically which infer the type - of return values and the numbers. - - For example: -> - func doSomething() (string, error) { - f, err := os.Open("file") - } -< - Becomes: -> - func doSomething() (string, error) { - f, err := os.Open("file") - if err != nil { - return "", err - } - } -< - *:GoModFmt* -:GoModFmt - - Filter the current go.mod buffer through "go mod edit -fmt" command. It - tries to preserve cursor position and avoids replacing the buffer with - stderr output. - - *:GoAddWorkspace* -:GoAddWorkspace [dir] ... - - Add directories to the `gopls` workspace. - - *:GoLSPDebugBrowser* -:GoLSPDebugBrowser - - Open a browser to see gopls debugging information. - -============================================================================== -MAPPINGS *go-mappings* - -vim-go has several keys which can be used to create custom mappings -For example, to create a mapping that calls `go run` for the current package, -create a mapping for the `(go-run)`: > - - au FileType go nmap r (go-run) - -As always one is free to create more advanced mappings or functions based with -|go-commands|. For more information please check out the mappings command -documentation in the |go-commands| section. Available keys are: - - *(go-run)* - -Calls `go run` for the current main package - - *(go-run-tab)* - -Calls `go run` for the current file in a new terminal tab -This option is neovim only. - - *(go-run-split)* - -Calls `go run` for the current file in a new terminal horizontal split -This option is neovim only. - - *(go-run-vertical)* - -Calls `go run` for the current file in a new terminal vertical split -This option is neovim only. - - *(go-build)* - -Calls `go build` for the current package - - *(go-generate)* - -Calls `go generate` for the current package - - *(go-info)* - -Shows type information for the word under the cursor - - *(go-install)* - -Calls `go install` for the current package - - *(go-test)* - -Calls `go test` for the current package - - *(go-test-func)* - -Calls `go test -run '...'` for the test function immediate to cursor - - *(go-test-compile)* - -Calls `go test -c` for the current package - - *(go-coverage)* - -Calls `go test -coverprofile-temp.out` for the current package and shows the -coverage annotation. - - *(go-coverage-clear)* - -Clears the coverage annotation - - *(go-coverage-toggle)* - -Calls `go test -coverprofile-temp.out` for the current package and shows the -coverage annotation. If run again it acts as a toggle and clears the -annotation. - - *(go-imports)* - -Calls `goimports` for the current package - - *(go-lint)* - -Calls `golint` for the current package - - *(go-vet)* - -Calls `go vet` for the current package - - - *(go-files)* - -Show source files that depends for the current package - - - *(go-deps)* - -Show dependencies for the current package - - *(go-doc)* - -Show the relevant GoDoc for the word under the cursor in a split window -leftabove (default mode). - - *(go-doc-split)* - -Show the relevant GoDoc for the word under the cursor in a split window. - - - *(go-doc-vertical)* - -Show the relevant GoDoc for the word under the cursor in a vertical split -window. - - *(go-doc-tab)* - -Show the relevant GoDoc for the word under the cursor in a tab window. - - - *(go-doc-browser)* - -Show the relevant GoDoc for the word under in browser - - *(go-def)* - -Goto declaration/definition. Results are shown in the current window. - - *(go-def-split)* - -Goto declaration/definition. Results are shown in a split window. -Jumps to an existing buffer if |'g:go_def_reuse_buffer'| is enabled. - - *(go-def-vertical)* - -Goto declaration/definition. Results are shown in a vertical split window. -Jumps to an existing buffer if |'g:go_def_reuse_buffer'| is enabled. - - *(go-def-tab)* - -Goto declaration/definition. Results are shown in a tab window. -Jumps to an existing buffer if |'g:go_def_reuse_buffer'| is enabled. - - *(go-def-type)* - -Goto type declaration/definition. Results are shown in the current window. -Jumps to an existing buffer if |'g:go_def_reuse_buffer'| is enabled. - - *(go-def-type-vertical)* -Goto type declaration/definition. Results are shown in a vertical split -window. -Jumps to an existing buffer if |'g:go_def_reuse_buffer'| is enabled. - - *(go-def-type-split)* -Goto type declaration/definition. Results are shown in a split window. -Jumps to an existing buffer if |'g:go_def_reuse_buffer'| is enabled. - - *(go-def-type-tab)* -Goto type declaration/definition. Results are shown in a tab window. -Jumps to an existing buffer if |'g:go_def_reuse_buffer'| is enabled. - - *(go-def-stack)* - -Shows the godef tag stack - - *(go-def-stack-clear)* - -Resets and clears the tag stack - - *(go-def-pop)* - -Jump to previous entry in the tag stack - - *(go-implements)* - -Show the interfaces that the type under the cursor implements. - - *(go-rename)* - -Rename the identifier under the cursor to the desired new name - - *(go-callees)* - -Show the call targets for the type under the cursor - - *(go-callers)* - -Show possible callers of selected function - - *(go-describe)* - -Describe selected syntax: definition, methods, etc - - *(go-callstack)* - -Show path from callgraph root to selected function - - *(go-freevars)* - -Show free variables of selection - - *(go-channelpeers)* - -Show send/receive corresponding to selected channel op - - *(go-referrers)* - -Show all refs to entity denoted by selected identifier - - *(go-pointsto)* - -Show all variables to which the pointer under the cursor may point to. - - *(go-metalinter)* - -Calls `go-metalinter` for the current directory - - *(go-alternate-edit)* - -Alternates between the implementation and test code in the current window - - *(go-alternate-split)* - -Alternates between the implementation and test code in a new horizontal split - - *(go-alternate-vertical)* - -Alternates between the implementation and test code in a new vertical split - - *(go-import)* - -Calls `:GoImport` for the current package - - *(go-iferr)* - -Generate if err != nil { return ... } automatically which infer the type of -return values and the numbers. - - *(go-mod-fmt)* - -Calls |:GoModFmt| for the current buffer - - *(go-diagnostics)* -Calls `:GoDiagnostics` - -============================================================================== -TEXT OBJECTS *go-text-objects* - -vim-go comes with several custom |text-objects| that can be used to operate -upon regions of text. vim-go currently defines the following text objects: - - *go-v_af* *go-af* -af "a function", select contents from a function definition to the - closing bracket. If |'g:go_textobj_include_function_doc'| is - enabled it also includes the comment doc for a function - declaration. This text-object also supports literal functions. - If |'g:go_textobj_include_variable'| is enabled it also - includes the variable of an function assignment - - *go-v_if* *go-if* -if "inside a function", select contents of a function, - excluding the function definition and the closing bracket. This - text-object also supports literal functions - - *go-v_ac* *go-ac* -ac "a comment", select contents of the current comment block. - - *go-v_ic* *go-ic* -ic "inner comment", select contents of the current comment block, - excluding the start and end comment markers. - -vim-go also defines the following text motion objects: - - *go-v_]]* *go-]]* -]] [count] forward to next function declaration. If - |'g:go_textobj_include_function_doc'| is enabled and if your - on a comment, it skips the function which the comment - belongs and forwards to the next function declaration. - - *go-v_[[* *go-[[* -[[ [count] backward to previous function declaration. - - - -============================================================================== -FUNCTIONS *go-functions* - - *go#statusline#Show()* - -Shows the status of a job running asynchronously. Can be used to plug into the -statusline. It works to show the status per package instead of per file. -Assume you have three files open, all belonging to the same package, if the -package build (`:GoBuild`) is successful, all statuslines will show `success`, -if it fails all windows' statuslines will show `failed`. - -To avoid always showing old status information, the status information is -cleaned for each package after `60` seconds. This can be changed with the -|'g:go_statusline_duration'| setting. - - *go#complete#GetInfo()* - -Returns the description of the identifer under the cursor. Can be used to plug -into the statusline. - - *go#complete#Complete()* - -Uses `gopls` for autocompletion. By default, it is hooked up to 'omnifunc'. - - *go#tool#DescribeBalloon()* - -Suitable to be used as an expression to show the evaluation balloon. See `help -balloonexpr`. - -============================================================================== -SETTINGS *go-settings* - - *'g:go_version_warning'* - -Enable warning when using an unsupported version of Vim. By default it is -enabled. -> - let g:go_version_warning = 1 -< - - *'g:go_code_completion_enabled'* - -Enable code completion with 'omnifunc'. By default it is enabled. -> - let g:go_code_completion_enabled = 1 -< - - *'g:go_test_show_name'* - -Show the name of each failed test before the errors and logs output by the -test. By default it is disabled. -> - let g:go_test_show_name = 0 -< - - *'g:go_test_timeout'* - -Use this option to change the test timeout of |:GoTest|. By default it is -set to 10 seconds . > - - let g:go_test_timeout= '10s' -< - *'g:go_play_browser_command'* - -Browser to use for |:GoPlay|, |:GoDocBrowser|, and |:GoLSPDebugBrowser|. The -url must be added with `%URL%`, and it's advisable to include `&` to make sure -the shell returns. For example: -> - let g:go_play_browser_command = 'firefox-developer %URL% &' -< - -By default it tries to find it automatically for the current OS. > - - let g:go_play_browser_command = '' -< - *'g:go_play_open_browser'* - -Use this option to open browser after posting the snippet to play.golang.org -with |:GoPlay|. By default it's enabled. > - - let g:go_play_open_browser = 1 -< - *'g:go_auto_type_info'* - -Use this option to show the type info (|:GoInfo|) for the word under the -cursor automatically. Whenever the cursor changes the type info will be -updated. By default it's disabled. The delay can be configured with the -|'g:go_updatetime'| setting. -> - let g:go_auto_type_info = 0 -< - - *'g:go_info_mode'* - -Use this option to define the command to be used for |:GoInfo|. By default -`gopls` is used, because it is the fastest and is known to be highly accurate. -One might also use `guru` for its accuracy. -Valid options are `gopls` and `guru`. -> - let g:go_info_mode = 'gopls' -< - *'g:go_auto_sameids'* - -Use this option to highlight all uses of the identifier under the cursor -(|:GoSameIds|) automatically. By default it's disabled. The delay can be -configured with the |'g:go_updatetime'| setting. -> - let g:go_auto_sameids = 0 -< - *'g:go_updatetime'* - -Use this option to configure the delay until it starts some jobs (see -|'g:go_auto_type_info'|, |'g:go_auto_sameids'|). If set to 0, it uses the -value from 'updatetime'. By default it's set to 800ms. -> - let g:go_updatetime = 800 -< - *'g:go_jump_to_error'* - -Use this option to enable/disable passing the bang attribute to the mappings -(e.g. |(go-build)|, |(go-run)|, etc.) and the metalinter on save. When -enabled it will jump to the first error automatically (means it will NOT pass -the bang attribute to the appropriate command, i.e: (go-run) -> :GoRun ). -Note, that calling this doesn't have any affect on calling the commands -manually. This setting is only useful for changing the behaviour of our custom -static mappings. By default it's enabled. -> - let g:go_jump_to_error = 1 -< - *'g:go_fmt_autosave'* - -Use this option to auto |:GoFmt| on save. When both 'g:go_imports_autosave' -and 'g:go_fmt_autosave' are enabled and both 'g:go_fmt_command' and -'g:go_imports_command' are set to `goimports`, `goimports` will be run only -once. By default it's enabled > - - let g:go_fmt_autosave = 1 -< - *'g:go_fmt_command'* - -Use this option to define which tool is used to format code. Valid options are -`gofmt`, `goimports`, and `gopls`. By default `gofmt` is used. -> - - let g:go_fmt_command = "gofmt" -< - *'g:go_fmt_options'* - -Use this option to add additional options to the |'g:go_fmt_command'|. It's -value type can be either a string or a dictionary. This is due backwards -compatibility. The string version will be removed in the future so please use -the dictionary version. Default is empty. -> - let g:go_fmt_options = '' - - or - - let g:go_fmt_options = {} -< -The dictionary version allows you to define options for multiple binaries: -> - let g:go_fmt_options = { - \ 'gofmt': '-s', - \ 'goimports': '-local mycompany.com', - \ } -< - *'b:go_fmt_options'* - -This option is identical to |'g:go_fmt_options'|, but a buffer-level setting. -If present, it's used instead of the global setting. By default it is not set. - -As an example, the following autocmd will configure goimports to put imports -of packages from the current module in their own group: -> - autocmd FileType go let b:go_fmt_options = { - \ 'goimports': '-local ' . - \ trim(system('{cd '. shellescape(expand('%:h')) .' && go list -m;}')), - \ } -< - *'g:go_fmt_fail_silently'* - -Use this option to disable showing a location list when |'g:go_fmt_command'| -fails. By default the location list is shown. > - - let g:go_fmt_fail_silently = 0 -< - *'g:go_fmt_experimental'* - -Use this option to enable fmt's experimental mode. This experimental mode is -superior to the current mode as it fully saves the undo history, so undo/redo -doesn't break. However, it's slow (creates/deletes a file for every save) and -it's causing problems on some Vim versions. This has no effect if -`g:go_fmt_command` is set to `gopls`. By default it's disabled. -> - - let g:go_fmt_experimental = 0 - -< - - *'g:go_imports_autosave'* - -Use this option to auto |:GoImports| on save. When both -'g:go_imports_autosave' and 'g:go_fmt_autosave' are enabled and both -'g:go_fmt_command' and 'g:go_imports_command' are set to `goimports`, -`goimports` will be run only once. By default it's disabled. -> - let g:go_imports_autosave = 0 -< - *'g:go_imports_mode'* - -Use this option to define which tool is used to adjust imports. Valid options -are `goimports` and `gopls`. The buffer will not be formatted when this is set -to `gopls`. By default `goimports` is used. -> - - let g:go_imports_mode = "goimports" -< - *'g:go_mod_fmt_autosave'* - -Use this option to auto |:GoModFmt| on save. By default it's enabled > - - let g:go_mod_fmt_autosave = 1 -< - - *'g:go_doc_keywordprg_enabled'* - -Use this option to run `godoc` on words under the cursor with |K|; this will -normally run the `man` program, but for Go using `godoc` is more idiomatic. It -will not override the 'keywordprg' setting, but will run |:GoDoc|. Default -is enabled. > - - let g:go_doc_keywordprg_enabled = 1 -< - *'g:go_doc_height'* - -Maximum height for the GoDoc window created with |:GoDoc|. Default is 20. > - - let g:go_doc_max_height = 20 -< - - *'g:go_doc_url'* - -godoc server URL used when |:GoDocBrowser| is used. Change if you want to use -a private internal service. Default is 'https://godoc.org'. -> - let g:go_doc_url = 'https://godoc.org' -< - - *'g:go_doc_popup_window'* - -Use this option to use the popup-window for |K| and |:GoDoc|, rather than the -|preview-window|. Default is disabled. -> - let g:go_doc_popup_window = 0 -< - - *'g:go_def_mode'* - -Use this option to define the command to be used for |:GoDef|. By default -`gopls` is used, because it is the fastest. One might also use `guru` for its -accuracy or `godef` for its performance. Valid options are `godef`, `gopls`, -and `guru`. -> - let g:go_def_mode = 'gopls' -< - *'g:go_referrers_mode'* - -Use this option to define the command to be used for |:GoReferrers|. By -default `gopls` is used, because it is the fastest and works with Go modules. -One might also use `guru` for its ability to show references from other -packages. This option will be removed after `gopls` can show references from -other packages. Valid options are `gopls` and `guru`. By default it's `gopls`. -> - let g:go_referrers_mode = 'gopls' -< - *'g:go_implements_mode'* - -Use this option to define the command to be used for |:GoImplements|. -The Implements feature in gopls is still new and being worked upon. -Valid options are `gopls` and `guru`. By default it's `guru`. -> - let g:go_implements_mode = 'guru' -< - *'g:go_def_mapping_enabled'* - -Use this option to enable/disable the default mapping of CTRL-], -, g and (`gd`) for GoDef and CTRL-t for :GoDefPop. -Disabling it allows you to map something else to these keys or mappings. -Default is enabled. > - - let g:go_def_mapping_enabled = 1 -< - *'g:go_def_reuse_buffer'* - -Use this option to jump to an existing buffer for the split, vsplit and tab -mappings of |:GoDef|. By default it's disabled. > - - let g:go_def_reuse_buffer = 0 -< - *'g:go_bin_path'* - -Use this option to change default path for vim-go tools when using -|:GoInstallBinaries| and |:GoUpdateBinaries|. If not set `$GOBIN` or -`$GOPATH/bin` is used. > - - let g:go_bin_path = "" -< - *'g:go_search_bin_path_first'* - -This option lets |'g:go_bin_path'| (or its default value) take precedence over -$PATH when invoking a tool command such as |:GoFmt| or |:GoImports|. - -Enabling this option ensures that the binaries installed via -|:GoInstallBinaries| and |:GoUpdateBinaries| are the same ones that are -invoked via the tool commands. - -By default it is enabled. > - - let g:go_search_bin_path_first = 1 -< - *'g:go_snippet_engine'* - -Define the snippet engine to use. The default is to auto-detect one. Valid -values are: - - automatic Automatically detect a snippet engine. - ultisnips https://github.com/SirVer/ultisnips - neosnippet https://github.com/Shougo/neosnippet.vim - minisnip https://github.com/joereynolds/vim-minisnip - Note: the original at KeyboardFire/vim-minisnip won't work. -> - let g:go_snippet_engine = "automatic" -< - *'g:go_get_update'* - -Use this option to disable updating dependencies with |:GoInstallBinaries|. By -default this is enabled. -> - let g:go_get_update = 1 -< - *'g:go_guru_scope'* - -Use this option to define the scope of the analysis to be passed for guru -related commands, such as |:GoImplements|, |:GoCallers|, etc. You can change -it on-the-fly with |:GoGuruScope|. The input should be a a list of package -pattern. An example input might be: -`["github.com/fatih/color","github.com/fatih/structs"]` - -Also see |go-guru-scope|. - -By default it's not set, so the relevant commands' defaults are being used. -> - let g:go_guru_scope = [] -< - *'g:go_build_tags'* - -Space-separated list of build tags passed to the `-tags` flag of tools that -support it. -There is also the |:GoBuildTags| convenience command to change or remove build -tags. -> - let g:go_build_tags = '' -< - *'g:go_autodetect_gopath'* - -Automatically modify GOPATH for certain directory structures, such as for -the `godep` tool which stores dependencies in the `Godeps` folder. What this -means is that all tools are now working with the newly modified GOPATH. So -|:GoDef| for example jumps to the source inside the `Godeps` (vendored) -source. Currently `godep` and `gb` are supported. By default it's disabled. -> - let g:go_autodetect_gopath = 0 -< - *'g:go_textobj_enabled'* - -Adds custom text objects. By default it's enabled. > - - let g:go_textobj_enabled = 1 -< - *'g:go_textobj_include_function_doc'* - -Consider the comment above a function to be part of the function when using -the `af` text object and `[[` motion. By default it's enabled. > - - let g:go_textobj_include_function_doc = 1 -< - *'g:go_textobj_include_variable'* - -Consider the variable of an function assignment to be part of the anonymous -function when using the `af` text object. By default it's enabled. > - - let g:go_textobj_include_variable = 1 -< - *'g:go_metalinter_autosave'* - -Use this option to auto |:GoMetaLinter| on save. Only linter messages for -the active buffer will be shown. - -By default, `golangci-lint` messages will be shown in the |location-list| -window. The list to use can be set using |'g:go_list_type_commands'|. - - By default it's disabled > - let g:go_metalinter_autosave = 0 -< - *'g:go_metalinter_autosave_enabled'* - -Specifies the enabled linters for auto |:GoMetaLinter| on save. By -default it's using `vet` and `golint`. If any are enabled, `--disable-all` -will be sent to the metalinter. -> - let g:go_metalinter_autosave_enabled = ['vet', 'golint'] -< - *'g:go_metalinter_enabled'* - -Specifies the linters to enable for the |:GoMetaLinter| command. By default -it's using `vet`, `golint` and `errcheck`. If any are enabled, `--disable-all` -will be sent to the metalinter. -> - let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck'] -< - *'g:go_metalinter_command'* - -Overrides the command to be executed when |:GoMetaLinter| is called. By -default it's `golangci-lint`. Valid options are `golangci-lint` and `gopls`. -When the value is `gopls`, users may want to consider setting -`g:go_gopls_staticcheck`. It can also be used as an advanced setting for -users who want to have more control over the metalinter. -> - let g:go_metalinter_command = "golangci-lint" -< - *'g:go_metalinter_deadline'* - -Overrides the maximum time the linters have to complete. By default it's 5 -seconds. -> - let g:go_metalinter_deadline = "5s" -< - *'g:go_list_height'* - -Specifies the window height for the quickfix and location list windows. The -default value (empty) automatically sets the height to the number of items -(maximum up to 10 items to prevent large heights). Setting the value -explicitly overrides this behavior. For standard Vim behavior, set it to 10. -> - let g:go_list_height = 0 -< - *'g:go_list_type'* - -Specifies the type of list to use for command outputs (such as errors from -builds, results from static analysis commands, etc...). The list type for -specific commands can be overridden with |'g:go_list_type_commands'|. The -default value (empty) will use the appropriate kind of list for the command -that was called. Supported values are "", "quickfix", and "locationlist". -> - let g:go_list_type = "" -< - - *'g:go_list_type_commands'* - -Specifies the type of list to use for command outputs (such as errors from -builds, results from static analysis commands, etc...). When an expected key -is not present in the dictionary, |'g:go_list_type'| will be used instead. -Supported keys are "GoBuild", "GoErrCheck", "GoFmt", "GoModFmt", "GoInstall", -"GoLint", "GoMetaLinter", "GoMetaLinterAutoSave", "GoModifyTags" (used for -both :GoAddTags and :GoRemoveTags), "GoRename", "GoRun", and "GoTest". -Supported values for each command are "quickfix" and "locationlist". -> - let g:go_list_type_commands = {} -< -As an example, the following settings will change all list types to -`locationlist` except for `:GoBuild` where `quickfix` is used: -> - let g:go_list_type = "locationlist" - let g:go_list_type_commands = {"GoBuild": "quickfix"} -< - - *'g:go_list_autoclose'* - -Specifies whether the quickfix/location list should be closed automatically -in the absence of errors. The default value is 1. -If you prefer to keep a long running error window open, you can disable -this by setting the value to 0. -> - let g:go_list_autoclose = 1 -< - *'g:go_asmfmt_autosave'* - -Use this option to auto |:AsmFmt| on save. By default it's disabled. > - - let g:go_asmfmt_autosave = 0 -< - *'g:go_term_mode'* - -The default command used to open a new terminal for go commands such as -|:GoRun|. The default is `:vsplit`. - -Applicable to Neovim and Vim with `terminal` feature only. -> - let g:go_term_mode = "vsplit" -< - *'g:go_term_height'* - *'g:go_term_width'* - -Controls the height and width of a terminal split, respectively. By default -these are not set, meaning that the height and width are set automatically by -the editor. The height only applies to a horizontal split and width only -applies to a vertical split. - -Applicable to Neovim and Vim with `terminal` feature only. - -For example here is how to set each to 30. -> - let g:go_term_height = 30 - let g:go_term_width = 30 -< - *'g:go_term_enabled'* - -Causes some types of jobs to run inside a new terminal according to -|'g:go_term_mode'|. By default it is disabled. - -Applicable to Neovim and Vim with `terminal` feature only. -> - let g:go_term_enabled = 0 -< - *'g:go_term_close_on_exit'* - -Closes the terminal after the command run in it exits when the command fails. -By default it is enabled. - -Applicable to Neovim and Vim with `terminal` feature only. - -> - let g:go_term_close_on_exit = 1 -< - *'g:go_alternate_mode'* - -Specifies the command that |:GoAlternate| uses to open the alternate file. By -default it is set to edit. -> - let g:go_alternate_mode = "edit" -< - *'g:go_rename_command'* - -Use this option to define which tool is used to rename. By default `gorename` -is used. Valid options are `gorename` and `gopls`. -> - let g:go_rename_command = 'gorename' -< - *'g:go_gorename_prefill'* - -Expression to prefill the new identifier when using |:GoRename| without any -arguments. Use an empty string if you don't want to prefill anything. By -default it converts the identifier to camel case but preserves the -capitalisation of the first letter to ensure that the exported state stays the -same. -> - let g:go_gorename_prefill = 'expand("") =~# "^[A-Z]"' . - \ '? go#util#pascalcase(expand(""))' . - \ ': go#util#camelcase(expand(""))' -< - - *'g:go_gopls_enabled'* - -Specifies whether `gopls` can be used by vim-go. By default gopls is enabled. -When gopls is disabled completion will not work and other configuration -options may also need to be adjusted. - -> - let g:go_gopls_enabled = 1 -< - - *'g:go_gopls_options'* - -The commandline arguments to pass to gopls. By default, it's an empty array. -> - let g:go_gopls_options = [] -< - - *'g:go_gopls_analyses'* - -The analyses settings for `gopls`. By default, it's `v:null`. Valid map values -are `v:true` and `v:false`. -> - let g:go_gopls_analyses = v:null -< - - *'g:go_gopls_complete_unimported'* - -Specifies whether `gopls` should include suggestions from unimported packages. -When it is `v:null`, `gopls`' default will be used. By default it is -`v:null`. -> - let g:go_gopls_complete_unimported = v:null -< - - *'g:go_gopls_deep_completion'* - -Specifies whether `gopls` should use deep completion. When it is `v:null`, -`gopls`' default will be used. By default it is `v:null`. - -> - let g:go_gopls_deep_completion = v:null -< - - *'g:go_gopls_matcher'* - -Specifies how `gopls` should match for completions. Valid values are `v:null`, -`fuzzy`, and `caseSensitive`. When it is `v:null`, `gopls`' default will be -used. By default it is `v:null`. -> - let g:go_gopls_matcher = v:null -< - - *'g:go_gopls_staticcheck'* - -Specifies whether `gopls` should run staticcheck checks. When it is `v:null`, -`gopls`' default will be used. By default it is `v:null`. -> - let g:go_gopls_staticcheck = v:null -< - - *'g:go_gopls_use_placeholders'* - -Specifies whether `gopls` can provide placeholders for function parameters and -struct fields. When set, completion items will be treated as anonymous -snippets if UltiSnips is installed and configured to be used as -|'g:go_snippet_engine'|. When it is `v:null`, `gopls`' default will be used. -By default it is `v:null`. -> - let g:go_gopls_use_placeholders = v:null -< - - *'g:go_gopls_temp_modfile'* - -Specifies whether `gopls` should use a temp modfile and suggest edits rather -than modifying the ambient go.mod file. When it is `v:null`, `gopls`' default -will be used. By default it is `v:null`. -> - let g:go_gopls_temp_modfile = v:null -< - - *'g:go_gopls_local'* - -Specifies the prefix for imports that `gopls` should consider group -separately. When it is `v:null`, `gopls`' default will be used. By default it -is `v:null`. -> - let g:go_gopls_local = v:null -< - - *'g:go_diagnostics_enabled'* - -Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for -the current buffer will be processed when it is not set; all others will be -ignored. By default it is disabled. -> - let g:go_diagnostics_enabled = 0 -< - - *'g:go_template_autocreate'* - -When a new Go file is created, vim-go automatically fills the buffer content -with a Go code template. By default, the templates under the `templates` -folder are used. This can be changed with the |'g:go_template_file'| and -|'g:go_template_test_file'| settings to either use a different file in the -same `templates` folder, or to use a file stored elsewhere. - -If the new file is created in an already prepopulated package (with other Go -files), in this case a Go code template with only the Go package declaration -(which is automatically determined according to the current package) is added. - -To always use the package name instead of the template, enable the -|'g:go_template_use_pkg'| setting. - -By default it is enabled. -> - let g:go_template_autocreate = 1 -< - *'g:go_template_file'* - -Specifies either the file under the `templates` folder that is used if a new -Go file is created. Checkout |'g:go_template_autocreate'| for more info. By -default the `hello_world.go` file is used. - -This variable can be set to an absolute path, so the template files don't have -to be stored inside the vim-go directory structure. Useful when you want to -use different templates for different projects. -> - let g:go_template_file = "hello_world.go" -< - *'g:go_template_test_file'* - -Like with |'g:go_template_file'|, this specifies the file to use for test -tempaltes. The template file should be under the `templates` folder, -alternatively absolute paths can be used, too. Checkout -|'g:go_template_autocreate'| for more info. By default, the -`hello_world_test.go` file is used. -> - let g:go_template_test_file = "hello_world_test.go" -< - *'g:go_template_use_pkg'* - -Specifies that, rather than using a template, the package name is used if a -new Go file is created. Checkout |'g:go_template_autocreate'| for more info. -By default the template file specified by |'g:go_template_file'| is used. - -> - let g:go_template_use_pkg = 0 -< - *'g:go_decls_includes'* - -Only useful if `ctrlp.vim`, `unite.vim`, `denite.nvim` or `fzf` are installed. -This sets which declarations to show for |:GoDecls| (`ctrp.vim`), -|unite-decls| (`unite.vim`) and |denite-decls| (`denite.nvim`). It is a Comma -delimited list. Possible options are: {func,type}. The default is: > - - let g:go_decls_includes = 'func,type' -< - *'g:go_decls_mode'* - -Define the tool to be used for |:GoDecls|. Valid options are `ctrlp.vim`, -`fzf`, or an empty string; in which case it will try to autodetect either -`ctrlp.vim` or `fzf`. -> - let g:go_decls_mode = '' -< - *'g:go_echo_command_info'* - -Echoes information about various Go commands, such as `:GoBuild`, `:GoTest`, -`:GoCoverage`, etc... Useful to disable if you use the statusline integration, -i.e: |go#statusline#Show()|. By default it's enabled -> - let g:go_echo_command_info = 1 -< - *'g:go_echo_go_info'* - -Use this option to show the identifier information when code completion is -done. By default it's enabled. > - - let g:go_echo_go_info = 1 -< -Please note that 'noshowmode' must be set for this feature to work correctly. - - *'g:go_statusline_duration'* - -Specifies the duration of statusline information being showed per package. By -default it's 60 seconds. Must be in milliseconds. -> - let g:go_statusline_duration = 60000 -< - *'g:go_addtags_transform'* - -Sets the `transform` option for `gomodifytags` when using |:GoAddTags| or if -it's being used for snippet expansion of single fields. Possible options are: -`snakecase`, `camelcase`, `lispcase`, `pascalcase`, `keep`. For the following -case, if `snakecase` is used the field will be transformed to: -> - type T struct { - FooBarQuz string `json:"foo_bar_quz"` - } -< - -If "camelcase" is used: -> - type T struct { - FooBarQuz string `json:"fooBarQuz"` - } -< -By default "snakecase" is used. Current values are: ["snakecase", -"camelcase", "lispcase", "pascalcase", "keep"]. -> - let g:go_addtags_transform = 'snakecase' -< - *'g:go_addtags_skip_unexported'* - -Sets the `skip-unexported` option for `gomodifytags` when using |:GoAddTags|. -If set it will prevent `gomodifytags` from adding tags to unexported fields: -> - type T struct { - FooBar string `json:"foo_bar"` - quz string - } -< -By default it is disabled. -> - let g:go_addtags_skip_unexported = 0 -< - *'g:go_debug'* - -A list of options to debug; useful for development and/or reporting bugs. - -Currently accepted values: - - shell-commands Echo all shell commands that vim-go runs. - debugger-state Expose debugger state in 'g:go_debug_diag'. - debugger-commands Echo communication between vim-go and `dlv`; requests and - responses are recorded in `g:go_debug_commands`. - lsp Echo communication between vim-go and `gopls`. All - communication is shown in a dedicated window. When - enabled before gopls is started, |:GoLSPDebugBrowser| can - be used to open a browser window to help debug gopls. -> - let g:go_debug = [] -< - -============================================================================== -SYNTAX HIGHLIGHTING *ft-go-syntax* *go-syntax* - -vim-go comes with an enhanced version of Vim's Go syntax highlighting. It -comes with a number of features, most of which are disabled by default. - -The recommended settings are the default values. If you're experiencing -slowdowns in Go files and you enabled some of these options then try disabling -them; some can be resource intensive. - - *'g:go_fold_enable'* - -Control syntax-based folding which takes effect when 'foldmethod' is set to -`syntax`. -You can enable specific fold regions by setting an array. Possible values are: - - block `{` .. `}` blocks. - import `import` block. - varconst `var` and `const` blocks. - package_comment The package comment. - comment Any comment that is not the package comment. - -By default all except "comment" are enabled: -> - let g:go_fold_enable = ['block', 'import', 'varconst', 'package_comment'] -< -Enable folding of only imports: -> - let g:go_fold_enable = ['import'] -< -Disable everything (same as not setting 'foldmethod' to `syntax`): -> - let g:go_fold_enable = [] -< - *'g:go_highlight_array_whitespace_error'* - -Highlight white space after `[]`. > - - let g:go_highlight_array_whitespace_error = 0 -< - *'g:go_highlight_chan_whitespace_error'* - -Highlight white space around the receive operator (`<-`) that doesn't follow -the standard style. > - - let g:go_highlight_chan_whitespace_error = 0 -< - *'g:go_highlight_extra_types'* - -Highlight commonly used library types (`io.Reader`, etc.). > - - let g:go_highlight_extra_types = 0 -< - *'g:go_highlight_space_tab_error'* - -Highlight instances of tabs following spaces. > - - let g:go_highlight_space_tab_error = 0 -< - *'g:go_highlight_trailing_whitespace_error'* - -Highlight trailing white space. > - - let g:go_highlight_trailing_whitespace_error = 0 -< - *'g:go_highlight_operators'* - -Highlight operators such as `:=` , `==`, `-=`, etc. -> - let g:go_highlight_operators = 0 -< - *'g:go_highlight_functions'* - -Highlight function and method declarations. -> - let g:go_highlight_functions = 0 -< - *'g:go_highlight_function_parameters'* - -Highlight the variable names in parameters (including named return parameters) -in function declarations. Setting this implies the functionality from -|'g:go_highlight_functions'|. -> - let g:go_highlight_function_parameters = 0 -< - *'g:go_highlight_function_calls'* - -Highlight function and method calls. -> - let g:go_highlight_function_calls = 0 -< - *'g:go_highlight_types'* - -Highlight struct and interface names. -> - let g:go_highlight_types = 0 -< - *'g:go_highlight_fields'* - -Highlight struct field names. -> - let g:go_highlight_fields = 0 -< - *'g:go_highlight_build_constraints'* - -Highlights build constraints. -> - let g:go_highlight_build_constraints = 0 -< - *'g:go_highlight_generate_tags'* - -Highlight go:generate directives. -> - let g:go_highlight_generate_tags = 0 -< - *'g:go_highlight_string_spellcheck'* - -Highlight spelling errors in strings when |spell| is enabled. -> - let g:go_highlight_string_spellcheck = 1 -< - *'g:go_highlight_format_strings'* - -Highlight printf-style formatting verbs inside string literals. -> - let g:go_highlight_format_strings = 1 -< - *'g:go_highlight_variable_declarations'* - -Highlight variable names in variable declarations (`x` in ` x :=`). -> - let g:go_highlight_variable_declarations = 0 -< - *'g:go_highlight_variable_assignments'* - -Highlight variable names in variable assignments (`x` in `x =`). -> - let g:go_highlight_variable_assignments = 0 -< - *'g:go_highlight_diagnostic_errors'* - -Highlight diagnostic errors. -> - let g:go_highlight_diagnostic_errors = 1 -< - *'g:go_highlight_diagnostic_warnings'* - -Highlight diagnostic warnings. -> - let g:go_highlight_diagnostic_warnings = 1 -< - -============================================================================== - *gohtmltmpl* *ft-gohtmltmpl-syntax* - *gotexttmpl* *ft-gotexttmpl-syntax* -Go template syntax~ - -The `gotexttmpl` 'filetype' provides syntax highlighting and indentation for -Go's `text/template` package. - -The `gohtmltmpl` filetype is for use with the `html/template` package and is -identical to `gotexttmpl` except that it will also load the standard `html` -filetype. - -The `gohtmltmpl` filetype is automatically set for `*.tmpl` files; the -`gotexttmpl` is never automatically set and needs to be set manually. - -============================================================================== - *gomod* *ft-gomod-syntax* -go.mod file syntax~ - -The `gomod` 'filetype' provides syntax highlighting for Go's module file -`go.mod` - - -============================================================================== -DEBUGGER *go-debug* - -Vim-go comes with a special "debugger mode". This starts a `dlv` process in -the background and provides various commands to communicate with it. - -This debugger is similar to Visual Studio or Eclipse and has the following -features: - - * Show stack trace and jumps. - * List local variables. - * List function arguments. - * Expand values of struct or array/slice. - * Show balloon on the symbol. - * Show output of stdout/stderr. - * Toggle breakpoint. - * Stack operation continue/next/step out. - -This feature requires either Vim 8.0.0087 or newer with the |+job| feature or -Neovim. This features also requires Delve 1.0.0 or newer, and it is -recommended to use Go 1.10 or newer, as its new caching will speed up -recompiles. - - *go-debug-intro* -GETTING STARTED WITH THE DEBUGGER~ - -Use |:GoDebugStart| or |:GoDebugTest| to start the debugger. The first -argument is the package name, and any arguments after that will be passed on -to the program; for example: -> - :GoDebugStart . -someflag value -< -This may take few seconds. After the code is compiled you'll see three new -windows: the stack trace on left side, the variable list on the bottom-left, -and program output at the bottom. - -You can add breakpoints with |:GoDebugBreakpoint| () and run your program -with |:GoDebugContinue| (). - -The program will halt on the breakpoint, at which point you can inspect the -program state. You can go to the next line with |:GoDebugNext| () or step -in with |:GoDebugStep| (). - -The variable window in the bottom left (`GODEBUG_VARIABLES`) will display all -local variables. Struct values are displayed as `{...}`, array/slices as -`[4]`. Use on the variable name to expand the values. - -The `GODEBUG_OUTPUT` window displays output from the program and the Delve -debugger. - -The `GODEBUG_STACKTRACE` window can be used to jump to different places in the -call stack. - -When you're done use |:GoDebugStop| to close the debugging windows and halt -the `dlv` process, or |:GoDebugRestart| to recompile the code. - - *go-debug-commands* -DEBUGGER COMMANDS~ - -Only |:GoDebugStart| and |:GoDebugBreakpoint| are available by default; the -rest of the commands and mappings become available after starting debug mode. - - *:GoDebugStart* -:GoDebugStart [pkg] [program-args] - - Start the debug mode for [pkg]; this does several things: - - * Setup the debug windows according to |'g:go_debug_windows'|. - * Make the `:GoDebug*` commands and `(go-debug-*)` mappings available. - - The directory of the current buffer is used if [pkg] is empty. Any other - arguments will be passed to the program. - - Use |:GoDebugStop| to stop `dlv` and exit debugging mode. - - *:GoDebugTest* -:GoDebugTest [pkg] [program-args] - - Behaves the same as |:GoDebugStart| but runs `dlv test` instead of - `dlv debug` so you can debug tests. - - Use `-test.flag` to pass flags to `go test` when debugging a test; for - example `-test.v` or `-test.run TestFoo` - - *:GoDebugRestart* -:GoDebugRestart - - Stop the program (if running) and restart `dlv` to recompile the package. - The current window layout and breakpoints will be left intact. - - *:GoDebugStop* - *(go-debug-stop)* -:GoDebugStop - - Stop `dlv` and remove all debug-specific commands, mappings, and windows. - - *:GoDebugBreakpoint* - *(go-debug-breakpoint)* -:GoDebugBreakpoint [linenr] - - Toggle breakpoint for the [linenr]. [linenr] defaults to the current line - if it is omitted. A line with a breakpoint will have the - {godebugbreakpoint} |:sign| placed on it. The line the program is - currently halted on will have the {godebugcurline} sign. - - *hl-GoDebugCurrent* *hl-GoDebugBreakpoint* - A line with a breakpoint will be highlighted with the {GoDebugBreakpoint} - group; the line the program is currently halted on will be highlighted - with {GoDebugCurrent}. - - Mapped to by default. - - *:GoDebugContinue* - *(go-debug-continue)* -:GoDebugContinue - - Continue execution until breakpoint or program termination. It will start - the program if it hasn't been started yet. - - Mapped to by default. - - *:GoDebugNext* - *(go-debug-next)* -:GoDebugNext - - Advance execution by one line, also called "step over" by some other - debuggers. - It will behave as |:GoDebugContinue| if the program isn't started. - - Mapped to by default. - - *:GoDebugStep* - *(go-debug-step)* -:GoDebugStep - - Advance execution by one step, stopping at the next line of code that will - be executed (regardless of location). - It will behave as |:GoDebugContinue| if the program isn't started. - - Mapped to by default. - - *:GoDebugStepOut* - *(go-debug-stepout)* - -:GoDebugStepOut - - Run all the code in the current function and halt when the function - returns ("step out of the current function"). - It will behave as |:GoDebugContinue| if the program isn't started. - - *:GoDebugSet* -:GoDebugSet {var} {value} - - Set the variable {var} to {value}. Example: -> - :GoDebugSet truth 42 -< - This only works for `float`, `int` and variants, `uint` and variants, - `bool`, and pointers (this is a `delve` limitation, not a vim-go - limitation). - - *:GoDebugPrint* - *(go-debug-print)* -:GoDebugPrint {expr} - - Print the result of a Go expression. -> - :GoDebugPrint truth == 42 - truth == 42 true -< - Mapped to by default, which will evaluate the under the - cursor. - - *go-debug-settings* -DEBUGGER SETTINGS~ - - *'g:go_debug_windows'* - -Controls the window layout for debugging mode. This is a |dict| with four -possible keys: "vars", "stack", "goroutines", and "out"; each of the new -windows will be created in that that order with the commands in the value. The -current window is made the only window before creating the debug windows. - -A window will not be created if a key is missing or empty. - -Defaults: -> - let g:go_debug_windows = { - \ 'vars': 'leftabove 30vnew', - \ 'stack': 'leftabove 20new', - \ 'goroutines': 'botright 10new', - \ 'out': 'botright 5new', - \ } -< -Show only variables on the right-hand side: > - - let g:go_debug_windows = { - \ 'vars': 'rightbelow 60vnew', - \ } -< - *'g:go_debug_address'* - -Server address `dlv` will listen on; must be in `hostname:port` format. -Defaults to `127.0.0.1:8181`: -> - let g:go_debug_address = '127.0.0.1:8181' -< - - *'g:go_debug_log_output'* - -Specifies log output options for `dlv`. Value should be a single string of -comma-separated options suitable for passing to `dlv`. An empty string (`''`) -will suppress logging entirely. Default: `'debugger,rpc'`: -> - let g:go_debug_log_output = 'debugger,rpc' -< - - *'g:go_highlight_debug'* - -Highlight the current line and breakpoints in the debugger. - -> - let g:go_highlight_debug = 1 -< - - *'go:go_debug_breakpoint_sign_text'* - -Set the sign text used for breakpoints in the debugger. By default it's '>'. - -> - let g:go_debug_breakpoint_sign_text = '>' -< - -============================================================================== -FAQ TROUBLESHOOTING *go-troubleshooting* - -How do I troubleshoot problems?~ - -One of the best ways to understand what vim-go is doing and the output from -the tools to which it delegates is to use leverage the features described in -|'g:go_debug'|. - -Completion and other functions that use `gopls` don't work~ - -Vim-go is heavily reliant on `gopls` for completion and other functionality. -Many of the features that use `gopls` (e.g. completion, jumping to -definitions, showing identifier information, et al.) can be configured to -delegate to other tools. e.g. completion via 'omnifunc', |'g:go_info_mode'| -and |'g:go_def_mode'| can be set to use other tools for now (though some of -the alternatives to `gopls` are effectively at their end of life and support -for them from within vim-go may be removed soon). - -I want to disable `gopls`~ - -Vim-go's use of `gopls` can be disabled with 'g:go_gopls_enabled'. - -Some users want to do this to limit the load on their system when using vim-go -concurrently with an LSP client like vim-lsp. Instead of disabling vim-go's -use of `gopls`, you may prefer to configure vim-go to share the `gopls` -instance with other LSP plugins. 'g:go_gopls_options' can be used to configure -how vim-go starts `gopls` so that the instance can be shared with other -plugins and vim-go user's can leverage the full power of vim-go. - -I get a "Unknown function: go#config#..." error~ - -This often happens to vim-polyglot users when new config options are added to -vim-go. Run vim-polyglot's `build` script or make sure that vim-go is loaded -before vim-polyglot. - -It can also happen when multiple versions of vim-go are installed and the -version loaded by Vim doesn't have a function introduced by a later version. -To see where vim-go is being loaded from run -> - :verbose function go#config#FmtAutosave -< - -The output will show the path to the `autoload/go/config.vim` that was loaded -by Vim. Make sure the root of the path to output by the command is the path -from which vim-go is expected to sourced. If it is not rooted as expected, -then there are multiple copies of vim-go installed; remove the unexpected -copies. - -I get "not an editor command" error when I invoke :GoXXX~ - -This happens if vim-go is not installed properly. Be sure you have added this -line into your vimrc: -> - filetype plugin indent on -< - -I get a "command not found" error when I invoke :GoXXX~ - -If you try to call |:GoDef|, |:GoInfo| and get a command not found, check that -you have the binaries installed by using |:GoInstallBinaries|. - -Before opening vim, check your current $PATH: -> - echo $PATH -< -After opening vim, run `:echo $PATH`, the output must be your current `$PATH` -plus `$GOPATH/bin` (the location where |:GoInstallBinaries| installed the -binaries). - - *go-guru-scope* -What is the guru scope and how do I set it?~ - -Many vim-go commands use the `guru` commandline tool to get information. Some -`guru` commands require an expensive analysis of the source code. To still get -a reasonable amount of performance `guru` limits this analysis to a selected -list of packages. This is known as the "guru scope". - -The default is to use the package the current buffer belongs to, but this may -not always be correct. For example for the file `guthub.com/user/pkg/a/a.go` -the scope will be set to `github.com/user/pkg/a`, but you probably want -`github.com/user/pkg` - -Guessing what package(s) you do want is not easy so you may need to set this -manually, usually from an |autocommand|: -> - autocmd BufRead /home/martin/go/src/github.com/user/pkg/*.go - \ :GoGuruScope github.com/user/pkg -< - -If you have a lot of packages with the same prefix (`github.com/user`) you can -use a single autocommand: -> - autocmd BufRead /home/martin/go/src/*.go - \ let s:tmp = matchlist(expand('%:p'), - \ '/home/martin/go/src/\(github.com/user/[^/]\+\)') - \| if len(s:tmp) > 1 | exe 'silent :GoGuruScope ' . s:tmp[1] | endif - \| unlet s:tmp -< -Also see |:GoGuruScope| and |'g:go_guru_scope'|. - - -Vim becomes slow while editing Go files~ - -The most common cause for this is using an older version of Vim that doesn't -support asynchronous jobs. |'g:go_auto_sameids'| and |'g:go_auto_type_info'| -run jobs that can cause noticable delays when used with vim74. The problem is -most pronounced on vim74, but can occur on vim8 and nvim. On vim8 and nvim, -the problem should be restricted to a short period when the first buffer in a -package is first loaded. - -If you see unexpected characters rendered in the current window, the problem -is most likely due to |'g:go_auto_sameids'| or |'g:go_auto_type_info'|. First, -try using another mode for |'g:go_info_mode'|. If that doesn't work, try -disabling |'g:go_auto_sameids'| and |'g:go_auto_type_info'|. - -To a lesser extent, this can be caused by `g:go_highlight_*` options. If Vim -is just slower than normal, but doesn't render unexpected characters in the -currrent window, then the problem is most likely the `g:go_highlight_*` -options. Try disabling them if you've enabled some of them. - -I get errors when using GoInstallBinaries~ - -If you see errors like this: -> - Error installing golang.org/x/tools/cmd/goimports -< -that means your local Go setup is broken or the remote website is down. For -example sometimes code.google.com times out. To test, just execute a simple -`go get`: -> - go get golang.org/x/tools/cmd/goimports -< -You'll see a more detailed error. If this works, vim-go will work too. - - -I want to use a different binary name than "go", can I do this?~ - -There is no way to directly configure the binary name; but you can use a -wrapper script; for example if you would like to run `goapp` instead of `go`: - -1. In `~/gobin/go` (remember to make it executable): -> - #!/bin/sh - # Remove gobin from PATH and run goapp. - PATH=${PATH#$HOME/gobin} goapp "$@" -< -2. Start Vim with `~/gobin` as the first `PATH` entry so it will use the - wrapper script: -> - PATH="$HOME/gobin/:$PATH" vim -< - Alternatively you you could set `$PATH` in your vimrc with an |:autocmd|. - - -How do I use vim-go with syntastic?~ - -Sometimes when using both `vim-go` and `syntastic` Vim will start lagging -while saving and opening files. The following fixes this: -> - let g:syntastic_go_checkers = ['golint', 'govet'] - let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] } -< -If you want to add errcheck you can use golangci-lint as a wrapper: -> - let g:syntastic_go_checkers = ['golint', 'govet', 'golangci-lint'] - let g:syntastic_go_gometalinter_args = ['--disable-all', '--enable=errcheck'] - let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] } -< -Another issue with `vim-go` and `syntastic` is that the location list window -that contains the output of commands such as `:GoBuild` and `:GoTest` might -not appear. To resolve this: -> - let g:go_list_type = "quickfix" -< - -How do I run focused ginkgo tests?~ - -You must set this environment variable in your `.vimrc`: -> - let $GINKGO_EDITOR_INTEGRATION = "true" -< - -Using with NeoVim~ - -Note: Neovim currently is not a first class citizen for vim-go. You are free -to open bug, however I'm not using Neovim so it's hard for me to test it. -vim-go might not work as well in Neovim as it does in Vim. I'm happy to accept -pull requests or very detailed bug reports. If you're interested to improve -the state of Neovim in vim-go you're always welcome! - -Run `:GoRun` in a new tab, horizontal split or vertical split terminal -> - au FileType go nmap rt (go-run-tab) - au FileType go nmap rs (go-run-split) - au FileType go nmap rv (go-run-vertical) -< -By default new terminals are opened in a vertical split. To change it -> - let g:go_term_mode = "split" -> - -How can I customize the highlighting?~ - -All the highlight groups used by vim-go are prefixed with `go` (e.g. -`goType`) and are defined in the files in the `syntax` directory. To change -the highlighting for any group, add a `highlight` command for the group to -your vimrc. To turn off the highlighting for any group, add `highlight link -group-name NONE` (where `group-name` is the name of the group whose highlight -you'd like to turn off) to your vimrc. - -Some people may wish to highlight Go's builtins as keywords. To do so, one -should simply add `highlight link goBuiltins Keyword` to the `vimrc` file. - -============================================================================== -DEVELOPMENT *go-development* - -vim-go supports test files written in VimScript; the way they're run is -roughly similar to Go tests: - -- A `*.vim` file has a corresponding `*_test.vim`. -- All functions starting with `Test_` are run as test. -- A test is considered to be "failed" if |v:errors| has any entries. You can - use one of the |test-functions| to set this, or append to it directly. - -A simple example: -> - function Test_run_fmt() - call assert_equal(expected, actual) - ... - endfunction -< -To run tests vim-go comes with three small helper scripts: - - `scripts/install-vim` Install a pristine Vim to `/tmp/vim-go-test/`. - `scripts/run-vim` Run a Vim version from `/tmp/vim-go-test/`. - `scripts/test` Run all tests with a Vim from `/tmp/vim-go-test/`. - -All scripts accept a Vim version as the first argument, which can be -`vim-8.0` or `nvim`. You will need to install a Vim version with -`install-vim` before you can use `run-vim` or `test`. - -You can install and test all Vim versions by running `make`. - - -============================================================================== -DONATION *go-donation* - -People have asked for this for a long time, now you can be a fully supporter -by being a patreon at: https://www.patreon.com/bhcleek - -By being a patron, you are enabling vim-go to grow and mature, helping me to -invest in bug fixes, new documentation, and improving both current and future -features. It's completely optional and is just a direct way to support -vim-go's ongoing development. Thanks! - -Check it out: https://www.patreon.com/bhcleek - - -============================================================================== -CREDITS *go-credits* - -* Go Authors for official Vim plugins. -* Gocode, Godef, Golint, Guru, Goimports, Errcheck projects and authors of - those projects. -* Other vim-plugins, thanks for inspiration (vim-golang, go.vim, vim-gocode, - vim-godef). -* vim-go contributors: https://github.com/fatih/vim-go/graphs/contributors. - - - vim: ft=help tw=78 et ts=2 sw=2 sts=2 norl diff --git a/vim-config/plugins/vim-go/ftdetect/gofiletype.vim b/vim-config/plugins/vim-go/ftdetect/gofiletype.vim deleted file mode 100644 index 7051f373..00000000 --- a/vim-config/plugins/vim-go/ftdetect/gofiletype.vim +++ /dev/null @@ -1,40 +0,0 @@ -" vint: -ProhibitAutocmdWithNoGroup - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -" Note: should not use augroup in ftdetect (see :help ftdetect) -au BufRead,BufNewFile *.go setfiletype go -au BufRead,BufNewFile *.s setfiletype asm -au BufRead,BufNewFile *.tmpl setfiletype gohtmltmpl - -" remove the autocommands for modsim3, and lprolog files so that their -" highlight groups, syntax, etc. will not be loaded. *.MOD is included, so -" that on case insensitive file systems the module2 autocmds will not be -" executed. -au! BufRead,BufNewFile *.mod,*.MOD -" Set the filetype if the first non-comment and non-blank line starts with -" 'module '. -au BufRead,BufNewFile go.mod call s:gomod() - -fun! s:gomod() - for l:i in range(1, line('$')) - let l:l = getline(l:i) - if l:l ==# '' || l:l[:1] ==# '//' - continue - endif - - if l:l =~# '^module .\+' - setfiletype gomod - endif - - break - endfor -endfun - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/asm.vim b/vim-config/plugins/vim-go/ftplugin/asm.vim deleted file mode 100644 index 9271d225..00000000 --- a/vim-config/plugins/vim-go/ftplugin/asm.vim +++ /dev/null @@ -1,37 +0,0 @@ -" asm.vim: Vim filetype plugin for Go assembler. - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setl fo< com< cms< - \ | exe 'au! vim-go-asm-buffer * '" - -setlocal formatoptions-=t - -setlocal comments=s1:/*,mb:*,ex:*/,:// -setlocal commentstring=//\ %s - -setlocal noexpandtab - -command! -nargs=0 AsmFmt call go#asmfmt#Format() - -" Autocommands -" ============================================================================ - -augroup vim-go-asm-buffer - autocmd! * - - autocmd BufWritePre call go#auto#asmfmt_autosave() -augroup end - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/go.vim b/vim-config/plugins/vim-go/ftplugin/go.vim deleted file mode 100644 index 05066a5f..00000000 --- a/vim-config/plugins/vim-go/ftplugin/go.vim +++ /dev/null @@ -1,144 +0,0 @@ -" Copyright 2013 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" go.vim: Vim filetype plugin for Go. - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setl fo< com< cms<" - \ . "| exe 'au! vim-go-buffer * '" - -setlocal formatoptions-=t - -setlocal comments=s1:/*,mb:*,ex:*/,:// -setlocal commentstring=//\ %s - -setlocal noexpandtab - -compiler go - -if go#config#CodeCompletionEnabled() - " Set autocompletion - setlocal omnifunc=go#complete#Complete -endif - -if get(g:, "go_doc_keywordprg_enabled", 1) - " keywordprg doesn't allow to use vim commands, override it - nnoremap K :GoDoc -endif - -if get(g:, "go_def_mapping_enabled", 1) - " these are default Vim mappings, we're overriding them to make them - " useful again for Go source code - nnoremap gd :GoDef - nnoremap :GoDef - nnoremap :GoDef - nnoremap g :GoDef - nnoremap :call go#def#Jump("split", 0) - nnoremap ] :call go#def#Jump("split", 0) - nnoremap :call go#def#StackPop(v:count1) -endif - -if get(g:, "go_textobj_enabled", 1) - onoremap af :call go#textobj#Function('a') - xnoremap af :call go#textobj#Function('a') - - onoremap if :call go#textobj#Function('i') - xnoremap if :call go#textobj#Function('i') - - onoremap ac :call go#textobj#Comment('a') - xnoremap ac :call go#textobj#Comment('a') - - onoremap ic :call go#textobj#Comment('i') - xnoremap ic :call go#textobj#Comment('i') - - " Remap ]] and [[ to jump betweeen functions as they are useless in Go - nnoremap ]] :call go#textobj#FunctionJump('n', 'next') - nnoremap [[ :call go#textobj#FunctionJump('n', 'prev') - - onoremap ]] :call go#textobj#FunctionJump('o', 'next') - onoremap [[ :call go#textobj#FunctionJump('o', 'prev') - - xnoremap ]] :call go#textobj#FunctionJump('v', 'next') - xnoremap [[ :call go#textobj#FunctionJump('v', 'prev') -endif - -" Autocommands -" ============================================================================ -" -augroup vim-go-buffer - autocmd! * - - " The file is registered (textDocument/DidOpen) with gopls in plugin/go.vim - " on the FileType event. - " TODO(bc): handle all the other events that may be of interest to gopls, - " too (e.g. BufFilePost , CursorHold , CursorHoldI, FileReadPost, - " StdinReadPre, BufWritePost, TextChange, TextChangedI) - if go#util#has_job() - autocmd BufWritePost call go#lsp#DidChange(expand(':p')) - autocmd FileChangedShellPost call go#lsp#DidChange(expand(':p')) - autocmd BufDelete call go#lsp#DidClose(expand(':p')) - endif - - autocmd BufEnter,CursorHold call go#auto#update_autocmd() - - " Echo the identifier information when completion is done. Useful to see - " the signature of a function, etc... - if exists('##CompleteDone') - autocmd CompleteDone call go#auto#complete_done() - endif - - autocmd BufWritePre call go#auto#fmt_autosave() - autocmd BufWritePost call go#auto#metalinter_autosave() - - if !has('textprop') - "TODO(bc): how to clear sameids and diagnostics when a non-go buffer is - " loaded into a window and the previously loaded buffer is still loaded in - " another window? - - " TODO(bc): only clear when the new buffer isn't the old buffer - - " clear SameIds when the buffer is unloaded from its last window so that - " loading another buffer (especially of a different filetype) in the same - " window doesn't highlight the most recently matched identifier's positions. - autocmd BufWinLeave call go#guru#ClearSameIds() - " clear SameIds when a new buffer is loaded in the window so that the - " previous buffer's highlighting isn't used. - autocmd BufWinEnter call go#guru#ClearSameIds() - - " clear diagnostics when the buffer is unloaded from its last window so that - " loading another buffer (especially of a different filetype) in the same - " window doesn't highlight the previously loaded buffer's diagnostics. - autocmd BufWinLeave call go#lsp#ClearDiagnosticHighlights() - " clear diagnostics when a new buffer is loaded in the window so that the - " previous buffer's diagnostics aren't used. - "autocmd BufWinEnter call go#lsp#ClearDiagnosticHighlights() - endif - - autocmd BufEnter - \ if go#config#AutodetectGopath() && !exists('b:old_gopath') - \| let b:old_gopath = exists('$GOPATH') ? $GOPATH : -1 - \| let $GOPATH = go#path#Detect() - \| endif - autocmd BufLeave - \ if exists('b:old_gopath') - \| if b:old_gopath isnot -1 - \| let $GOPATH = b:old_gopath - \| endif - \| unlet b:old_gopath - \| endif -augroup end - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/go/commands.vim b/vim-config/plugins/vim-go/ftplugin/go/commands.vim deleted file mode 100644 index ea3f2418..00000000 --- a/vim-config/plugins/vim-go/ftplugin/go/commands.vim +++ /dev/null @@ -1,127 +0,0 @@ -" -- gorename -command! -nargs=? -complete=customlist,go#rename#Complete GoRename call go#rename#Rename(0, ) - -" -- guru -command! -nargs=* -complete=customlist,go#package#Complete GoGuruScope call go#guru#Scope() -command! -range=% GoImplements call go#implements#Implements() -command! -range=% GoPointsTo call go#guru#PointsTo() -command! -range=% GoWhicherrs call go#guru#Whicherrs() -command! -range=% GoCallees call go#guru#Callees() -command! -range=% GoDescribe call go#guru#Describe() -command! -range=% GoCallers call go#guru#Callers() -command! -range=% GoCallstack call go#guru#Callstack() -command! -range=% GoFreevars call go#guru#Freevars() -command! -range=% GoChannelPeers call go#guru#ChannelPeers() -command! -range=% GoReferrers call go#referrers#Referrers() - -command! -range=0 GoSameIds call go#guru#SameIds(1) -command! -range=0 GoSameIdsClear call go#guru#ClearSameIds() -command! -range=0 GoSameIdsToggle call go#guru#ToggleSameIds() -command! -range=0 GoSameIdsAutoToggle call go#guru#AutoToggleSameIds() - -" -- tags -command! -nargs=* -range GoAddTags call go#tags#Add(, , , ) -command! -nargs=* -range GoRemoveTags call go#tags#Remove(, , , ) - -" -- mod -command! -nargs=0 -range GoModFmt call go#mod#Format() - -" -- tool -command! -nargs=* -complete=customlist,go#tool#ValidFiles GoFiles echo go#tool#Files() -command! -nargs=0 GoDeps echo go#tool#Deps() -command! -nargs=0 GoInfo call go#tool#Info(1) -command! -nargs=0 GoAutoTypeInfoToggle call go#complete#ToggleAutoTypeInfo() - -" -- cmd -command! -nargs=* -bang GoBuild call go#cmd#Build(0,) -command! -nargs=? -bang GoBuildTags call go#cmd#BuildTags(0, ) -command! -nargs=* -bang GoGenerate call go#cmd#Generate(0,) -command! -nargs=* -bang -complete=file GoRun call go#cmd#Run(0,) -command! -nargs=* -bang GoInstall call go#cmd#Install(0, ) - -" -- test -command! -nargs=* -bang GoTest call go#test#Test(0, 0, ) -command! -nargs=* -bang GoTestFunc call go#test#Func(0, ) -command! -nargs=* -bang GoTestCompile call go#test#Test(0, 1, ) - -" -- cover -command! -nargs=* -bang GoCoverage call go#coverage#Buffer(0, ) -command! -nargs=* -bang GoCoverageClear call go#coverage#Clear() -command! -nargs=* -bang GoCoverageToggle call go#coverage#BufferToggle(0, ) -command! -nargs=* -bang GoCoverageBrowser call go#coverage#Browser(0, ) - -" -- play -command! -nargs=0 -range=% GoPlay call go#play#Share(, , ) - -" -- def -command! -nargs=* -range GoDef :call go#def#Jump('', 0) -command! -nargs=* -range GoDefType :call go#def#Jump('', 1) -command! -nargs=? GoDefPop :call go#def#StackPop() -command! -nargs=? GoDefStack :call go#def#Stack() -command! -nargs=? GoDefStackClear :call go#def#StackClear() - -" -- doc -command! -nargs=* -range -complete=customlist,go#package#Complete GoDoc call go#doc#Open('new', 'split', ) -command! -nargs=* -range -complete=customlist,go#package#Complete GoDocBrowser call go#doc#OpenBrowser() - -" -- fmt -command! -nargs=0 GoFmt call go#fmt#Format(-1) -command! -nargs=0 GoFmtAutoSaveToggle call go#fmt#ToggleFmtAutoSave() -command! -nargs=0 GoImports call go#fmt#Format(1) - -" -- asmfmt -command! -nargs=0 GoAsmFmtAutoSaveToggle call go#asmfmt#ToggleAsmFmtAutoSave() - -" -- import -command! -nargs=? -complete=customlist,go#package#Complete GoDrop call go#import#SwitchImport(0, '', , '') -command! -nargs=1 -bang -complete=customlist,go#package#Complete GoImport call go#import#SwitchImport(1, '', , '') -command! -nargs=* -bang -complete=customlist,go#package#Complete GoImportAs call go#import#SwitchImport(1, , '') - -" -- linters -command! -nargs=* -bang GoMetaLinter call go#lint#Gometa(0, 0, ) -command! -nargs=0 GoMetaLinterAutoSaveToggle call go#lint#ToggleMetaLinterAutoSave() -command! -nargs=* -bang GoLint call go#lint#Golint(0, ) -command! -nargs=* -bang GoVet call go#lint#Vet(0, ) -command! -nargs=* -bang -complete=customlist,go#package#Complete GoErrCheck call go#lint#Errcheck(0, ) - -" -- alternate -command! -bang GoAlternate call go#alternate#Switch(0, '') - -" -- decls -command! -nargs=? -complete=file GoDecls call go#decls#Decls(0, ) -command! -nargs=? -complete=dir GoDeclsDir call go#decls#Decls(1, ) - -" -- impl -command! -nargs=* -complete=customlist,go#impl#Complete GoImpl call go#impl#Impl() - -" -- template -command! -nargs=0 GoTemplateAutoCreateToggle call go#template#ToggleAutoCreate() - -" -- keyify -command! -nargs=0 GoKeyify call go#keyify#Keyify() - -" -- fillstruct -command! -nargs=0 GoFillStruct call go#fillstruct#FillStruct() - -" -- debug -if !exists(':GoDebugStart') - command! -nargs=* -complete=customlist,go#package#Complete GoDebugStart call go#debug#Start(0, ) - command! -nargs=* -complete=customlist,go#package#Complete GoDebugTest call go#debug#Start(1, ) - command! -nargs=? GoDebugBreakpoint call go#debug#Breakpoint() -endif - -" -- issue -command! -nargs=0 GoReportGitHubIssue call go#issue#New() - -" -- iferr -command! -nargs=0 GoIfErr call go#iferr#Generate() - -" -- lsp -command! -nargs=+ -complete=dir GoAddWorkspace call go#lsp#AddWorkspaceDirectory() -command! -nargs=0 GoLSPDebugBrowser call go#lsp#DebugBrowser() -command! -nargs=* -bang GoDiagnostics call go#lint#Diagnostics(0, ) - -" -- term -command! GoToggleTermCloseOnExit call go#term#ToggleCloseOnExit() - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/go/mappings.vim b/vim-config/plugins/vim-go/ftplugin/go/mappings.vim deleted file mode 100644 index f8fb00b1..00000000 --- a/vim-config/plugins/vim-go/ftplugin/go/mappings.vim +++ /dev/null @@ -1,88 +0,0 @@ -" go_jump_to_error defines whether we should pass the bang attribute to the -" command or not. This is only used for mappings, because the user can't pass -" the bang attribute to the plug mappings below. So instead of hardcoding it -" as 0 (no '!' attribute) or 1 (with '!' attribute) we pass the user setting, -" which by default is enabled. For commands the user has the ability to pass -" the '!', such as :GoBuild or :GoBuild! -if !exists("g:go_jump_to_error") - let g:go_jump_to_error = 1 -endif - -" Some handy plug mappings -nnoremap (go-run) :call go#cmd#Run(!g:go_jump_to_error) - -if has("nvim") - nnoremap (go-run-vertical) :call go#cmd#RunTerm(!g:go_jump_to_error, 'vsplit', []) - nnoremap (go-run-split) :call go#cmd#RunTerm(!g:go_jump_to_error, 'split', []) - nnoremap (go-run-tab) :call go#cmd#RunTerm(!g:go_jump_to_error, 'tabe', []) -endif - -nnoremap (go-build) :call go#cmd#Build(!g:go_jump_to_error) -nnoremap (go-generate) :call go#cmd#Generate(!g:go_jump_to_error) -nnoremap (go-install) :call go#cmd#Install(!g:go_jump_to_error) -nnoremap (go-test) :call go#test#Test(!g:go_jump_to_error, 0) -nnoremap (go-test-func) :call go#test#Func(!g:go_jump_to_error) -nnoremap (go-test-compile) :call go#test#Test(!g:go_jump_to_error, 1) - -nnoremap (go-coverage) :call go#coverage#Buffer(!g:go_jump_to_error) -nnoremap (go-coverage-clear) :call go#coverage#Clear() -nnoremap (go-coverage-toggle) :call go#coverage#BufferToggle(!g:go_jump_to_error) -nnoremap (go-coverage-browser) :call go#coverage#Browser(!g:go_jump_to_error) - -nnoremap (go-files) :call go#tool#Files() -nnoremap (go-deps) :call go#tool#Deps() -nnoremap (go-info) :call go#tool#Info(1) -nnoremap (go-import) :call go#import#SwitchImport(1, '', expand(''), '') -nnoremap (go-imports) :call go#fmt#Format(1) - -nnoremap (go-implements) :call go#guru#Implements(-1) -nnoremap (go-callees) :call go#guru#Callees(-1) -nnoremap (go-callers) :call go#guru#Callers(-1) -nnoremap (go-describe) :call go#guru#Describe(-1) -nnoremap (go-callstack) :call go#guru#Callstack(-1) -xnoremap (go-freevars) :call go#guru#Freevars(0) -nnoremap (go-channelpeers) :call go#guru#ChannelPeers(-1) -nnoremap (go-referrers) :call go#referrers#Referrers(-1) -nnoremap (go-sameids) :call go#guru#SameIds(1) -nnoremap (go-pointsto) :call go#guru#PointsTo(-1) -nnoremap (go-whicherrs) :call go#guru#Whicherrs(-1) -nnoremap (go-sameids-toggle) :call go#guru#ToggleSameIds() - -nnoremap (go-rename) :call go#rename#Rename(!g:go_jump_to_error) - -nnoremap (go-decls) :call go#decls#Decls(0, '') -nnoremap (go-decls-dir) :call go#decls#Decls(1, '') - -nnoremap (go-def) :call go#def#Jump('', 0) -nnoremap (go-def-vertical) :call go#def#Jump("vsplit", 0) -nnoremap (go-def-split) :call go#def#Jump("split", 0) -nnoremap (go-def-tab) :call go#def#Jump("tab", 0) - -nnoremap (go-def-type) :call go#def#Jump('', 1) -nnoremap (go-def-type-vertical) :call go#def#Jump("vsplit", 1) -nnoremap (go-def-type-split) :call go#def#Jump("split", 1) -nnoremap (go-def-type-tab) :call go#def#Jump("tab", 1) - -nnoremap (go-def-pop) :call go#def#StackPop() -nnoremap (go-def-stack) :call go#def#Stack() -nnoremap (go-def-stack-clear) :call go#def#StackClear() - -nnoremap (go-doc) :call go#doc#Open("new", "split") -nnoremap (go-doc-tab) :call go#doc#Open("tabnew", "tabe") -nnoremap (go-doc-vertical) :call go#doc#Open("vnew", "vsplit") -nnoremap (go-doc-split) :call go#doc#Open("new", "split") -nnoremap (go-doc-browser) :call go#doc#OpenBrowser() - -nnoremap (go-metalinter) :call go#lint#Gometa(!g:go_jump_to_error, 0) -nnoremap (go-lint) :call go#lint#Golint(!g:go_jump_to_error) -nnoremap (go-vet) :call go#lint#Vet(!g:go_jump_to_error) - -nnoremap (go-alternate-edit) :call go#alternate#Switch(0, "edit") -nnoremap (go-alternate-vertical) :call go#alternate#Switch(0, "vsplit") -nnoremap (go-alternate-split) :call go#alternate#Switch(0, "split") - -nnoremap (go-iferr) :call go#iferr#Generate() - -nnoremap (go-diagnostics) :call go#lint#Diagnostics(!g:go_jump_to_error) - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/go/snippets.vim b/vim-config/plugins/vim-go/ftplugin/go/snippets.vim deleted file mode 100644 index 00bcbd40..00000000 --- a/vim-config/plugins/vim-go/ftplugin/go/snippets.vim +++ /dev/null @@ -1,67 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -if exists("g:go_loaded_gosnippets") - finish -endif -let g:go_loaded_gosnippets = 1 - -function! s:GoUltiSnips() abort - if get(g:, 'did_plugin_ultisnips') isnot 1 - return - endif - - if !exists("g:UltiSnipsSnippetDirectories") - let g:UltiSnipsSnippetDirectories = ["gosnippets/UltiSnips"] - else - let g:UltiSnipsSnippetDirectories += ["gosnippets/UltiSnips"] - endif -endfunction - -function! s:GoNeosnippet() abort - if get(g:, 'loaded_neosnippet') isnot 1 - return - endif - - let g:neosnippet#enable_snipmate_compatibility = 1 - - let l:gosnippets_dir = globpath(&rtp, 'gosnippets/snippets') - if type(g:neosnippet#snippets_directory) == type([]) - let g:neosnippet#snippets_directory += [l:gosnippets_dir] - elseif type(g:neosnippet#snippets_directory) == type("") - if strlen(g:neosnippet#snippets_directory) > 0 - let g:neosnippet#snippets_directory = g:neosnippet#snippets_directory . "," . l:gosnippets_dir - else - let g:neosnippet#snippets_directory = l:gosnippets_dir - endif - endif -endfunction - -function! s:GoMinisnip() abort - if get(g:, 'loaded_minisnip') isnot 1 - return - endif - - if exists('g:minisnip_dir') - let g:minisnip_dir .= go#util#PathListSep() . globpath(&rtp, 'gosnippets/minisnip') - else - let g:minisnip_dir = globpath(&rtp, 'gosnippets/minisnip') - endif -endfunction - - -let s:engine = go#config#SnippetEngine() -if s:engine is? 'ultisnips' - call s:GoUltiSnips() -elseif s:engine is? 'neosnippet' - call s:GoNeosnippet() -elseif s:engine is? 'minisnip' - call s:GoMinisnip() -endif - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/go/tagbar.vim b/vim-config/plugins/vim-go/ftplugin/go/tagbar.vim deleted file mode 100644 index 3ca244ba..00000000 --- a/vim-config/plugins/vim-go/ftplugin/go/tagbar.vim +++ /dev/null @@ -1,65 +0,0 @@ -" Check if tagbar is installed under plugins or is directly under rtp -" this covers pathogen + Vundle/Bundle -" -" Also make sure the ctags command exists -" -if !executable('ctags') - finish -elseif globpath(&rtp, 'plugin/tagbar.vim') == "" - finish -endif - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -if !exists("g:go_gotags_bin") - let g:go_gotags_bin = "gotags" -endif - - -function! s:SetTagbar() - let bin_path = go#path#CheckBinPath(g:go_gotags_bin) - if empty(bin_path) - return - endif - - if !exists("g:tagbar_type_go") - let g:tagbar_type_go = { - \ 'ctagstype' : 'go', - \ 'kinds' : [ - \ 'p:package', - \ 'i:imports', - \ 'c:constants', - \ 'v:variables', - \ 't:types', - \ 'n:interfaces', - \ 'w:fields', - \ 'e:embedded', - \ 'm:methods', - \ 'r:constructor', - \ 'f:functions' - \ ], - \ 'sro' : '.', - \ 'kind2scope' : { - \ 't' : 'ctype', - \ 'n' : 'ntype' - \ }, - \ 'scope2kind' : { - \ 'ctype' : 't', - \ 'ntype' : 'n' - \ }, - \ 'ctagsbin' : bin_path, - \ 'ctagsargs' : '-sort -silent' - \ } - endif -endfunction - - -call s:SetTagbar() - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/gohtmltmpl.vim b/vim-config/plugins/vim-go/ftplugin/gohtmltmpl.vim deleted file mode 100644 index ea0aacff..00000000 --- a/vim-config/plugins/vim-go/ftplugin/gohtmltmpl.vim +++ /dev/null @@ -1,7 +0,0 @@ -if exists("b:did_ftplugin") - finish -endif - -runtime! ftplugin/html.vim - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/gomod.vim b/vim-config/plugins/vim-go/ftplugin/gomod.vim deleted file mode 100644 index b7871705..00000000 --- a/vim-config/plugins/vim-go/ftplugin/gomod.vim +++ /dev/null @@ -1,33 +0,0 @@ -" gomod.vim: Vim filetype plugin for Go assembler. - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setl fo< com< cms< - \ | exe 'au! vim-go-gomod-buffer * '" - -setlocal formatoptions-=t - -setlocal comments=s1:/*,mb:*,ex:*/,:// -setlocal commentstring=//\ %s - -" Autocommands -" ============================================================================ - -augroup vim-go-gomod-buffer - autocmd! * - - autocmd BufWritePre call go#auto#modfmt_autosave() -augroup end - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/ftplugin/gomod/commands.vim b/vim-config/plugins/vim-go/ftplugin/gomod/commands.vim deleted file mode 100644 index d6a7285f..00000000 --- a/vim-config/plugins/vim-go/ftplugin/gomod/commands.vim +++ /dev/null @@ -1,3 +0,0 @@ -command! -nargs=0 -range GoModFmt call go#mod#Format() - -command! -nargs=0 GoModFmtAutoSaveToggle call go#mod#ToggleModFmtAutoSave() diff --git a/vim-config/plugins/vim-go/ftplugin/gomod/mappings.vim b/vim-config/plugins/vim-go/ftplugin/gomod/mappings.vim deleted file mode 100644 index c8664f64..00000000 --- a/vim-config/plugins/vim-go/ftplugin/gomod/mappings.vim +++ /dev/null @@ -1 +0,0 @@ -nnoremap (go-mod-fmt) :call go#mod#Format() diff --git a/vim-config/plugins/vim-go/gosnippets/UltiSnips/go.snippets b/vim-config/plugins/vim-go/gosnippets/UltiSnips/go.snippets deleted file mode 100644 index 6261b6df..00000000 --- a/vim-config/plugins/vim-go/gosnippets/UltiSnips/go.snippets +++ /dev/null @@ -1,546 +0,0 @@ -# Snippets for Go - -priority -10 - -# shorthand variable declaration -snippet : "v := value" -${1} := ${0} -endsnippet - -# anonymous function -snippet anon "fn := func() { ... }" -${1:fn} := func() { - ${2:${VISUAL}} -} -${0} -endsnippet - -# append -snippet ap "append(slice, value)" -append(${1:slice}, ${0:value}) -endsnippet - -# append assignment -snippet ap= "a = append(a, value)" -${1:slice} = append($1, ${0:value}) -endsnippet - -# break -snippet br "break" -break -endsnippet - -# channel -snippet ch "chan Type" -chan ${0:int} -endsnippet - -# case -snippet case "case ...:" -case ${1:value}: - ${0:${VISUAL}} -endsnippet - -# constant -snippet con "const XXX Type = ..." -const ${1:NAME} ${2:Type} = ${0:0} -endsnippet - -# constants -snippet cons "const ( ... )" -const ( - ${1:NAME} ${2:Type} = ${3:value} - ${0} -) -endsnippet - -# constants with iota -snippet iota "const ( ... = iota )" -const ( - ${1:NAME} ${2:Type} = iota - ${0} -) -endsnippet - -# continue -snippet cn "continue" -continue -endsnippet - -# default case -snippet default "default: ..." -default: - ${0:${VISUAL}} -endsnippet - -# defer -snippet df "defer someFunction()" -defer ${1:func}(${2}) -${0} -endsnippet - -snippet def "defer func() { ... }" -defer func() { - ${0:${VISUAL}} -}() -endsnippet - -# defer recover -snippet defr -defer func() { - if err := recover(); err != nil { - ${0:${VISUAL}} - } -}() -endsnippet - -# gpl -snippet gpl -/* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, see . -* -* Copyright (C) ${1:Author}, `!v strftime("%Y")` -*/ -${0} -endsnippet - -# import -snippet import "import ( ... )" -import ( - "${1:package}" -) -endsnippet - -# full interface snippet -snippet interface "interface I { ... }" -type ${1:Interface} interface { - ${2:/* TODO: add methods */} -} -endsnippet - -# if condition -snippet if "if ... { ... }" -if ${1:condition} { - ${0:${VISUAL}} -} -endsnippet - -# else snippet -snippet else -else { - ${0:${VISUAL}} -} -endsnippet - -# if inline error -snippet ife "If with inline error" -if err := ${1:condition}; err != nil { - ${0:${VISUAL}} -} -endsnippet - -snippet ew "errors.Wrap" -errors.Wrap(${1:err}, "${2:message}") -endsnippet - -snippet ewf "errors.Wrapf" -errors.Wrapf(${1:err}, "${2:message %v}", ${3:args...}) -endsnippet - -# error snippet -snippet errn "Error return" !b -if err != nil { - return err -} -${0} -endsnippet - -snippet errnw "Error return wrap" !b -if err != nil { - return errors.Wrap(err, "${1:message}") -} -${0} -endsnippet - -snippet errnwf "Error return wrapf" !b -if err != nil { - return errors.Wrapf(err, "${1:message %v}", ${2:args...}) -} -${0} -endsnippet - -# error log snippet -snippet errl "Error with log.Fatal(err)" !b -if err != nil { - log.Fatal(err) -} -${0} -endsnippet - -# error multiple return -snippet errn, "Error return with two return values" !b -if err != nil { - return ${1:nil}, ${2:err} -} -${0} -endsnippet - -snippet errn,w "Error return wrap with two return values" !b -if err != nil { - return nil, errors.Wrap(err, "${1:message}") -} -${0} -endsnippet - -snippet errn,wf "Error return wrapf with two return values" !b -if err != nil { - return nil, errors.Wrapf(err, "${1:message %v}", ${2:args...}) -} -${0} -endsnippet - -# error panic -snippet errp "Error panic" !b -if err != nil { - panic(${1}) -} -${0} -endsnippet - -# error test -snippet errt "Error test fatal " !b -if err != nil { - t.Fatal(err) -} -${0} -endsnippet - -# error handle -snippet errh "Error handle and return" !b -if err != nil { - ${1} - return -} -${0} -endsnippet - -# json field tag -snippet json "\`json:key\`" -\`json:"${1:`!v go#util#snippetcase(matchstr(getline("."), '\w\+'))`}"\` -endsnippet - -# yaml field tag -snippet yaml "\`yaml:key\`" -\`yaml:"${1:`!v go#util#snippetcase(matchstr(getline("."), '\w\+'))`}"\` -endsnippet - -# fallthrough -snippet ft "fallthrough" -fallthrough -endsnippet - -# for loop -snippet for "for ... { ... }" -for ${1} { - ${0:${VISUAL}} -} -endsnippet - -# for integer loop -snippet fori "for 0..N-1 { ... }" -for ${1:i} := 0; $1 < ${2:N}; $1++ { - ${0:${VISUAL}} -} -endsnippet - -# for range loop -snippet forr "for k, v := range items { ... }" -for ${2:k}, ${3:v} := range ${1} { - ${0:${VISUAL}} -} -endsnippet - -snippet forsel "for select" -for { - select { - case ${2:${1:result} := }<- ${3:channel}: - ${0} - } -} -endsnippet - -snippet selc "select case" !b -case ${1:${2:var} := }<-${3:channel}: - ${0} -endsnippet - -# function -snippet func "func Function(...) [error] { ... }" -func ${1:name}(${2:params})${3/(.+)/ /}`!p opening_par(snip, 3)`$3`!p closing_par(snip, 3)` { - ${0:${VISUAL}} -} -endsnippet - -# Fmt Printf debug -snippet ff "fmt.Printf(...)" -fmt.Printf("$1 = %+v\n", ${1:${VISUAL}}) -endsnippet - -# Fmt Printf debug with hash -snippet ffh "fmt.Printf(#...) hash" -fmt.Printf("$1 = %#v\n", ${1:${VISUAL}}) -endsnippet - -# Fmt Println debug -snippet fn "fmt.Println(...)" -fmt.Println("${1:${VISUAL}}") -endsnippet - -# Fmt Errorf debug -snippet fe "fmt.Errorf(...)" -fmt.Errorf("${1:${VISUAL}}") -endsnippet - -# log printf -snippet lf "log.Printf(...)" -log.Printf("${1:${VISUAL}} = %+v\n", $1) -endsnippet - -# log println -snippet ln "log.Println(...)" -log.Println("${1:${VISUAL}}") -endsnippet - -# make -snippet make "make(Type, size)" -make(${1:[]string}, ${2:0})${0} -endsnippet - -# map -snippet map "map[Type]Type" -map[${1:string}]${0:int} -endsnippet - -# main() -snippet main "func main() { ... }" -func main() { - ${0:${VISUAL}} -} -endsnippet - -# method -snippet meth "func (self Type) Method(...) [error] { ... }" -func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}`!p opening_par(snip, 5)`$5`!p closing_par(snip, 5)` { - ${0:${VISUAL}} -} -endsnippet - -# ok -snippet ok "if !ok { ... }" -if !ok { - ${0:${VISUAL}} -} -endsnippet - -# package -snippet package "package ..." -// Package $1 provides ${2:...} -package ${1:main} -${0} -endsnippet - -# panic -snippet pn "panic()" -panic("${0:msg}") -endsnippet - -# return -snippet rt "return" -return ${0:${VISUAL}} -endsnippet - -# select -snippet select "select { case a := <-chan: ... }" -select { -case ${1:v1} := <-${2:chan1} - ${0} -} -endsnippet - -# struct -snippet st "type T struct { ... }" -type ${1:Type} struct { - ${0} -} -endsnippet - -# switch -snippet switch "switch x { ... }" -switch ${1:var} { -case ${2:value1}: - ${0} -} -endsnippet - -snippet tswitch "type switch x { ... }" -switch ${2:$1 := }${1:v}.(type) { - ${0} -} -endsnippet - -# sprintf -snippet sp "fmt.Sprintf(...)" -fmt.Sprintf("%${1:s}", ${2:var}) -endsnippet - -# goroutine named function -snippet go "go someFunc(...)" -go ${1:funcName}(${0}) -endsnippet - -# goroutine anonymous function -snippet gof "go func() { ... }()" -go func() { - ${1:${VISUAL}} -}() -${0} -endsnippet - -# test function -snippet test "func TestXYZ(t *testing.T) { ... }" -func Test${1:Function}(t *testing.T) { - ${0:${VISUAL}} -} -endsnippet - -# test table snippet -snippet tt -var tests = []struct { - name string - expected string - given string -}{ - {"${1}", "${2}", "${3}",}, -} -for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T){ - actual := ${0:${VISUAL}}(tt.given) - if actual != tt.expected { - t.Errorf("$0(%s): expected %s, actual %s", tt.given, tt.expected, actual) - } - - }) -} -endsnippet - - -snippet hf "http.HandlerFunc" -func ${1:handler}(w http.ResponseWriter, r *http.Request) { - ${0:fmt.Fprintf(w, "hello world")} -} -endsnippet - -snippet hhf "mux.HandleFunc" !b -${1:http}.HandleFunc("${2:/}", func(w http.ResponseWriter, r *http.Request) { - ${0:fmt.Fprintf(w, "hello world")} -}) -endsnippet - -# quick test server -snippet tsrv "httptest.NewServer" -ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, ${1:`response`}) -})) -defer ts.Close() - -${0:someUrl} = ts.URL -endsnippet - -# test error handling -snippet ter "if err != nil { t.Errorf(...) }" -if err != nil { - t.Errorf("${0:message}") -} -endsnippet - -# test fatal error -snippet terf "if err != nil { t.Fatalf(...) }" -if err != nil { - t.Fatalf("${0:message}") -} -endsnippet - -snippet example "func ExampleXYZ() { ... }" -func Example${1:Method}() { - ${0:${VISUAL}} - // Output: -} -endsnippet - -snippet benchmark "func BenchmarkXYZ(b *testing.B) { ... }" -func Benchmark${1:Method}(b *testing.B) { - for i := 0; i < b.N; i++ { - ${0:${VISUAL}} - } -} -endsnippet - -# variable declaration -snippet var "var x Type [= ...]" -var ${1:x} ${2:Type}${3: = ${0:value}} -endsnippet - -# variables declaration -snippet vars "var ( ... )" -var ( - ${1:x} ${2:Type}${3: = ${0:value}} -) -endsnippet - -# equals fails the test if exp is not equal to act. -snippet eq "equals: test two identifiers with DeepEqual" -if !reflect.DeepEqual(${1:expected}, ${2:actual}) { - _, file, line, _ := runtime.Caller(0) - fmt.Printf("%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\n\n", filepath.Base(file), line, $1, $2) - t.FailNow() -} -endsnippet - -global !p - -import re - -# Automatically wrap return types with parentheses - -def return_values(s): - # remove everything wrapped in parentheses - s = re.sub("\(.*?\)|\([^)]*$", "", s) - return len(s.split(",")) - -def opening_par(snip, pos): - if return_values(t[pos]) > 1 and not t[pos].startswith("("): - snip.rv = "(" - else: - snip.rv = "" - -def closing_par(snip, pos): - if return_values(t[pos]) > 1: - snip.rv = ")" - else: - snip.rv = "" - -endglobal - -# vim:ft=snippets: diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_eq b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_eq deleted file mode 100644 index 9e8fad09..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_eq +++ /dev/null @@ -1,3 +0,0 @@ -if !reflect.DeepEqual({{+got+}}, {{+want+}}) { - t.Errorf("\ngot: %#v\nwant: %#v\n", {{+~\~2+}}, {{+~\~2+}}) -} diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_err b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_err deleted file mode 100644 index 3a5a4930..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_err +++ /dev/null @@ -1,3 +0,0 @@ -if err != nil { - return {{+err+}} -} diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_errt b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_errt deleted file mode 100644 index c5cb6fc3..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_errt +++ /dev/null @@ -1,4 +0,0 @@ -if err != nil { - t.Fatal(err) -} -{{++}} diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_errw b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_errw deleted file mode 100644 index d1958d5b..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_errw +++ /dev/null @@ -1,3 +0,0 @@ -if err != nil { - return errors.Wrap(err, "{{++}}") -} diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_f b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_f deleted file mode 100644 index 6e35d249..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_f +++ /dev/null @@ -1,3 +0,0 @@ -// {{++}} -func {{+~\~1+}}() { -} diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_ff b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_ff deleted file mode 100644 index ed942c22..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_ff +++ /dev/null @@ -1 +0,0 @@ -fmt.Printf("%#v\n", {{++}}) diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_fori b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_fori deleted file mode 100644 index 8a52ec91..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_fori +++ /dev/null @@ -1,3 +0,0 @@ -for i := 0; i < {{++}}; i++ { - {{++}} -} diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_pkg b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_pkg deleted file mode 100644 index 2491d9a9..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_pkg +++ /dev/null @@ -1,2 +0,0 @@ -// Package {{+~expand('%:p:h:t')+}} {{++}} -package {{+~\~2+}} diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_sp b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_sp deleted file mode 100644 index b392681f..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_sp +++ /dev/null @@ -1,2 +0,0 @@ -fmt.Sprintf("{{++}}", {{++}}) - diff --git a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_tt b/vim-config/plugins/vim-go/gosnippets/minisnip/_go_tt deleted file mode 100644 index 602e017d..00000000 --- a/vim-config/plugins/vim-go/gosnippets/minisnip/_go_tt +++ /dev/null @@ -1,17 +0,0 @@ -var tests = []struct { - name string - expected string - given string -}{ - {"", "", "",}, -} -for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T){ - actual := {{++}}(tt.given) - if actual != tt.expected { - t.Errorf("{{+~\~1+}}(%s): expected %s, actual %s", tt.given, tt.expected, actual) - } - - }) -} diff --git a/vim-config/plugins/vim-go/gosnippets/snippets/go.snip b/vim-config/plugins/vim-go/gosnippets/snippets/go.snip deleted file mode 100644 index 3235fb46..00000000 --- a/vim-config/plugins/vim-go/gosnippets/snippets/go.snip +++ /dev/null @@ -1,401 +0,0 @@ -# shorthand variable declaration -snippet : -abbr v := value - ${1} := ${0} -# anonymous function -snippet anon -abbr fn := func() { ... } - ${1:fn} := func() { - ${0} - } -# append -snippet ap -abbr append(slice, value) - append(${1:slice}, ${0:value}) -# append assign -snippet ap= -abbr slice = append(slice, value) - ${1:slice} = append($1, ${0:value}) -# break -snippet br -abbr break - break -# channel -snippet ch -abbr chan Type - chan ${0:int} -# case -snippet case -abbr case ...: - case ${1:value}: - ${0} -# constant -snippet con -abbr const XXX Type = ... - const ${1:NAME} ${2:Type} = ${0:0} -# constants -snippet cons -abbr const ( ... ) - const ( - ${1:NAME} ${2:Type} = ${3:value} - ${0} - ) -# constants with iota -snippet iota -abbr const ( ... = iota ) - const ( - ${1:NAME} ${2:Type} = iota - ${0} - ) -# continue -snippet cn -abbr continue - continue -# default case -snippet default -abbr default: ... - default: - ${0} - -# defer -snippet df -abbr defer someFunction() - defer ${1:func}(${2}) - ${0} -snippet def -abbr defer func() { ... } - defer func() { - ${0} - }() -# defer recover -snippet defr - defer func() { - if err := recover(); err != nil { - ${0} - } - }() -# gpl -snippet gpl - /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Copyright (C) ${1:Author}, `strftime("%Y")` - */ - - ${0} -# import -snippet import -abbr import ( ... ) - import ( - "${1:package}" - ) -# full interface snippet -snippet interface -abbr interface I { ... } - type ${1:Interface} interface { - ${2:/* TODO: add methods */} - } -# if condition -snippet if -abbr if ... { ... } - if ${1:condition} { - ${0} - } -# else snippet -abbr else { ... } -snippet else - else { - ${0} - } - -# if inline error -snippet ife -abbr if err := ...; err != nil { ... } - if err := ${1:condition}; err != nil { - ${0} - } - -# error snippet -snippet errn -abbr if err != nil { return err } - if err != nil { - return err - } - ${0} -# error snippet in TestFunc -snippet errt -abbr if err != nil { t.Fatal(err) } - if err != nil { - t.Fatal(err) - } - -# error snippet in log.Fatal -snippet errl -abbr if err != nil { log.Fatal(err) } - if err != nil { - log.Fatal(err) - } - -# error snippet with two return values -snippet errn, -abbr if err != nil { return [...], err } - if err != nil { - return ${1:nil}, err - } - ${0} - -# error snippet handle and return -snippet errh -abbr if err != nil { ... return } - if err != nil { - ${1} - return - } - ${0} - -# error snippet with panic -snippet errp -abbr if err != nil { panic(...) } - if err != nil { - panic(${1}) - } - ${0} - -# json snippet -snippet json -abbr \`json:key\` - \`json:"${1:keyName}"\` - -# yaml snippet -snippet yaml -abbr \`yaml:key\` - \`yaml:"${1:keyName}"\` - -# fallthrough -snippet ft -abbr fallthrough - fallthrough -# for loop -snippet for -abbr for ... { ... } - for ${1} { - ${0} - } -# for integer loop -snippet fori -abbr for 0..N-1 { ... } - for ${1:i} := 0; $1 < ${2:N}; $1++ { - ${0} - } -# for range loop -snippet forr -abbr for k, v := range items { ... } - for ${2:k}, ${3:v} := range ${1} { - ${0} - } -# function -snippet func -abbr func function(...) [error] { ... } - func ${1:function}(${2}) ${3:error }{ - ${0} - } -# Fmt Printf debug -snippet ff -abbr fmt.Printf(...) - fmt.Printf("${1} = %+v\n", $1) - ${0} -# Fmt Println debug -snippet fn -abbr fmt.Println(...) - fmt.Println("${1}") -# Fmt Errorf -snippet fe -abbr fmt.Errorf(...) - fmt.Errorf("${1}") -# log printf -snippet lf -abbr log.Printf(...) - log.Printf("${1} = %+v\n", $1) -# log println -snippet ln -abbr log.Println(...) - log.Println("${1}") -# make -snippet make -abbr make(Type, size) - make(${1:[]string}, ${2:0})${0} -# map -snippet map -abbr map[Type]Type - map[${1:string}]${0:int} -# main() -snippet main -abbr func main() { ... } -options head - func main() { - ${0} - } -# method -snippet meth -abbr func (self Type) Method(...) [error] { ... } -regexp /^meth/ - func (${1:self} ${2:Type}) ${3:Do}(${4}) ${5:error }{ - ${0} - } -# ok -snippet ok -abbr if !ok { ... } - if !ok { - ${0} - } -# package -snippet package -abbr package ... - // Package $1 provides ${2:...} - package ${1:main} - ${0} -# panic -snippet panic -alias pn -abbr panic("...") - panic("${0}") -# return -snippet return -alias rt -abbr return ... - return ${0} -# select -snippet select -abbr select { case a := <-chan: ... } - select { - case ${1:v1} := <-${2:chan1} - ${0} - } -# struct -snippet st -abbr type T struct { ... } - type ${1:Type} struct { - ${0} - } -# switch -snippet switch -abbr switch x { ... } - switch ${1:var} { - case ${2:value1}: - ${0} - } -# sprintf -snippet sp -abbr fmt.Sprintf(...) - fmt.Sprintf("%${1:s}", ${2:var}) -# goroutine named function -snippet go -abbr go someFunc(...) - go ${1:funcName}(${0}) -# goroutine anonymous function -snippet gof -abbr go func(...) { ... }(...) - go func(${1}) { - ${3:/* TODO */} - }(${2}) -# test function -snippet test -abbr func TestXYZ(t *testing.T) { ... } - func Test${1:Function}(t *testing.T) { - ${0} - } -# test table snippet -snippet tt -abbr var test = {...}{...} for {t.Run(){...}} - var tests = []struct { - name string - expected string - given string - }{ - {"${2}", "${3}", "${4}",}, - } - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T){ - actual := ${1:Function}(tt.given) - if actual != tt.expected { - t.Errorf("given(%s): expected %s, actual %s", tt.given, tt.expected, actual) - } - }) - } -# test server -snippet tsrv -abbr ts := httptest.NewServer(...) - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, ${1:`response`}) - })) - defer ts.Close() - - //Use testing server url (type string) somewhere - ${0:someUrl} = ts.URL -# test error -snippet ter -abbr if err != nil { t.Errorf(...) } - if err != nil { - t.Errorf("${1}") - } -# test fatal error -snippet terf -abbr if err != nil { t.Fatalf(...) } - if err != nil { - t.Fatalf("${1}") - } -# test example -snippet example - func Example${1:Method}() { - ${0} - // Output: - } -# test benchmark -snippet benchmark - func Benchmark${1:Method}(b *testing.B) { - for i := 0; i < b.N; i++ { - ${0} - } - } -# variable declaration -snippet var -abbr var x Type [= ...] - var ${1:x} ${2:Type}${3: = ${0:value\}} -# variables declaration -snippet vars -abbr var ( ... ) - var ( - ${1:x} ${2:Type}${3: = ${0:value\}} - ) -# equals fails the test if exp is not equal to act. -snippet eq -abbr equals: test two identifiers with DeepEqual - if !reflect.DeepEqual(${1:expected}, ${2:actual}) { - _, file, line, _ := runtime.Caller(0) - fmt.Printf("%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\n\n", filepath.Base(file), line, $1, $2) - t.FailNow() - } - -snippet hf -abbr http.HandlerFunc - func ${1:handler}(w http.ResponseWriter, r *http.Request) { - ${0:fmt.Fprintf(w, "hello world")} - } - -snippet hhf -abbr mux.HandleFunc(...) - ${1:http}.HandleFunc("${2:/}", func(w http.ResponseWriter, r *http.Request) { - ${0:fmt.Fprintf(w, "hello world")} - }) diff --git a/vim-config/plugins/vim-go/indent/go.vim b/vim-config/plugins/vim-go/indent/go.vim deleted file mode 100644 index 4c3ea042..00000000 --- a/vim-config/plugins/vim-go/indent/go.vim +++ /dev/null @@ -1,86 +0,0 @@ -" Copyright 2011 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" indent/go.vim: Vim indent file for Go. -" -" TODO: -" - function invocations split across lines -" - general line splits (line ends in an operator) - -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -" C indentation is too far off useful, mainly due to Go's := operator. -" Let's just define our own. -setlocal nolisp -setlocal autoindent -setlocal indentexpr=GoIndent(v:lnum) -setlocal indentkeys+=<:>,0=},0=) - -if exists("*GoIndent") - finish -endif - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! GoIndent(lnum) abort - let prevlnum = prevnonblank(a:lnum-1) - if prevlnum == 0 - " top of file - return 0 - endif - - " grab the previous and current line, stripping comments. - let prevl = substitute(getline(prevlnum), '//.*$', '', '') - let thisl = substitute(getline(a:lnum), '//.*$', '', '') - let previ = indent(prevlnum) - - let ind = previ - - for synid in synstack(a:lnum, 1) - if synIDattr(synid, 'name') == 'goRawString' - if prevl =~ '\%(\%(:\?=\)\|(\|,\)\s*`[^`]*$' - " previous line started a multi-line raw string - return 0 - endif - " return -1 to keep the current indent. - return -1 - endif - endfor - - if prevl =~ '[({]\s*$' - " previous line opened a block - let ind += shiftwidth() - endif - if prevl =~# '^\s*\(case .*\|default\):$' - " previous line is part of a switch statement - let ind += shiftwidth() - endif - " TODO: handle if the previous line is a label. - - if thisl =~ '^\s*[)}]' - " this line closed a block - let ind -= shiftwidth() - endif - - " Colons are tricky. - " We want to outdent if it's part of a switch ("case foo:" or "default:"). - " We ignore trying to deal with jump labels because (a) they're rare, and - " (b) they're hard to disambiguate from a composite literal key. - if thisl =~# '^\s*\(case .*\|default\):$' - let ind -= shiftwidth() - endif - - return ind -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/indent/gohtmltmpl.vim b/vim-config/plugins/vim-go/indent/gohtmltmpl.vim deleted file mode 100644 index 8cc544a2..00000000 --- a/vim-config/plugins/vim-go/indent/gohtmltmpl.vim +++ /dev/null @@ -1,54 +0,0 @@ -if exists("b:did_indent") - finish -endif - -runtime! indent/html.vim - -" Indent Golang HTML templates -setlocal indentexpr=GetGoHTMLTmplIndent(v:lnum) -setlocal indentkeys+==else,=end - -" Only define the function once. -if exists("*GetGoHTMLTmplIndent") - finish -endif - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! GetGoHTMLTmplIndent(lnum) - " Get HTML indent - if exists('*HtmlIndent') - let ind = HtmlIndent() - else - let ind = HtmlIndentGet(a:lnum) - endif - - " The value of a single shift-width - if exists('*shiftwidth') - let sw = shiftwidth() - else - let sw = &sw - endif - - " If need to indent based on last line - let last_line = getline(a:lnum-1) - if last_line =~ '^\s*{{-\=\s*\%(if\|else\|range\|with\|define\|block\).*}}' - let ind += sw - endif - - " End of FuncMap block - let current_line = getline(a:lnum) - if current_line =~ '^\s*{{-\=\s*\%(else\|end\).*}}' - let ind -= sw - endif - - return ind -endfunction - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/plugin/go.vim b/vim-config/plugins/vim-go/plugin/go.vim deleted file mode 100644 index 8a7a0d98..00000000 --- a/vim-config/plugins/vim-go/plugin/go.vim +++ /dev/null @@ -1,309 +0,0 @@ -" install necessary Go tools -if exists("g:go_loaded_install") - finish -endif -let g:go_loaded_install = 1 - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -function! s:checkVersion() abort - let l:unsupported = 0 - if go#config#VersionWarning() != 0 - if has('nvim') - let l:unsupported = !has('nvim-0.4.0') - else - let l:unsupported = !has('patch-8.0.1453') - endif - - if l:unsupported == 1 - echohl Error - echom "vim-go requires at least Vim 8.0.1453 or Neovim 0.4.0, but you're using an older version." - echom "Please update your Vim for the best vim-go experience." - echom "If you really want to continue you can set this to make the error go away:" - echom " let g:go_version_warning = 0" - echom "Note that some features may error out or behave incorrectly." - echom "Please do not report bugs unless you're using at least Vim 8.0.1453 or Neovim 0.3.2." - echohl None - - " Make sure people see this. - sleep 2 - endif - endif -endfunction - -call s:checkVersion() - -" these packages are used by vim-go and can be automatically installed if -" needed by the user with GoInstallBinaries. - -" NOTE(bc): varying the binary name and the tail of the import path does not yet work in module aware mode. -let s:packages = { - \ 'asmfmt': ['github.com/klauspost/asmfmt/cmd/asmfmt@master'], - \ 'dlv': ['github.com/go-delve/delve/cmd/dlv@master'], - \ 'errcheck': ['github.com/kisielk/errcheck@master'], - \ 'fillstruct': ['github.com/davidrjenni/reftools/cmd/fillstruct@master'], - \ 'godef': ['github.com/rogpeppe/godef@master'], - \ 'goimports': ['golang.org/x/tools/cmd/goimports@master'], - \ 'golint': ['golang.org/x/lint/golint@master'], - \ 'gopls': ['golang.org/x/tools/gopls@latest', {}, {'after': function('go#lsp#Restart', [])}], - \ 'golangci-lint': ['github.com/golangci/golangci-lint/cmd/golangci-lint@master'], - \ 'gomodifytags': ['github.com/fatih/gomodifytags@master'], - \ 'gorename': ['golang.org/x/tools/cmd/gorename@master'], - \ 'gotags': ['github.com/jstemmer/gotags@master'], - \ 'guru': ['golang.org/x/tools/cmd/guru@master'], - \ 'impl': ['github.com/josharian/impl@master'], - \ 'keyify': ['honnef.co/go/tools/cmd/keyify@master'], - \ 'motion': ['github.com/fatih/motion@master'], - \ 'iferr': ['github.com/koron/iferr@master'], -\ } - -" These commands are available on any filetypes -command! -nargs=* -complete=customlist,s:complete GoInstallBinaries call s:GoInstallBinaries(-1, ) -command! -nargs=* -complete=customlist,s:complete GoUpdateBinaries call s:GoInstallBinaries(1, ) -command! -nargs=? -complete=dir GoPath call go#path#GoPath() - -fun! s:complete(lead, cmdline, cursor) - return filter(keys(s:packages), 'strpart(v:val, 0, len(a:lead)) == a:lead') -endfun - -" GoInstallBinaries downloads and installs binaries defined in s:packages to -" $GOBIN or $GOPATH/bin. GoInstallBinaries will update already installed -" binaries only if updateBinaries = 1. By default, all packages in s:packages -" will be installed, but the set can be limited by passing the desired -" packages in the unnamed arguments. -function! s:GoInstallBinaries(updateBinaries, ...) - let err = s:CheckBinaries() - if err != 0 - return - endif - - if go#path#Default() == "" - call go#util#EchoError('$GOPATH is not set and `go env GOPATH` returns empty') - return - endif - - let go_bin_path = go#path#BinPath() - - " change $GOBIN so go get can automatically install to it - let Restore_gobin = go#util#SetEnv('GOBIN', go_bin_path) - - " vim's executable path is looking in PATH so add our go_bin path to it - let Restore_path = go#util#SetEnv('PATH', go_bin_path . go#util#PathListSep() . $PATH) - - " when shellslash is set on MS-* systems, shellescape puts single quotes - " around the output string. cmd on Windows does not handle single quotes - " correctly. Unsetting shellslash forces shellescape to use double quotes - " instead. - let resetshellslash = 0 - if has('win32') && &shellslash - let resetshellslash = 1 - set noshellslash - endif - - let l:get_base_cmd = ['go', 'get', '-v'] - - " Filter packages from arguments (if any). - let l:packages = {} - if a:0 > 0 - for l:bin in a:000 - let l:pkg = get(s:packages, l:bin, []) - if len(l:pkg) == 0 - call go#util#EchoError('unknown binary: ' . l:bin) - return - endif - let l:packages[l:bin] = l:pkg - endfor - else - let l:packages = s:packages - endif - - let l:platform = '' - if go#util#IsWin() - let l:platform = 'windows' - endif - - let l:oldmore = &more - let &more = 0 - - for [l:binary, l:pkg] in items(l:packages) - let l:importPath = l:pkg[0] - - " TODO(bc): how to support this with modules? Do we have to clone and then - " install manually? Probably not. I suspect that we can just use GOPATH - " mode and then do the legacy method. - let bin_setting_name = "go_" . l:binary . "_bin" - - if exists("g:{bin_setting_name}") - let bin = g:{bin_setting_name} - else - if go#util#IsWin() - let bin = l:binary . '.exe' - else - let bin = l:binary - endif - endif - - if !executable(bin) || a:updateBinaries == 1 - if a:updateBinaries == 1 - echo "vim-go: Updating " . l:binary . ". Reinstalling ". importPath . " to folder " . go_bin_path - else - echo "vim-go: ". l:binary ." not found. Installing ". importPath . " to folder " . go_bin_path - endif - - if l:importPath =~ "@" - let Restore_modules = go#util#SetEnv('GO111MODULE', 'on') - let l:tmpdir = go#util#tempdir('vim-go') - let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let l:dir = getcwd() - try - execute l:cd . fnameescape(l:tmpdir) - let l:get_cmd = copy(l:get_base_cmd) - - if len(l:pkg) > 1 && get(l:pkg[1], l:platform, []) isnot [] - let l:get_cmd += get(l:pkg[1], l:platform, []) - endif - - " TODO(bc): how to install the bin to a different name than the - " binary path? go get does not support -o - " let l:get_cmd += ['-o', printf('%s%s%s', go_bin_path, go#util#PathSep(), bin)] - - let [l:out, l:err] = go#util#Exec(l:get_cmd + [l:importPath]) - if l:err - call go#util#EchoError(printf('Error installing %s: %s', l:importPath, l:out)) - endif - - call call(Restore_modules, []) - finally - execute l:cd . fnameescape(l:dir) - endtry - call call(Restore_modules, []) - else - let l:get_cmd = copy(l:get_base_cmd) - let l:get_cmd += ['-d'] - if get(g:, "go_get_update", 1) != 0 - let l:get_cmd += ['-u'] - endif - - let Restore_modules = go#util#SetEnv('GO111MODULE', 'off') - - " first download the binary - let [l:out, l:err] = go#util#Exec(l:get_cmd + [l:importPath]) - if l:err - call go#util#EchoError(printf('Error downloading %s: %s', l:importPath, l:out)) - endif - - " and then build and install it - let l:build_cmd = ['go', 'build'] - if len(l:pkg) > 1 && get(l:pkg[1], l:platform, []) isnot [] - let l:build_cmd += get(l:pkg[1], l:platform, []) - endif - let l:build_cmd += ['-o', printf('%s%s%s', go_bin_path, go#util#PathSep(), bin), l:importPath] - - let [l:out, l:err] = go#util#Exec(l:build_cmd) - if l:err - call go#util#EchoError(printf('Error installing %s: %s', l:importPath, l:out)) - endif - - call call(Restore_modules, []) - endif - - if len(l:pkg) > 2 - call call(get(l:pkg[2], 'after', function('s:noop', [])), []) - endif - endif - endfor - - " restore back! - call call(Restore_path, []) - call call(Restore_gobin, []) - - if resetshellslash - set shellslash - endif - - if a:updateBinaries == 1 - call go#util#EchoInfo('updating finished!') - else - call go#util#EchoInfo('installing finished!') - endif - - let &more = l:oldmore -endfunction - -" CheckBinaries checks if the necessary binaries to install the Go tool -" commands are available. -function! s:CheckBinaries() - if !executable('go') - call go#util#EchoError('go executable not found.') - return -1 - endif - - if !executable('git') - call go#util#EchoError('git executable not found.') - return -1 - endif -endfunction - -" Autocommands -" ============================================================================ -" - -" We take care to preserve the user's fileencodings and fileformats, -" because those settings are global (not buffer local), yet we want -" to override them for loading Go files, which are defined to be UTF-8. -let s:current_fileformats = '' -let s:current_fileencodings = '' - -" define fileencodings to open as utf-8 encoding even if it's ascii. -function! s:gofiletype_pre() - let s:current_fileformats = &g:fileformats - let s:current_fileencodings = &g:fileencodings - set fileencodings=utf-8 fileformats=unix -endfunction - -" restore fileencodings as others -function! s:gofiletype_post() - let &g:fileformats = s:current_fileformats - let &g:fileencodings = s:current_fileencodings -endfunction - -function! s:register() - if !(&modifiable && expand('') ==# 'go') - return - endif - - let l:RestoreGopath = function('s:noop') - if go#config#AutodetectGopath() - let l:RestoreGopath = go#util#SetEnv('GOPATH', go#path#Detect()) - endif - call go#lsp#DidOpen(expand(':p')) - call call(l:RestoreGopath, []) -endfunction - -function! s:noop(...) abort -endfunction - -augroup vim-go - autocmd! - - autocmd BufNewFile *.go if &modifiable | setlocal fileencoding=utf-8 fileformat=unix | endif - autocmd BufNewFile *.go call go#auto#template_autocreate() - autocmd BufRead *.go call s:gofiletype_pre() - autocmd BufReadPost *.go call s:gofiletype_post() - - autocmd BufNewFile *.s if &modifiable | setlocal fileencoding=utf-8 fileformat=unix | endif - autocmd BufRead *.s call s:gofiletype_pre() - autocmd BufReadPost *.s call s:gofiletype_post() - - if go#util#has_job() - autocmd FileType * call s:register() - endif -augroup end - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/rplugin/python3/denite/source/decls.py b/vim-config/plugins/vim-go/rplugin/python3/denite/source/decls.py deleted file mode 100644 index 68651a87..00000000 --- a/vim-config/plugins/vim-go/rplugin/python3/denite/source/decls.py +++ /dev/null @@ -1,93 +0,0 @@ -# ============================================================================ -# FILE: decls.py -# AUTHOR: delphinus -# License: MIT license -# ============================================================================ - -import os -import subprocess -import json -import denite.util -from .base import Base - -DECLS_SYNTAX_HIGHLIGHT = [ - {'name': 'FilePath', 're': r'[^:]*\ze:', 'link': 'Comment'}, - {'name': 'Line', 're': r'\d\+\ze :', 'link': 'LineNr'}, - {'name': 'WholeFunction', 're': r'\vfunc %(\([^)]+\) )?[^(]+'}, - {'name': 'Function', 'parent': 'WholeFunction', - 're': r'\S\+\ze(', 'link': 'Function'}, - {'name': 'WholeType', 're': r'type \S\+'}, - {'name': 'Type', 'parent': 'WholeType', - 're': r'\v( )@<=\S+', 'link': 'Type'}, - {'name': 'Separator', 're': r':', 'conceal': True}, - {'name': 'SeparatorFunction', 'parent': 'WholeFunction', - 're': r'func ', 'conceal': True}, - {'name': 'SeparatorType', 'parent': 'WholeType', - 're': r'type ', 'conceal': True}, - ] - -class Source(Base): - - def __init__(self, vim): - super().__init__(vim) - - self.name = 'decls' - self.kind = 'file' - - def gather_candidates(self, context): - bin_path = self.vim.call('go#path#CheckBinPath', 'motion') - if bin_path == '': - return [] - - expand = context['args'][0] if context['args'] else '%:p:h' - target = self.vim.funcs.expand(expand) - - if os.path.isdir(target): - mode = 'dir' - elif os.path.isfile(target): - mode = 'file' - else: - return [] - - if self.vim.funcs.exists('g:go_decls_includes'): - include = self.vim.eval('g:go_decls_includes') - else: - include = 'func,type' - - command = [bin_path, '-mode', 'decls', '-include', include, - '-' + mode, target] - - try: - cmd = subprocess.run(command, stdout=subprocess.PIPE, check=True) - except subprocess.CalledProcessError as err: - denite.util.error(self.vim, - 'command returned invalid response: ' + str(err)) - return [] - - txt = cmd.stdout.decode('utf-8') - output = json.loads(txt, encoding='utf-8') - - def make_candidates(row): - name = self.vim.funcs.fnamemodify(row['filename'], ':~:.') - return { - 'word': '{0} :{1} :{2}'.format(name, row['line'], row['full']), - 'action__path': row['filename'], - 'action__line': row['line'], - 'action__col': row['col'], - } - return list(map(make_candidates, output['decls'])) - - def highlight(self): - for syn in DECLS_SYNTAX_HIGHLIGHT: - containedin = self.syntax_name - containedin += '_' + syn['parent'] if 'parent' in syn else '' - conceal = ' conceal' if 'conceal' in syn else '' - - self.vim.command( - 'syntax match {0}_{1} /{2}/ contained containedin={3}{4}' - .format(self.syntax_name, syn['name'], syn['re'], - containedin, conceal)) - - if 'link' in syn: - self.vim.command('highlight default link {0}_{1} {2}'.format( - self.syntax_name, syn['name'], syn['link'])) diff --git a/vim-config/plugins/vim-go/scripts/bench-syntax b/vim-config/plugins/vim-go/scripts/bench-syntax deleted file mode 100755 index b4496af5..00000000 --- a/vim-config/plugins/vim-go/scripts/bench-syntax +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# Benchmark the syntax/go.vim file. -# -# The first argument is the Vim version to test (as in run-vim), the rest of the -# agument are g:go_highlight_* settings (without that prefix). You can use "ALL" -# to set all the options. -# - -set -euC -vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd) -cd "$vimgodir" - -if [ -z "${1:-}" ]; then - echo "unknown version: '${1:-}'" - echo "First argument must be 'vim-8.0' or 'nvim'." - exit 1 -fi - -if [ -z "${2:-}" ]; then - echo "file not set" - echo "Second argument must be a Go file to benchmark, as 'filename:linenr'" - exit 1 -fi - -vim=$1 -file="$(echo "$2" | cut -d : -f 1)" -line="$(echo "$2" | cut -d : -f 2)" -if [ -z "$line" -o "$line" = "$file" ]; then - echo "Second argument must be a Go file to benchmark, as 'filename:linenr'" - exit 1 -fi - -shift; shift -export RUNBENCH_SETTINGS=$@ -export RUNBENCH_OUT="$(mktemp -p "${TMPDIR:-/tmp}" vimgo-bench.XXXXX)" - -"$vimgodir/scripts/run-vim" $vim \ - +"silent e $file" \ - +"normal! ${line}G" \ - -S ./scripts/runbench.vim - -echo "Report written to:" -echo "$RUNBENCH_OUT" diff --git a/vim-config/plugins/vim-go/scripts/docker-test b/vim-config/plugins/vim-go/scripts/docker-test deleted file mode 100755 index f92ec42a..00000000 --- a/vim-config/plugins/vim-go/scripts/docker-test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# Run all tests inside a Docker container -# - -set -euC -vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd) -cd "$vimgodir" - -docker build --tag vim-go-test . -# seccomp=confined is required for dlv to run in a container, hence it's -# required for vim-go's debug tests. -docker run -e VIMS --rm --security-opt="seccomp=unconfined" vim-go-test - -# vim:ts=2:sts=2:sw=2:et diff --git a/vim-config/plugins/vim-go/scripts/install-vim b/vim-config/plugins/vim-go/scripts/install-vim deleted file mode 100755 index 1d5cebed..00000000 --- a/vim-config/plugins/vim-go/scripts/install-vim +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# -# Install and setup a Vim or Neovim for running tests. -# This should work on both Travis and people's desktop computers, and be 100% -# independent from any system installed Vim. -# -# It will echo the full path to a Vim binary, e.g.: -# /some/path/src/vim - -set -euC - -vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd) -cd "$vimgodir" - -vim=${1:-} - -case "$vim" in - "vim-8.0") - # This follows the version in Ubuntu LTS. Vim's master branch isn't always - # stable, and we don't want to have the build fail because Vim introduced a - # bug. - tag="v8.0.1453" - giturl="https://github.com/vim/vim" - ;; - - "vim-8.2") - # This is the version that's installed by homebrew currently. It doesn't - # have to stay up to date with homebrew, and is only chosen here because - # that's what homebrew was using at the the time and we need a version to - # vimlint with. - tag="v8.2.0200" - giturl="https://github.com/vim/vim" - ;; - - "nvim") - # Use latest stable version. - tag="v0.4.0" - giturl="https://github.com/neovim/neovim" - ;; - - *) - echo "unknown version: '${1:-}'" - echo "First argument must be 'vim-8.0', vim-8.2, or 'nvim'." - exit 1 - ;; -esac - -srcdir="/tmp/vim-go-test/$1-src" -installdir="/tmp/vim-go-test/$1-install" - -# Use cached installdir. -if [ -d "$installdir" ]; then - echo "$installdir exists; skipping build." - - # The ./scripts/test script relies on this. - echo "installed to: $installdir" - exit 0 -fi - -mkdir -p "$srcdir" -cd "$srcdir" - -# Neovim build requires more deps than Vim and is annoying, so we use the -# binary. -# 0.2.0 doesn't have a binary build for Linux, so we use 0.2.1-dev for now. -if [ "$1" = "nvim" ]; then - - # TODO: Use macOS binaries on macOS - curl -Ls https://github.com/neovim/neovim/releases/download/$tag/nvim-linux64.tar.gz | - tar xzf - -C /tmp/vim-go-test/ - mv /tmp/vim-go-test/nvim-linux64 /tmp/vim-go-test/nvim-install - mkdir -p "$installdir/share/nvim/runtime/pack/vim-go/start" - ln -s "$vimgodir" "$installdir/share/nvim/runtime/pack/vim-go/start/vim-go" - - # Consistent paths makes calling things easier. - mv "$installdir/bin/nvim" "$installdir/bin/vim" - mkdir -p "$installdir/share/vim/vimgo/pack" - ln -s "$installdir/share/nvim/runtime/pack/vim-go" "$installdir/share/vim/vimgo/pack/vim-go" - -# Build Vim from source. -else - if [ -d "$srcdir/.git" ]; then - echo "Skipping clone as $srcdir/.git exists" - else - echo "Cloning $tag from $giturl" - git clone --branch "$tag" --depth 1 "$giturl" "$srcdir" - fi - - ./configure --prefix="$installdir" --with-features=huge --disable-gui - make install - mkdir -p "$installdir/share/vim/vimgo/pack/vim-go/start" - ln -s "$vimgodir" "$installdir/share/vim/vimgo/pack/vim-go/start/vim-go" -fi - -# Make sure all Go tools and other dependencies are installed. -echo "Installing Go binaries" -export GOPATH=$installdir -export GO111MODULE=off -export PATH=${GOPATH}/bin:$PATH -"$vimgodir/scripts/run-vim" $vim +':silent :GoUpdateBinaries' +':qa' - -echo "Installing lint tools" -( - mkdir -p "$installdir/share/vim/vimgo/pack/vim-go/start/" - cd "$installdir/share/vim/vimgo/pack/vim-go/start/" - [ -d "vim-vimhelplint" ] || git clone --depth 1 --quiet https://github.com/machakann/vim-vimhelplint - [ -d "vim-vimlparser" ] || git clone --depth 1 --quiet https://github.com/ynkdir/vim-vimlparser - [ -d "vim-vimlint" ] || git clone --depth 1 --quiet https://github.com/syngan/vim-vimlint -) - -# Don't really need source after successful install. -rm -rf "$srcdir" - -echo "installed to: $installdir" - -# vim:ts=2:sts=2:sw=2:et diff --git a/vim-config/plugins/vim-go/scripts/lint b/vim-config/plugins/vim-go/scripts/lint deleted file mode 100755 index fd067252..00000000 --- a/vim-config/plugins/vim-go/scripts/lint +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# Run all linting tools. -# - -set -euC -vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd) -cd "$vimgodir" - -### Setup Vim and other dependencies. -##################################### -if [ -z "${1:-}" ]; then - echo "unknown version: '${1:-}'" - echo "First argument must be 'vim-8.0' or 'nvim'." - exit 1 -fi - -vim=$1 -vimdir="/tmp/vim-go-test/$vim-install" -export GOPATH=$vimdir -export PATH=${GOPATH}/bin:$PATH - -if [ ! -f "$vimdir/bin/vim" ]; then - echo "$vimdir/bin/vim doesn't exist; did you install it with the install-vim script?" - exit 1 -fi - -### Run vint -############ -failed=0 -printf "Running vint ... " -if [ -x "$(command -v vint)" ]; then - lint=$(vint "$vimgodir" 2>&1 ||:) - if [ -n "$lint" ]; then - echo "FAILED" - echo "$lint" - echo - failed=6 - else - echo "PASSED" - fi -else - echo "SKIPPED" - echo "'vint' binary not found; use 'pip install vim-vint' to install it." -fi - -### Run vim-vimlint -################### -printf "Running vim-vimlint ... " -lint=$(sh "$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimlint/bin/vimlint.sh" \ - -p "$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimlparser" \ - -l "$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimlint" \ - -u \ - -c func_abort=1 \ - -e EVL110=1 -e EVL103=1 -e EVL104=1 -e EVL102=1 \ - "$vimgodir" \ - 2>&1 ||:) -if [ -n "$lint" ]; then - echo "FAILED" - echo "$lint" - echo - failed=6 -else - echo "PASSED" -fi - -### Run vimhelplint. -#################### -printf "Running vimhelplint ... " - -# set modeline explicitly so that the modeline will be respected when run as root. -lint=$($vimdir/bin/vim -esNR \ - --cmd "set rtp+=$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimhelplint/" \ - --cmd 'set modeline' \ - +'filetype plugin on' \ - +"e $vimgodir/doc/vim-go.txt" \ - +'verbose VimhelpLintEcho' \ - +q \ - 2>&1 ||:) -if [ "$lint" ]; then - echo "FAILED" - echo "$lint" - failed=6 -else - echo "PASSED" -fi - -exit "$failed" diff --git a/vim-config/plugins/vim-go/scripts/run-vim b/vim-config/plugins/vim-go/scripts/run-vim deleted file mode 100755 index f5507eee..00000000 --- a/vim-config/plugins/vim-go/scripts/run-vim +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# Run a "bare" Vim with just vim-go and ignoring ~/.vim -# - -set -euC -vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd) -cd "$vimgodir" - -coverage=0 -while getopts "c" option; do - case "$option" in - c) coverage=1; ;; - esac -done -shift $((OPTIND - 1)) - -if [ -z "${1:-}" ]; then - echo "unknown version: '${1:-}'" - echo "First argument must be 'vim-8.0', 'vim-8.2', or 'nvim'." - exit 1 -fi - -dir="/tmp/vim-go-test/$1-install" -export GOPATH=$dir -export GO111MODULE=auto -export PATH=${GOPATH}/bin:$PATH -shift - -if [ ! -f "$dir/bin/vim" ]; then - echo "$dir/bin/vim doesn't exist; did you install it with the install-vim script?" - exit 1 -fi - -if [ $coverage -eq 1 ]; then - covimerage -q run --report-file /tmp/vim-go-test/cov-profile.txt --append \ - $dir/bin/vim --noplugin -u NONE -i NONE -N \ - +"set shm+=WAFI rtp^=$vimgodir packpath=$dir/share/vim/vimgo" \ - +'filetype plugin indent on' \ - +'packloadall!' \ - "$@" -else - $dir/bin/vim --noplugin -u NONE -i NONE -N \ - +"set shm+=WAFI rtp^=$vimgodir packpath=$dir/share/vim/vimgo" \ - +'filetype plugin indent on' \ - +'packloadall!' \ - "$@" -fi - - -# vim:ts=2:sts=2:sw=2:et diff --git a/vim-config/plugins/vim-go/scripts/runbench.vim b/vim-config/plugins/vim-go/scripts/runbench.vim deleted file mode 100644 index e1c6c88a..00000000 --- a/vim-config/plugins/vim-go/scripts/runbench.vim +++ /dev/null @@ -1,37 +0,0 @@ -" vint: -ProhibitSetNoCompatible - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -set nocompatible nomore shellslash encoding=utf-8 shortmess+=WIF -lang mess C - -if $RUNBENCH_SETTINGS is? 'all' - let $RUNBENCH_SETTINGS = join(['array_whitespace_error', 'build_constraints', - \ 'chan_whitespace_error', 'extra_types', 'fields', 'format_strings', - \ 'function_arguments', 'function_calls', 'functions', 'generate_tags', - \ 'operators', 'space_tab_error', 'string_spellcheck', - \ 'trailing_whitespace_error', 'types', 'variable_assignments', - \ 'variable_declarations'], ' ') -endif - -for s:s in split($RUNBENCH_SETTINGS, ' ') - call execute('let g:go_highlight_' . s:s . ' = 1') -endfor - -filetype plugin indent on -syntax on - -syntime on -redraw! -let s:report = execute('syntime report') -execute ':e ' . fnameescape($RUNBENCH_OUT) -call setline('.', split(s:report, '\n')) -wq - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/scripts/runtest.vim b/vim-config/plugins/vim-go/scripts/runtest.vim deleted file mode 100644 index 9567bc75..00000000 --- a/vim-config/plugins/vim-go/scripts/runtest.vim +++ /dev/null @@ -1,137 +0,0 @@ -" Make sure some options are set to sane defaults and output all messages in -" English. - -" vint: -ProhibitSetNoCompatible - -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -set nocompatible nomore shellslash encoding=utf-8 shortmess+=WIF -lang mess C - -" Initialize variables. -let s:total_started = reltime() -let s:fail = 0 -let s:done = 0 -let s:logs = [] -let s:gopath = $GOPATH -if !exists('g:test_verbose') - let g:test_verbose = 0 -endif -let g:go_echo_command_info = 0 - -function! s:logmessages() abort - " Add all messages (usually errors). - redir => s:mess - silent messages - redir END - let s:logs = s:logs + filter(split(s:mess, "\n"), 'v:val !~ "^Messages maintainer"') - silent messages clear -endfunction - -" Source the passed test file. -source % - -" cd into the folder of the test file. -let s:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' -let s:testfile = expand('%:t') -let s:dir = expand('%:p:h') -execute s:cd . s:dir - -" Export root path to vim-go dir. -let g:vim_go_root = fnamemodify(getcwd(), ':p') - -" Get a list of all Test_ functions for the given file. -redir @q - silent function /^Test_ -redir END -let s:tests = split(substitute(@q, 'function \(\k\+()\)', '\1', 'g')) - -" log any messages already accumulated. -call s:logmessages() -" Iterate over all tests and execute them. -for s:test in sort(s:tests) - " Since we extract the tests from a regexp the "abort" keyword is also in - " the list, which is not a test name :-) - if s:test == 'abort' - continue - endif - - let s:started = reltime() - if g:test_verbose is 1 - call add(s:logs, printf("=== RUN %s", s:test[:-3])) - endif - try - exe 'call ' . s:test - " sleep to give events a chance to be processed. This is especially - " important for the LSP code to have a chance to run before Vim exits, in - " order to avoid errors trying to write to the gopls channels since Vim - " would otherwise stop gopls before the event handlers were run and result - " in 'stream closed' errors when the events were run _after_ gopls exited. - sleep 50m - catch - let v:errors += [v:exception] - endtry - - let s:elapsed_time = substitute(reltimestr(reltime(s:started)), '^\s*\(.\{-}\)\s*$', '\1', '') - - " Restore GOPATH after each test. - let $GOPATH = s:gopath - " Restore the working directory after each test. - execute s:cd . s:dir - - try - " exit gopls after each test - call go#lsp#Exit() - catch /^Vim(call):E900: Invalid channel id/ - " do nothing - gopls has stopped - endtry - - let s:done += 1 - - if len(v:errors) > 0 - let s:fail += 1 - call add(s:logs, printf("--- FAIL %s (%ss)", s:test[:-3], s:elapsed_time)) - call s:logmessages() - call extend(s:logs, map(v:errors, '" ". v:val')) - - " Reset so we can capture failures of the next test. - let v:errors = [] - else - if g:test_verbose is 1 - call s:logmessages() - call add(s:logs, printf("--- PASS %s (%ss)", s:test[:-3], s:elapsed_time)) - endif - endif -endfor - -" Create an empty fail to indicate that at least one test failed. -if s:fail > 0 - split /tmp/vim-go-test/FAILED - silent write -endif - -let s:total_elapsed_time = substitute(reltimestr(reltime(s:total_started)), '^\s*\(.\{-}\)\s*$', '\1', '') - -" Also store all internal messages from s:logs as well. -silent! split /tmp/vim-go-test/test.tmp -call append(line('$'), s:logs) -call append(line('$'), printf("%s %s %s %ss / %s tests", - \ (s:fail > 0 ? 'FAIL' : 'ok '), - \ s:testfile, - \ repeat(' ', 25 - len(s:testfile)), - \ s:total_elapsed_time, s:done)) -if g:test_verbose is 0 - silent :g/^$/d -endif -silent! write - -" Our work here is done. -qall! - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim:ts=2:sts=2:sw=2:et diff --git a/vim-config/plugins/vim-go/scripts/test b/vim-config/plugins/vim-go/scripts/test deleted file mode 100755 index 77dd9f82..00000000 --- a/vim-config/plugins/vim-go/scripts/test +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh -# -# Run all tests. -# - -set -euC -vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd) -cd "$vimgodir" - -_usage() { - echo "Usage: ${0##*/} [-hvc] [-r file] vim_version" - echo - echo "Options:" - echo " -h Show this help" - echo " -v Enable verbose output" - echo " -r Run only the tests from this file" - echo " -c Generate code coverage reports" - echo " -u Submit code coverage reports" - echo -} - -verbose=0 -run="" -coverage="" -uploadcoverage="" -while getopts "hvcur:" option; do - case "$option" in - h) _usage; exit 0 ;; - v) verbose=1; ;; - r) run=$OPTARG ;; - c) coverage="-c" ;; - u) uploadcoverage=1 ;; - *) - echo "error: unknown option '$option'" - _usage - exit 1 - ;; - esac -done -shift $((OPTIND - 1)) - -### Setup Vim and other dependencies. -##################################### -if [ -z "${1:-}" ]; then - echo "unknown version: '${1:-}'" - echo "First argument must be 'vim-8.0' or 'nvim'." - exit 1 -fi - -vim=$1 -vimdir="/tmp/vim-go-test/$vim-install" -export GOPATH=$vimdir -export PATH=${GOPATH}/bin:$PATH - -if [ ! -f "$vimdir/bin/vim" ]; then - echo "$vimdir/bin/vim doesn't exist; did you install it with the install-vim script?" - exit 1 -fi - -### Run tests. -############## -# Clean stale log file. -[ -f '/tmp/vim-go-test/test.log' ] && rm '/tmp/vim-go-test/test.log' -[ -f '/tmp/vim-go-test/FAILED' ] && rm '/tmp/vim-go-test/FAILED' -[ -f '/tmp/vim-go-test/cov-profile.txt' ] && rm '/tmp/vim-go-test/cov-profile.txt' -[ -f '/tmp/vim-go-test/cov-report.txt' ] && rm '/tmp/vim-go-test/cov-report.txt' - -# Run the actual tests. -find "$vimgodir" -name '*_test.vim' | while read test_file; do - [ -n "$run" -a "$(basename "$test_file")" != "$run" ] && continue - - "$vimgodir/scripts/run-vim" $coverage $vim -e \ - +"silent e $test_file" \ - +"let g:test_verbose=$verbose" \ - +"let g:go_echo_command_info=0" \ - -S ./scripts/runtest.vim < /dev/null || ( - # If Vim exits with non-0 it's almost certainly a bug in the test runner; - # should very rarely happen in normal usage. - echo 'test runner failure' - cat '/tmp/vim-go-test/test.tmp' - rm '/tmp/vim-go-test/test.tmp' - exit 5 - ) - - # Append logs - cat '/tmp/vim-go-test/test.tmp' | tee '/tmp/vim-go-test/test.log' - rm '/tmp/vim-go-test/test.tmp' -done - -echo -if [ -f "/tmp/vim-go-test/FAILED" ]; then - echo 2>&1 "Some ($vim) tests FAILED" - exit 1 -fi -echo 2>&1 "All ($vim) tests PASSED" - -# Generate coverage reports -if [ -n "$coverage" ]; then - coverage xml --omit '*_test.vim' - - if [ -n "$uploadcoverage" ]; then - codecov -X search gcov pycov -f coverage.xml --required \ - --flags "$(echo "$vim" | sed -s 's/[-.]//g')" - rm coverage.xml - fi -fi - -# vim:ts=2:sts=2:sw=2:et diff --git a/vim-config/plugins/vim-go/syntax/go.vim b/vim-config/plugins/vim-go/syntax/go.vim deleted file mode 100644 index 6cf45ddd..00000000 --- a/vim-config/plugins/vim-go/syntax/go.vim +++ /dev/null @@ -1,445 +0,0 @@ -" Copyright 2009 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" go.vim: Vim syntax file for Go. - -" Quit when a (custom) syntax file was already loaded -if exists("b:current_syntax") - finish -endif - -syn case match - -syn keyword goPackage package -syn keyword goImport import contained -syn keyword goVar var contained -syn keyword goConst const contained - -hi def link goPackage Statement -hi def link goImport Statement -hi def link goVar Keyword -hi def link goConst Keyword -hi def link goDeclaration Keyword - -" Keywords within functions -syn keyword goStatement defer go goto return break continue fallthrough -syn keyword goConditional if else switch select -syn keyword goLabel case default -syn keyword goRepeat for range - -hi def link goStatement Statement -hi def link goConditional Conditional -hi def link goLabel Label -hi def link goRepeat Repeat - -" Predefined types -syn keyword goType chan map bool string error -syn keyword goSignedInts int int8 int16 int32 int64 rune -syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr -syn keyword goFloats float32 float64 -syn keyword goComplexes complex64 complex128 - -hi def link goType Type -hi def link goSignedInts Type -hi def link goUnsignedInts Type -hi def link goFloats Type -hi def link goComplexes Type - -" Predefined functions and values -syn keyword goBuiltins append cap close complex copy delete imag len -syn keyword goBuiltins make new panic print println real recover -syn keyword goBoolean true false -syn keyword goPredefinedIdentifiers nil iota - -hi def link goBuiltins Identifier -hi def link goBoolean Boolean -hi def link goPredefinedIdentifiers goBoolean - -" Comments; their contents -syn keyword goTodo contained TODO FIXME XXX BUG -syn cluster goCommentGroup contains=goTodo - -syn region goComment start="//" end="$" contains=goGenerate,@goCommentGroup,@Spell -if go#config#FoldEnable('comment') - syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell fold - syn match goComment "\v(^\s*//.*\n)+" contains=goGenerate,@goCommentGroup,@Spell fold -else - syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell -endif - -hi def link goComment Comment -hi def link goTodo Todo - -if go#config#HighlightGenerateTags() - syn match goGenerateVariables contained /\%(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/ - syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables - hi def link goGenerate PreProc - hi def link goGenerateVariables Special -endif - -" Go escapes -syn match goEscapeOctal display contained "\\[0-7]\{3}" -syn match goEscapeC display contained +\\[abfnrtv\\'"]+ -syn match goEscapeX display contained "\\x\x\{2}" -syn match goEscapeU display contained "\\u\x\{4}" -syn match goEscapeBigU display contained "\\U\x\{8}" -syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ - -hi def link goEscapeOctal goSpecialString -hi def link goEscapeC goSpecialString -hi def link goEscapeX goSpecialString -hi def link goEscapeU goSpecialString -hi def link goEscapeBigU goSpecialString -hi def link goSpecialString Special -hi def link goEscapeError Error - -" Strings and their contents -syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError -if go#config#HighlightStringSpellcheck() - syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell - syn region goRawString start=+`+ end=+`+ contains=@Spell -else - syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup - syn region goRawString start=+`+ end=+`+ -endif - -if go#config#HighlightFormatStrings() - " [n] notation is valid for specifying explicit argument indexes - " 1. Match a literal % not preceded by a %. - " 2. Match any number of -, #, 0, space, or + - " 3. Match * or [n]* or any number or nothing before a . - " 4. Match * or [n]* or any number or nothing after a . - " 5. Match [n] or nothing before a verb - " 6. Match a formatting verb - syn match goFormatSpecifier /\ - \%([^%]\%(%%\)*\)\ - \@<=%[-#0 +]*\ - \%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\ - \%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\ - \%(\[\d\+\]\)\=[vTtbcdoqxXUeEfFgGspw]/ contained containedin=goString,goRawString - hi def link goFormatSpecifier goSpecialString -endif - -hi def link goString String -hi def link goRawString String - -" Characters; their contents -syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU -syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup - -hi def link goCharacter Character - -" Regions -syn region goParen start='(' end=')' transparent -if go#config#FoldEnable('block') - syn region goBlock start="{" end="}" transparent fold -else - syn region goBlock start="{" end="}" transparent -endif - -" import -if go#config#FoldEnable('import') - syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment -else - syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment -endif - -" var, const -if go#config#FoldEnable('varconst') - syn region goVar start='var (' end='^\s*)$' transparent fold - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator - syn region goConst start='const (' end='^\s*)$' transparent fold - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator -else - syn region goVar start='var (' end='^\s*)$' transparent - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator - syn region goConst start='const (' end='^\s*)$' transparent - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator -endif - -" Single-line var, const, and import. -syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst - -" Integers -syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>" -syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>" -syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>" -syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_]\|__\)\S*\|_\)\>" -syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>" -syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>" -syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>" -syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_]\S*\|__\S*\|_\)\>" - -hi def link goDecimalInt Integer -hi def link goDecimalError Error -hi def link goHexadecimalInt Integer -hi def link goHexadecimalError Error -hi def link goOctalInt Integer -hi def link goOctalError Error -hi def link goBinaryInt Integer -hi def link goBinaryError Error -hi def link Integer Number - -" Floating point -syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>" -syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>" - -hi def link goFloat Float - -" Imaginary literals -syn match goImaginary "\<-\=\d\+i\>" -syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>" -syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>" -syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>" - -hi def link goImaginary Number -hi def link goImaginaryFloat Float - -" Spaces after "[]" -if go#config#HighlightArrayWhitespaceError() - syn match goSpaceError display "\%(\[\]\)\@<=\s\+" -endif - -" Spacing errors around the 'chan' keyword -if go#config#HighlightChanWhitespaceError() - " receive-only annotation on chan type - " - " \(\\)\@\)\@\)\@=" - - " send-only annotation on chan type - " - " \(<-\)\@ (only pick chan when it doesn't come after an arrow) - " this prevents picking up '<-chan <-chan' but not 'chan <-' - syn match goSpaceError display "\%(\%(<-\)\@\)\@<=\s\+\%(<-\)\@=" - - " value-ignoring receives in a few contexts - syn match goSpaceError display "\%(\%(^\|[={(,;]\)\s*<-\)\@<=\s\+" -endif - -" Extra types commonly seen -if go#config#HighlightExtraTypes() - syn match goExtraType /\/ - syn match goExtraType /\/ - syn match goExtraType /\/ - syn match goExtraType /\/ - syn match goExtraType /\/ -endif - -" Space-tab error -if go#config#HighlightSpaceTabError() - syn match goSpaceError display " \+\t"me=e-1 -endif - -" Trailing white space error -if go#config#HighlightTrailingWhitespaceError() - syn match goSpaceError display excludenl "\s\+$" -endif - -hi def link goExtraType Type -hi def link goSpaceError Error - - - -" included from: https://github.com/athom/more-colorful.vim/blob/master/after/syntax/go.vim -" -" Comments; their contents -syn keyword goTodo contained NOTE -hi def link goTodo Todo - -syn match goVarArgs /\.\.\./ - -" Operators; -if go#config#HighlightOperators() - " match single-char operators: - + % < > ! & | ^ * = - " and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= == - syn match goOperator /[-+%<>!&|^*=]=\?/ - " match / and /= - syn match goOperator /\/\%(=\|\ze[^/*]\)/ - " match two-char operators: << >> &^ - " and corresponding three-char operators: <<= >>= &^= - syn match goOperator /\%(<<\|>>\|&^\)=\?/ - " match remaining two-char operators: := && || <- ++ -- - syn match goOperator /:=\|||\|<-\|++\|--/ - " match ... - - hi def link goPointerOperator goOperator - hi def link goVarArgs goOperator -endif -hi def link goOperator Operator - -" Functions; -if go#config#HighlightFunctions() || go#config#HighlightFunctionParameters() - syn match goDeclaration /\/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl - syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained - syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl - syn match goFunction /\w\+/ nextgroup=goSimpleParams contained skipwhite skipnl - syn match goReceiverType /\w\+/ contained - if go#config#HighlightFunctionParameters() - syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl - syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl - syn match goParamName /\w\+\%(\s*,\s*\w\+\)*\ze\s\+\%(\w\|\.\|\*\|\[\)/ contained nextgroup=goParamType skipwhite skipnl - syn match goParamType /\%([^,)]\|\_s\)\+,\?/ contained nextgroup=goParamName skipwhite skipnl - \ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock - hi def link goReceiverVar goParamName - hi def link goParamName Identifier - endif - syn match goReceiver /(\s*\w\+\%(\s\+\*\?\s*\w\+\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl -else - syn keyword goDeclaration func -endif -hi def link goFunction Function - -" Function calls; -if go#config#HighlightFunctionCalls() - syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration -endif -hi def link goFunctionCall Type - -" Fields; -if go#config#HighlightFields() - " 1. Match a sequence of word characters coming after a '.' - " 2. Require the following but dont match it: ( \@= see :h E59) - " - The symbols: / - + * % OR - " - The symbols: [] {} <> ) OR - " - The symbols: \n \r space OR - " - The symbols: , : . - " 3. Have the start of highlight (hs) be the start of matched - " pattern (s) offsetted one to the right (+1) (see :h E401) - syn match goField /\.\w\+\ - \%(\%([\/\-\+*%]\)\|\ - \%([\[\]{}<\>\)]\)\|\ - \%([\!=\^|&]\)\|\ - \%([\n\r\ ]\)\|\ - \%([,\:.]\)\)\@=/hs=s+1 -endif -hi def link goField Identifier - -" Structs & Interfaces; -if go#config#HighlightTypes() - syn match goTypeConstructor /\<\w\+{\@=/ - syn match goTypeDecl /\/ nextgroup=goTypeName skipwhite skipnl - syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl - syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl - hi def link goReceiverType Type -else - syn keyword goDeclType struct interface - syn keyword goDeclaration type -endif -hi def link goTypeConstructor Type -hi def link goTypeName Type -hi def link goTypeDecl Keyword -hi def link goDeclType Keyword - -" Variable Assignments -if go#config#HighlightVariableAssignments() - syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&]|\*|\<\<|\>\>|\&\^)?\=[^=])/ - hi def link goVarAssign Special -endif - -" Variable Declarations -if go#config#HighlightVariableDeclarations() - syn match goVarDefs /\v\w+(,\s*\w+)*\ze(\s*:\=)/ - hi def link goVarDefs Special -endif - -" Build Constraints -if go#config#HighlightBuildConstraints() - syn match goBuildKeyword display contained "+build" - " Highlight the known values of GOOS, GOARCH, and other +build options. - syn keyword goBuildDirectives contained - \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 - \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 - \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc - \ s390 s390x sparc sparc64 cgo ignore race - - " Other words in the build directive are build tags not listed above, so - " avoid highlighting them as comments by using a matchgroup just for the - " start of the comment. - " The rs=s+2 option lets the \s*+build portion be part of the inner region - " instead of the matchgroup so it will be highlighted as a goBuildKeyword. - syn region goBuildComment matchgroup=goBuildCommentStart - \ start="//\s*+build\s"rs=s+2 end="$" - \ contains=goBuildKeyword,goBuildDirectives - hi def link goBuildCommentStart Comment - hi def link goBuildDirectives Type - hi def link goBuildKeyword PreProc -endif - -if go#config#HighlightBuildConstraints() || go#config#FoldEnable('package_comment') - " One or more line comments that are followed immediately by a "package" - " declaration are treated like package documentation, so these must be - " matched as comments to avoid looking like working build constraints. - " The he, me, and re options let the "package" itself be highlighted by - " the usual rules. - exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/' - \ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7' - \ . ' contains=@goCommentGroup,@Spell' - \ . (go#config#FoldEnable('package_comment') ? ' fold' : '') - exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage/' - \ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7' - \ . ' contains=@goCommentGroup,@Spell' - \ . (go#config#FoldEnable('package_comment') ? ' fold' : '') - hi def link goPackageComment Comment -endif - -" :GoCoverage commands -hi def link goCoverageNormalText Comment - -function! s:hi() - hi def link goSameId Search - hi def link goDiagnosticError SpellBad - hi def link goDiagnosticWarning SpellRare - - " TODO(bc): is it appropriate to define text properties in a syntax file? - " The highlight groups need to be defined before the text properties types - " are added, and when users have syntax enabled in their vimrc after - " filetype plugin on, the highlight groups won't be defined when - " ftplugin/go.vim is executed when the first go file is opened. - " See https://github.com/fatih/vim-go/issues/2658. - if has('textprop') - if empty(prop_type_get('goSameId')) - call prop_type_add('goSameId', {'highlight': 'goSameId'}) - endif - if empty(prop_type_get('goDiagnosticError')) - call prop_type_add('goDiagnosticError', {'highlight': 'goDiagnosticError'}) - endif - if empty(prop_type_get('goDiagnosticWarning')) - call prop_type_add('goDiagnosticWarning', {'highlight': 'goDiagnosticWarning'}) - endif - endif - - hi def link goDeclsFzfKeyword Keyword - hi def link goDeclsFzfFunction Function - hi def link goDeclsFzfSpecialComment SpecialComment - hi def link goDeclsFzfComment Comment - - " :GoCoverage commands - hi def goCoverageCovered ctermfg=green guifg=#A6E22E - hi def goCoverageUncover ctermfg=red guifg=#F92672 - - " :GoDebug commands - if go#config#HighlightDebug() - hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black - hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White - endif -endfunction - -augroup vim-go-hi - autocmd! - autocmd ColorScheme * call s:hi() -augroup end -call s:hi() - -" Search backwards for a global declaration to start processing the syntax. -"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ - -" There's a bug in the implementation of grouphere. For now, use the -" following as a more expensive/less precise workaround. -syn sync minlines=500 - -let b:current_syntax = "go" - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/syntax/godebugoutput.vim b/vim-config/plugins/vim-go/syntax/godebugoutput.vim deleted file mode 100644 index b8e6f5ff..00000000 --- a/vim-config/plugins/vim-go/syntax/godebugoutput.vim +++ /dev/null @@ -1,13 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -syn match godebugOutputErr '^ERR:.*' -syn match godebugOutputOut '^OUT:.*' - -let b:current_syntax = "godebugoutput" - -hi def link godebugOutputErr Comment -hi def link godebugOutputOut Normal - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/syntax/godebugstacktrace.vim b/vim-config/plugins/vim-go/syntax/godebugstacktrace.vim deleted file mode 100644 index b0c53725..00000000 --- a/vim-config/plugins/vim-go/syntax/godebugstacktrace.vim +++ /dev/null @@ -1,11 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -syn match godebugStacktrace '^\S\+' - -let b:current_syntax = "godebugoutput" - -hi def link godebugStacktrace SpecialKey - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/syntax/godebugvariables.vim b/vim-config/plugins/vim-go/syntax/godebugvariables.vim deleted file mode 100644 index 791705ba..00000000 --- a/vim-config/plugins/vim-go/syntax/godebugvariables.vim +++ /dev/null @@ -1,23 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -syn match godebugTitle '^#.*' -syn match godebugVariables '^\s*\S\+\ze:' - -syn keyword goType chan map bool string error -syn keyword goSignedInts int int8 int16 int32 int64 rune -syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr -syn keyword goFloats float32 float64 -syn keyword goComplexes complex64 complex128 - -syn keyword goBoolean true false - -let b:current_syntax = "godebugvariables" - -hi def link godebugTitle Underlined -hi def link godebugVariables Statement -hi def link goType Type -hi def link goBoolean Boolean - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/syntax/godefstack.vim b/vim-config/plugins/vim-go/syntax/godefstack.vim deleted file mode 100644 index e4eefff4..00000000 --- a/vim-config/plugins/vim-go/syntax/godefstack.vim +++ /dev/null @@ -1,20 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -syn match godefStackComment '^".*' -syn match godefLinePrefix '^[>\s]\s' nextgroup=godefStackEntryNumber contains=godefStackCurrentPosition -syn match godefStackEntryNumber '\d\+' nextgroup=godefStackFilename skipwhite -syn match godefStackCurrentPosition '>' contained -syn match godefStackFilename '[^|]\+' contained nextgroup=godefStackEntryLocation -syn region godefStackEntryLocation oneline start='|' end='|' contained contains=godefStackEntryLocationNumber -syn match godefStackEntryLocationNumber '\d\+' contained display - -let b:current_syntax = "godefstack" - -hi def link godefStackComment Comment -hi def link godefStackCurrentPosition Special -hi def link godefStackFilename Directory -hi def link godefStackEntryLocationNumber LineNr - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/syntax/gohtmltmpl.vim b/vim-config/plugins/vim-go/syntax/gohtmltmpl.vim deleted file mode 100644 index ea3dbf08..00000000 --- a/vim-config/plugins/vim-go/syntax/gohtmltmpl.vim +++ /dev/null @@ -1,17 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -if !exists("g:main_syntax") - let g:main_syntax = 'html' -endif - -runtime! syntax/gotexttmpl.vim -runtime! syntax/html.vim -unlet b:current_syntax - -syn cluster htmlPreproc add=gotplAction,goTplComment - -let b:current_syntax = "gohtmltmpl" - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/syntax/gomod.vim b/vim-config/plugins/vim-go/syntax/gomod.vim deleted file mode 100644 index 7dcef1a8..00000000 --- a/vim-config/plugins/vim-go/syntax/gomod.vim +++ /dev/null @@ -1,92 +0,0 @@ -" gomod.vim: Vim syntax file for go.mod file -" -" Quit when a (custom) syntax file was already loaded -if exists("b:current_syntax") - finish -endif - -syntax case match - -" match keywords -syntax keyword gomodModule module -syntax keyword gomodGo go contained -syntax keyword gomodRequire require -syntax keyword gomodExclude exclude -syntax keyword gomodReplace replace - -" require, exclude, replace, and go can be also grouped into block -syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion -syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion -syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion -syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion - -" set highlights -highlight default link gomodModule Keyword -highlight default link gomodGo Keyword -highlight default link gomodRequire Keyword -highlight default link gomodExclude Keyword -highlight default link gomodReplace Keyword - -" comments are always in form of // ... -syntax region gomodComment start="//" end="$" contains=@Spell -highlight default link gomodComment Comment - -" make sure quoted import paths are higlighted -syntax region gomodString start=+"+ skip=+\\\\\|\\"+ end=+"+ -highlight default link gomodString String - -" replace operator is in the form of '=>' -syntax match gomodReplaceOperator "\v\=\>" -highlight default link gomodReplaceOperator Operator - -" match go versions -syntax match gomodGoVersion "1\.\d\+" contained -highlight default link gomodGoVersion Identifier - - -" highlight versions: -" * vX.Y.Z-pre -" * vX.Y.Z -" * vX.0.0-yyyyymmddhhmmss-abcdefabcdef -" * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef -" * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef -" see https://godoc.org/golang.org/x/tools/internal/semver for more -" information about how semantic versions are parsed and -" https://golang.org/cmd/go/ for how pseudo-versions and +incompatible -" are applied. - - -" match vX.Y.Z and their prereleases -syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?" -" ^--- version ---^^------------ pre-release ---------------------^^--------------- metadata ---------------------^ -" ^--------------------------------------- semantic version -------------------------------------------------------^ - -" match pseudo versions -" without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) -syntax match gomodVersion "v\d\+\.0\.0-\d\{14\}-\x\+" -" when most recent version before target is a pre-release -syntax match gomodVersion "v\d\+\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\+" -" ^--- version ---^^--- ------ pre-release -----------------^^--------------- metadata ---------------------^ -" ^------------------------------------- semantic version --------------------------------------------------^ -" most recent version before the target is X.Y.Z -syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\+" -" ^--- version ---^^--------------- metadata ---------------------^ - -" match incompatible vX.Y.Z and their prereleases -syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?+incompatible" -" ^------- version -------^^------------- pre-release ---------------------^^--------------- metadata ---------------------^ -" ^------------------------------------------- semantic version -----------------------------------------------------------^ - -" match incompatible pseudo versions -" incompatible without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) -syntax match gomodVersion "v[2-9]\{1}\d*\.0\.0-\d\{14\}-\x\++incompatible" -" when most recent version before target is a pre-release -syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\++incompatible" -" ^------- version -------^^---------- pre-release -----------------^^--------------- metadata ---------------------^ -" ^---------------------------------------- semantic version ------------------------------------------------------^ -" most recent version before the target is X.Y.Z -syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\++incompatible" -" ^------- version -------^^---------------- metadata ---------------------^ -highlight default link gomodVersion Identifier - -let b:current_syntax = "gomod" diff --git a/vim-config/plugins/vim-go/syntax/gotexttmpl.vim b/vim-config/plugins/vim-go/syntax/gotexttmpl.vim deleted file mode 100644 index ab8b1b6d..00000000 --- a/vim-config/plugins/vim-go/syntax/gotexttmpl.vim +++ /dev/null @@ -1,85 +0,0 @@ -" Copyright 2011 The Go Authors. All rights reserved. -" Use of this source code is governed by a BSD-style -" license that can be found in the LICENSE file. -" -" gotexttmpl.vim: Vim syntax file for Go templates. - -" Quit when a (custom) syntax file was already loaded -if exists("b:current_syntax") - finish -endif - -syn case match - -" Go escapes -syn match goEscapeOctal display contained "\\[0-7]\{3}" -syn match goEscapeC display contained +\\[abfnrtv\\'"]+ -syn match goEscapeX display contained "\\x\x\{2}" -syn match goEscapeU display contained "\\u\x\{4}" -syn match goEscapeBigU display contained "\\U\x\{8}" -syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ - -hi def link goEscapeOctal goSpecialString -hi def link goEscapeC goSpecialString -hi def link goEscapeX goSpecialString -hi def link goEscapeU goSpecialString -hi def link goEscapeBigU goSpecialString -hi def link goSpecialString Special -hi def link goEscapeError Error - -" Strings and their contents -syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError -syn region goString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup -syn region goRawString contained start=+`+ end=+`+ - -hi def link goString String -hi def link goRawString String - -" Characters; their contents -syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU -syn region goCharacter contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup - -hi def link goCharacter Character - -" Integers -syn match goDecimalInt contained "\<\d\+\([Ee]\d\+\)\?\>" -syn match goHexadecimalInt contained "\<0x\x\+\>" -syn match goOctalInt contained "\<0\o\+\>" -syn match goOctalError contained "\<0\o*[89]\d*\>" -syn cluster goInt contains=goDecimalInt,goHexadecimalInt,goOctalInt -" Floating point -syn match goFloat contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" -syn match goFloat contained "\<\.\d\+\([Ee][-+]\d\+\)\?\>" -syn match goFloat contained "\<\d\+[Ee][-+]\d\+\>" -" Imaginary literals -syn match goImaginary contained "\<\d\+i\>" -syn match goImaginary contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>" -syn match goImaginary contained "\<\.\d\+\([Ee][-+]\d\+\)\?i\>" -syn match goImaginary contained "\<\d\+[Ee][-+]\d\+i\>" - -hi def link goInt Number -hi def link goFloat Number -hi def link goImaginary Number - -" Token groups -syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary -syn keyword gotplControl contained if else end range with template -syn keyword gotplFunctions contained and html index js len not or print printf println urlquery eq ne lt le gt ge -syn match gotplVariable contained /\$[a-zA-Z0-9_]*\>/ -syn match goTplIdentifier contained /\.[^\s}]+\>/ - -hi def link gotplControl Keyword -hi def link gotplFunctions Function -hi def link goTplVariable Special - -syn region gotplAction start="{{" end="}}" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable,goTplIdentifier display -syn region gotplAction start="\[\[" end="\]\]" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable display -syn region goTplComment start="{{\(- \)\?/\*" end="\*/\( -\)\?}}" display -syn region goTplComment start="\[\[\(- \)\?/\*" end="\*/\( -\)\?\]\]" display - -hi def link gotplAction PreProc -hi def link goTplComment Comment - -let b:current_syntax = "gotexttmpl" - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/syntax/vimgo.vim b/vim-config/plugins/vim-go/syntax/vimgo.vim deleted file mode 100644 index 3a2204c4..00000000 --- a/vim-config/plugins/vim-go/syntax/vimgo.vim +++ /dev/null @@ -1,13 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -let b:current_syntax = "vimgo" - -syn match goInterface /^\S*/ -syn region goTitle start="\%1l" end=":" - -hi def link goInterface Type -hi def link goTitle Label - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/templates/hello_world.go b/vim-config/plugins/vim-go/templates/hello_world.go deleted file mode 100644 index 50e8d8d3..00000000 --- a/vim-config/plugins/vim-go/templates/hello_world.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("vim-go") -} diff --git a/vim-config/plugins/vim-go/templates/hello_world_test.go b/vim-config/plugins/vim-go/templates/hello_world_test.go deleted file mode 100644 index 3ef4f524..00000000 --- a/vim-config/plugins/vim-go/templates/hello_world_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "testing" - -func TestHelloWorld(t *testing.T) { - // t.Fatal("not implemented") -} diff --git a/vim-config/plugins/vim-go/test/gopath_test.vim b/vim-config/plugins/vim-go/test/gopath_test.vim deleted file mode 100644 index 5036a598..00000000 --- a/vim-config/plugins/vim-go/test/gopath_test.vim +++ /dev/null @@ -1,65 +0,0 @@ -" don't spam the user when Vim is started in Vi compatibility mode -let s:cpo_save = &cpo -set cpo&vim - -fun! Test_Detect_Gopath() abort - let l:gopath = $GOPATH - try - let g:go_autodetect_gopath = 1 - let l:tmp = go#util#tempdir("pathdetect") - let l:tmp2 = go#util#tempdir("pathdetect-nogodep") - - call mkdir(l:tmp . '/subdir', 'p') - call mkdir(l:tmp . '/Godeps/_workspace', 'p') - - exe ':e ' . l:tmp . '/a.go' - call assert_equal(l:tmp . '/Godeps/_workspace:' . l:gopath, $GOPATH) - - exe ':e ' . l:tmp . '/not-a-go-file' - call assert_equal(l:gopath, $GOPATH) - - exe ':e ' . l:tmp . '/subdir/a.go' - call assert_equal(l:tmp . '/Godeps/_workspace:' . l:gopath, $GOPATH) - - exec ':e ' . l:tmp2 . '/a.go' - call assert_equal(l:gopath, $GOPATH) - finally - let g:go_autodetect_gopath = 0 - call delete(l:tmp, 'rf') - call delete(l:tmp2, 'rf') - endtry -endfun - -fun! Test_Detect_Gopath_disabled() abort - let l:gopath = $GOPATH - try - let g:go_autodetect_gopath = 0 - let l:tmp = go#util#tempdir("pathdetect") - let l:tmp2 = go#util#tempdir("pathdetect-nogodep") - - call mkdir(l:tmp . '/subdir', 'p') - call mkdir(l:tmp . '/Godeps/_workspace', 'p') - - exe ':e ' . l:tmp . '/a.go' - call assert_equal(l:gopath, $GOPATH) - - exe ':e ' . l:tmp . '/not-a-go-file' - call assert_equal(l:gopath, $GOPATH) - - exe ':e ' . l:tmp . '/subdir/a.go' - call assert_equal(l:gopath, $GOPATH) - - exec ':e ' . l:tmp2 . '/a.go' - call assert_equal(l:gopath, $GOPATH) - finally - let g:go_autodetect_gopath = 0 - call delete(l:tmp, 'rf') - call delete(l:tmp2, 'rf') - endtry -endfun - -" restore Vi compatibility settings -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: sw=2 ts=2 et diff --git a/vim-config/plugins/vim-go/test/parse.go b/vim-config/plugins/vim-go/test/parse.go deleted file mode 100644 index 7e296a79..00000000 --- a/vim-config/plugins/vim-go/test/parse.go +++ /dev/null @@ -1,2096 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// golang.org/x/net/html/parse.go - -package html - -import ( - "errors" - "fmt" - "io" - "strings" - - a "golang.org/x/net/html/atom" -) - -// A parser implements the HTML5 parsing algorithm: -// https://html.spec.whatwg.org/multipage/syntax.html#tree-construction -type parser struct { - // tokenizer provides the tokens for the parser. - tokenizer *Tokenizer - // tok is the most recently read token. - tok Token - // Self-closing tags like
are treated as start tags, except that - // hasSelfClosingToken is set while they are being processed. - hasSelfClosingToken bool - // doc is the document root element. - doc *Node - // The stack of open elements (section 12.2.3.2) and active formatting - // elements (section 12.2.3.3). - oe, afe nodeStack - // Element pointers (section 12.2.3.4). - head, form *Node - // Other parsing state flags (section 12.2.3.5). - scripting, framesetOK bool - // im is the current insertion mode. - im insertionMode - // originalIM is the insertion mode to go back to after completing a text - // or inTableText insertion mode. - originalIM insertionMode - // fosterParenting is whether new elements should be inserted according to - // the foster parenting rules (section 12.2.5.3). - fosterParenting bool - // quirks is whether the parser is operating in "quirks mode." - quirks bool - // fragment is whether the parser is parsing an HTML fragment. - fragment bool - // context is the context element when parsing an HTML fragment - // (section 12.4). - context *Node -} - -func (p *parser) top() *Node { - if n := p.oe.top(); n != nil { - return n - } - return p.doc -} - -// Stop tags for use in popUntil. These come from section 12.2.3.2. -var ( - defaultScopeStopTags = map[string][]a.Atom{ - "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, - "math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext}, - "svg": {a.Desc, a.ForeignObject, a.Title}, - } -) - -type scope int - -const ( - defaultScope scope = iota - listItemScope - buttonScope - tableScope - tableRowScope - tableBodyScope - selectScope -) - -// popUntil pops the stack of open elements at the highest element whose tag -// is in matchTags, provided there is no higher element in the scope's stop -// tags (as defined in section 12.2.3.2). It returns whether or not there was -// such an element. If there was not, popUntil leaves the stack unchanged. -// -// For example, the set of stop tags for table scope is: "html", "table". If -// the stack was: -// ["html", "body", "font", "table", "b", "i", "u"] -// then popUntil(tableScope, "font") would return false, but -// popUntil(tableScope, "i") would return true and the stack would become: -// ["html", "body", "font", "table", "b"] -// -// If an element's tag is in both the stop tags and matchTags, then the stack -// will be popped and the function returns true (provided, of course, there was -// no higher element in the stack that was also in the stop tags). For example, -// popUntil(tableScope, "table") returns true and leaves: -// ["html", "body", "font"] -func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool { - if i := p.indexOfElementInScope(s, matchTags...); i != -1 { - p.oe = p.oe[:i] - return true - } - return false -} - -// indexOfElementInScope returns the index in p.oe of the highest element whose -// tag is in matchTags that is in scope. If no matching element is in scope, it -// returns -1. -func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - if p.oe[i].Namespace == "" { - for _, t := range matchTags { - if t == tagAtom { - return i - } - } - switch s { - case defaultScope: - // No-op. - case listItemScope: - if tagAtom == a.Ol || tagAtom == a.Ul { - return -1 - } - case buttonScope: - if tagAtom == a.Button { - return -1 - } - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { - return -1 - } - case selectScope: - if tagAtom != a.Optgroup && tagAtom != a.Option { - return -1 - } - default: - panic("unreachable") - } - } - switch s { - case defaultScope, listItemScope, buttonScope: - for _, t := range defaultScopeStopTags[p.oe[i].Namespace] { - if t == tagAtom { - return -1 - } - } - } - } - return -1 -} - -// elementInScope is like popUntil, except that it doesn't modify the stack of -// open elements. -func (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool { - return p.indexOfElementInScope(s, matchTags...) != -1 -} - -// clearStackToContext pops elements off the stack of open elements until a -// scope-defined element is found. -func (p *parser) clearStackToContext(s scope) { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - switch s { - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { - p.oe = p.oe[:i+1] - return - } - case tableRowScope: - if tagAtom == a.Html || tagAtom == a.Tr { - p.oe = p.oe[:i+1] - return - } - case tableBodyScope: - if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead { - p.oe = p.oe[:i+1] - return - } - default: - panic("unreachable") - } - } -} - -// generateImpliedEndTags pops nodes off the stack of open elements as long as -// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt. -// If exceptions are specified, nodes with that name will not be popped off. -func (p *parser) generateImpliedEndTags(exceptions ...string) { - var i int -loop: - for i = len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - if n.Type == ElementNode { - switch n.DataAtom { - case a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt: - for _, except := range exceptions { - if n.Data == except { - break loop - } - } - continue - } - } - break - } - - p.oe = p.oe[:i+1] -} - -// addChild adds a child node n to the top element, and pushes n onto the stack -// of open elements if it is an element node. -func (p *parser) addChild(n *Node) { - if p.shouldFosterParent() { - p.fosterParent(n) - } else { - p.top().AppendChild(n) - } - - if n.Type == ElementNode { - p.oe = append(p.oe, n) - } -} - -// shouldFosterParent returns whether the next node to be added should be -// foster parented. -func (p *parser) shouldFosterParent() bool { - if p.fosterParenting { - switch p.top().DataAtom { - case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: - return true - } - } - return false -} - -// fosterParent adds a child node according to the foster parenting rules. -// Section 12.2.5.3, "foster parenting". -func (p *parser) fosterParent(n *Node) { - var table, parent, prev *Node - var i int - for i = len(p.oe) - 1; i >= 0; i-- { - if p.oe[i].DataAtom == a.Table { - table = p.oe[i] - break - } - } - - if table == nil { - // The foster parent is the html element. - parent = p.oe[0] - } else { - parent = table.Parent - } - if parent == nil { - parent = p.oe[i-1] - } - - if table != nil { - prev = table.PrevSibling - } else { - prev = parent.LastChild - } - if prev != nil && prev.Type == TextNode && n.Type == TextNode { - prev.Data += n.Data - return - } - - parent.InsertBefore(n, table) -} - -// addText adds text to the preceding node if it is a text node, or else it -// calls addChild with a new text node. -func (p *parser) addText(text string) { - if text == "" { - return - } - - if p.shouldFosterParent() { - p.fosterParent(&Node{ - Type: TextNode, - Data: text, - }) - return - } - - t := p.top() - if n := t.LastChild; n != nil && n.Type == TextNode { - n.Data += text - return - } - p.addChild(&Node{ - Type: TextNode, - Data: text, - }) -} - -// addElement adds a child element based on the current token. -func (p *parser) addElement() { - p.addChild(&Node{ - Type: ElementNode, - DataAtom: p.tok.DataAtom, - Data: p.tok.Data, - Attr: p.tok.Attr, - }) -} - -// Section 12.2.3.3. -func (p *parser) addFormattingElement() { - tagAtom, attr := p.tok.DataAtom, p.tok.Attr - p.addElement() - - // Implement the Noah's Ark clause, but with three per family instead of two. - identicalElements := 0 -findIdenticalElements: - for i := len(p.afe) - 1; i >= 0; i-- { - n := p.afe[i] - if n.Type == scopeMarkerNode { - break - } - if n.Type != ElementNode { - continue - } - if n.Namespace != "" { - continue - } - if n.DataAtom != tagAtom { - continue - } - if len(n.Attr) != len(attr) { - continue - } - compareAttributes: - for _, t0 := range n.Attr { - for _, t1 := range attr { - if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val { - // Found a match for this attribute, continue with the next attribute. - continue compareAttributes - } - } - // If we get here, there is no attribute that matches a. - // Therefore the element is not identical to the new one. - continue findIdenticalElements - } - - identicalElements++ - if identicalElements >= 3 { - p.afe.remove(n) - } - } - - p.afe = append(p.afe, p.top()) -} - -// Section 12.2.3.3. -func (p *parser) clearActiveFormattingElements() { - for { - n := p.afe.pop() - if len(p.afe) == 0 || n.Type == scopeMarkerNode { - return - } - } -} - -// Section 12.2.3.3. -func (p *parser) reconstructActiveFormattingElements() { - n := p.afe.top() - if n == nil { - return - } - if n.Type == scopeMarkerNode || p.oe.index(n) != -1 { - return - } - i := len(p.afe) - 1 - for n.Type != scopeMarkerNode && p.oe.index(n) == -1 { - if i == 0 { - i = -1 - break - } - i-- - n = p.afe[i] - } - for { - i++ - clone := p.afe[i].clone() - p.addChild(clone) - p.afe[i] = clone - if i == len(p.afe)-1 { - break - } - } -} - -// Section 12.2.4. -func (p *parser) acknowledgeSelfClosingTag() { - p.hasSelfClosingToken = false -} - -// An insertion mode (section 12.2.3.1) is the state transition function from -// a particular state in the HTML5 parser's state machine. It updates the -// parser's fields depending on parser.tok (where ErrorToken means EOF). -// It returns whether the token was consumed. -type insertionMode func(*parser) bool - -// setOriginalIM sets the insertion mode to return to after completing a text or -// inTableText insertion mode. -// Section 12.2.3.1, "using the rules for". -func (p *parser) setOriginalIM() { - if p.originalIM != nil { - panic("html: bad parser state: originalIM was set twice") - } - p.originalIM = p.im -} - -// Section 12.2.3.1, "reset the insertion mode". -func (p *parser) resetInsertionMode() { - for i := len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - if i == 0 && p.context != nil { - n = p.context - } - - switch n.DataAtom { - case a.Select: - p.im = inSelectIM - case a.Td, a.Th: - p.im = inCellIM - case a.Tr: - p.im = inRowIM - case a.Tbody, a.Thead, a.Tfoot: - p.im = inTableBodyIM - case a.Caption: - p.im = inCaptionIM - case a.Colgroup: - p.im = inColumnGroupIM - case a.Table: - p.im = inTableIM - case a.Head: - p.im = inBodyIM - case a.Body: - p.im = inBodyIM - case a.Frameset: - p.im = inFramesetIM - case a.Html: - p.im = beforeHeadIM - default: - continue - } - return - } - p.im = inBodyIM -} - -const whitespace = " \t\r\n\f" - -// Section 12.2.5.4.1. -func initialIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - n, quirks := parseDoctype(p.tok.Data) - p.doc.AppendChild(n) - p.quirks = quirks - p.im = beforeHTMLIM - return true - } - p.quirks = true - p.im = beforeHTMLIM - return false -} - -// Section 12.2.5.4.2. -func beforeHTMLIM(p *parser) bool { - switch p.tok.Type { - case DoctypeToken: - // Ignore the token. - return true - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - if p.tok.DataAtom == a.Html { - p.addElement() - p.im = beforeHeadIM - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - } - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false -} - -// Section 12.2.5.4.3. -func beforeHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Head: - p.addElement() - p.head = p.top() - p.im = inHeadIM - return true - case a.Html: - return inBodyIM(p) - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false -} - -// Section 12.2.5.4.4. -func inHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - s := strings.TrimLeft(p.tok.Data, whitespace) - if len(s) < len(p.tok.Data) { - // Add the initial whitespace to the current node. - p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) - if s == "" { - return true - } - p.tok.Data = s - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Html: - return inBodyIM(p) - case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta: - p.addElement() - p.oe.pop() - p.acknowledgeSelfClosingTag() - return true - case a.Script, a.Title, a.Noscript, a.Noframes, a.Style: - p.addElement() - p.setOriginalIM() - p.im = textIM - return true - case a.Head: - // Ignore the token. - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head: - n := p.oe.pop() - if n.DataAtom != a.Head { - panic("html: bad parser state: element not found, in the in-head insertion mode") - } - p.im = afterHeadIM - return true - case a.Body, a.Html, a.Br: - p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) - return false -} - -// Section 12.2.5.4.6. -func afterHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - s := strings.TrimLeft(p.tok.Data, whitespace) - if len(s) < len(p.tok.Data) { - // Add the initial whitespace to the current node. - p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) - if s == "" { - return true - } - p.tok.Data = s - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Html: - return inBodyIM(p) - case a.Body: - p.addElement() - p.framesetOK = false - p.im = inBodyIM - return true - case a.Frameset: - p.addElement() - p.im = inFramesetIM - return true - case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: - p.oe = append(p.oe, p.head) - defer p.oe.remove(p.head) - return inHeadIM(p) - case a.Head: - // Ignore the token. - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Body, a.Html, a.Br: - // Drop down to creating an implied tag. - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Body, a.Body.String()) - p.framesetOK = true - return false -} - -// copyAttributes copies attributes of src not found on dst to dst. -func copyAttributes(dst *Node, src Token) { - if len(src.Attr) == 0 { - return - } - attr := map[string]string{} - for _, t := range dst.Attr { - attr[t.Key] = t.Val - } - for _, t := range src.Attr { - if _, ok := attr[t.Key]; !ok { - dst.Attr = append(dst.Attr, t) - attr[t.Key] = t.Val - } - } -} - -// Section 12.2.5.4.7. -func inBodyIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - d := p.tok.Data - switch n := p.oe.top(); n.DataAtom { - case a.Pre, a.Listing: - if n.FirstChild == nil { - // Ignore a newline at the start of a
 block.
-				if d != "" && d[0] == '\r' {
-					d = d[1:]
-				}
-				if d != "" && d[0] == '\n' {
-					d = d[1:]
-				}
-			}
-		}
-		d = strings.Replace(d, "\x00", "", -1)
-		if d == "" {
-			return true
-		}
-		p.reconstructActiveFormattingElements()
-		p.addText(d)
-		if p.framesetOK && strings.TrimLeft(d, whitespace) != "" {
-			// There were non-whitespace characters inserted.
-			p.framesetOK = false
-		}
-	case StartTagToken:
-		switch p.tok.DataAtom {
-		case a.Html:
-			copyAttributes(p.oe[0], p.tok)
-		case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:
-			return inHeadIM(p)
-		case a.Body:
-			if len(p.oe) >= 2 {
-				body := p.oe[1]
-				if body.Type == ElementNode && body.DataAtom == a.Body {
-					p.framesetOK = false
-					copyAttributes(body, p.tok)
-				}
-			}
-		case a.Frameset:
-			if !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {
-				// Ignore the token.
-				return true
-			}
-			body := p.oe[1]
-			if body.Parent != nil {
-				body.Parent.RemoveChild(body)
-			}
-			p.oe = p.oe[:1]
-			p.addElement()
-			p.im = inFramesetIM
-			return true
-		case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
-			p.popUntil(buttonScope, a.P)
-			switch n := p.top(); n.DataAtom {
-			case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
-				p.oe.pop()
-			}
-			p.addElement()
-		case a.Pre, a.Listing:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-			// The newline, if any, will be dealt with by the TextToken case.
-			p.framesetOK = false
-		case a.Form:
-			if p.form == nil {
-				p.popUntil(buttonScope, a.P)
-				p.addElement()
-				p.form = p.top()
-			}
-		case a.Li:
-			p.framesetOK = false
-			for i := len(p.oe) - 1; i >= 0; i-- {
-				node := p.oe[i]
-				switch node.DataAtom {
-				case a.Li:
-					p.oe = p.oe[:i]
-				case a.Address, a.Div, a.P:
-					continue
-				default:
-					if !isSpecialElement(node) {
-						continue
-					}
-				}
-				break
-			}
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.Dd, a.Dt:
-			p.framesetOK = false
-			for i := len(p.oe) - 1; i >= 0; i-- {
-				node := p.oe[i]
-				switch node.DataAtom {
-				case a.Dd, a.Dt:
-					p.oe = p.oe[:i]
-				case a.Address, a.Div, a.P:
-					continue
-				default:
-					if !isSpecialElement(node) {
-						continue
-					}
-				}
-				break
-			}
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.Plaintext:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.Button:
-			p.popUntil(defaultScope, a.Button)
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.framesetOK = false
-		case a.A:
-			for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {
-				if n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {
-					p.inBodyEndTagFormatting(a.A)
-					p.oe.remove(n)
-					p.afe.remove(n)
-					break
-				}
-			}
-			p.reconstructActiveFormattingElements()
-			p.addFormattingElement()
-		case a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
-			p.reconstructActiveFormattingElements()
-			p.addFormattingElement()
-		case a.Nobr:
-			p.reconstructActiveFormattingElements()
-			if p.elementInScope(defaultScope, a.Nobr) {
-				p.inBodyEndTagFormatting(a.Nobr)
-				p.reconstructActiveFormattingElements()
-			}
-			p.addFormattingElement()
-		case a.Applet, a.Marquee, a.Object:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.afe = append(p.afe, &scopeMarker)
-			p.framesetOK = false
-		case a.Table:
-			if !p.quirks {
-				p.popUntil(buttonScope, a.P)
-			}
-			p.addElement()
-			p.framesetOK = false
-			p.im = inTableIM
-			return true
-		case a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.oe.pop()
-			p.acknowledgeSelfClosingTag()
-			if p.tok.DataAtom == a.Input {
-				for _, t := range p.tok.Attr {
-					if t.Key == "type" {
-						if strings.ToLower(t.Val) == "hidden" {
-							// Skip setting framesetOK = false
-							return true
-						}
-					}
-				}
-			}
-			p.framesetOK = false
-		case a.Param, a.Source, a.Track:
-			p.addElement()
-			p.oe.pop()
-			p.acknowledgeSelfClosingTag()
-		case a.Hr:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-			p.oe.pop()
-			p.acknowledgeSelfClosingTag()
-			p.framesetOK = false
-		case a.Image:
-			p.tok.DataAtom = a.Img
-			p.tok.Data = a.Img.String()
-			return false
-		case a.Isindex:
-			if p.form != nil {
-				// Ignore the token.
-				return true
-			}
-			action := ""
-			prompt := "This is a searchable index. Enter search keywords: "
-			attr := []Attribute{{Key: "name", Val: "isindex"}}
-			for _, t := range p.tok.Attr {
-				switch t.Key {
-				case "action":
-					action = t.Val
-				case "name":
-					// Ignore the attribute.
-				case "prompt":
-					prompt = t.Val
-				default:
-					attr = append(attr, t)
-				}
-			}
-			p.acknowledgeSelfClosingTag()
-			p.popUntil(buttonScope, a.P)
-			p.parseImpliedToken(StartTagToken, a.Form, a.Form.String())
-			if action != "" {
-				p.form.Attr = []Attribute{{Key: "action", Val: action}}
-			}
-			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
-			p.parseImpliedToken(StartTagToken, a.Label, a.Label.String())
-			p.addText(prompt)
-			p.addChild(&Node{
-				Type:     ElementNode,
-				DataAtom: a.Input,
-				Data:     a.Input.String(),
-				Attr:     attr,
-			})
-			p.oe.pop()
-			p.parseImpliedToken(EndTagToken, a.Label, a.Label.String())
-			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
-			p.parseImpliedToken(EndTagToken, a.Form, a.Form.String())
-		case a.Textarea:
-			p.addElement()
-			p.setOriginalIM()
-			p.framesetOK = false
-			p.im = textIM
-		case a.Xmp:
-			p.popUntil(buttonScope, a.P)
-			p.reconstructActiveFormattingElements()
-			p.framesetOK = false
-			p.addElement()
-			p.setOriginalIM()
-			p.im = textIM
-		case a.Iframe:
-			p.framesetOK = false
-			p.addElement()
-			p.setOriginalIM()
-			p.im = textIM
-		case a.Noembed, a.Noscript:
-			p.addElement()
-			p.setOriginalIM()
-			p.im = textIM
-		case a.Select:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.framesetOK = false
-			p.im = inSelectIM
-			return true
-		case a.Optgroup, a.Option:
-			if p.top().DataAtom == a.Option {
-				p.oe.pop()
-			}
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-		case a.Rp, a.Rt:
-			if p.elementInScope(defaultScope, a.Ruby) {
-				p.generateImpliedEndTags()
-			}
-			p.addElement()
-		case a.Math, a.Svg:
-			p.reconstructActiveFormattingElements()
-			if p.tok.DataAtom == a.Math {
-				adjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)
-			} else {
-				adjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)
-			}
-			adjustForeignAttributes(p.tok.Attr)
-			p.addElement()
-			p.top().Namespace = p.tok.Data
-			if p.hasSelfClosingToken {
-				p.oe.pop()
-				p.acknowledgeSelfClosingTag()
-			}
-			return true
-		case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:
-			// Ignore the token.
-		default:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-		}
-	case EndTagToken:
-		switch p.tok.DataAtom {
-		case a.Body:
-			if p.elementInScope(defaultScope, a.Body) {
-				p.im = afterBodyIM
-			}
-		case a.Html:
-			if p.elementInScope(defaultScope, a.Body) {
-				p.parseImpliedToken(EndTagToken, a.Body, a.Body.String())
-				return false
-			}
-			return true
-		case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
-			p.popUntil(defaultScope, p.tok.DataAtom)
-		case a.Form:
-			node := p.form
-			p.form = nil
-			i := p.indexOfElementInScope(defaultScope, a.Form)
-			if node == nil || i == -1 || p.oe[i] != node {
-				// Ignore the token.
-				return true
-			}
-			p.generateImpliedEndTags()
-			p.oe.remove(node)
-		case a.P:
-			if !p.elementInScope(buttonScope, a.P) {
-				p.parseImpliedToken(StartTagToken, a.P, a.P.String())
-			}
-			p.popUntil(buttonScope, a.P)
-		case a.Li:
-			p.popUntil(listItemScope, a.Li)
-		case a.Dd, a.Dt:
-			p.popUntil(defaultScope, p.tok.DataAtom)
-		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
-			p.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)
-		case a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
-			p.inBodyEndTagFormatting(p.tok.DataAtom)
-		case a.Applet, a.Marquee, a.Object:
-			if p.popUntil(defaultScope, p.tok.DataAtom) {
-				p.clearActiveFormattingElements()
-			}
-		case a.Br:
-			p.tok.Type = StartTagToken
-			return false
-		default:
-			p.inBodyEndTagOther(p.tok.DataAtom)
-		}
-	case CommentToken:
-		p.addChild(&Node{
-			Type: CommentNode,
-			Data: p.tok.Data,
-		})
-	}
-
-	return true
-}
-
-func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {
-	// This is the "adoption agency" algorithm, described at
-	// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency
-
-	// TODO: this is a fairly literal line-by-line translation of that algorithm.
-	// Once the code successfully parses the comprehensive test suite, we should
-	// refactor this code to be more idiomatic.
-
-	// Steps 1-4. The outer loop.
-	for i := 0; i < 8; i++ {
-		// Step 5. Find the formatting element.
-		var formattingElement *Node
-		for j := len(p.afe) - 1; j >= 0; j-- {
-			if p.afe[j].Type == scopeMarkerNode {
-				break
-			}
-			if p.afe[j].DataAtom == tagAtom {
-				formattingElement = p.afe[j]
-				break
-			}
-		}
-		if formattingElement == nil {
-			p.inBodyEndTagOther(tagAtom)
-			return
-		}
-		feIndex := p.oe.index(formattingElement)
-		if feIndex == -1 {
-			p.afe.remove(formattingElement)
-			return
-		}
-		if !p.elementInScope(defaultScope, tagAtom) {
-			// Ignore the tag.
-			return
-		}
-
-		// Steps 9-10. Find the furthest block.
-		var furthestBlock *Node
-		for _, e := range p.oe[feIndex:] {
-			if isSpecialElement(e) {
-				furthestBlock = e
-				break
-			}
-		}
-		if furthestBlock == nil {
-			e := p.oe.pop()
-			for e != formattingElement {
-				e = p.oe.pop()
-			}
-			p.afe.remove(e)
-			return
-		}
-
-		// Steps 11-12. Find the common ancestor and bookmark node.
-		commonAncestor := p.oe[feIndex-1]
-		bookmark := p.afe.index(formattingElement)
-
-		// Step 13. The inner loop. Find the lastNode to reparent.
-		lastNode := furthestBlock
-		node := furthestBlock
-		x := p.oe.index(node)
-		// Steps 13.1-13.2
-		for j := 0; j < 3; j++ {
-			// Step 13.3.
-			x--
-			node = p.oe[x]
-			// Step 13.4 - 13.5.
-			if p.afe.index(node) == -1 {
-				p.oe.remove(node)
-				continue
-			}
-			// Step 13.6.
-			if node == formattingElement {
-				break
-			}
-			// Step 13.7.
-			clone := node.clone()
-			p.afe[p.afe.index(node)] = clone
-			p.oe[p.oe.index(node)] = clone
-			node = clone
-			// Step 13.8.
-			if lastNode == furthestBlock {
-				bookmark = p.afe.index(node) + 1
-			}
-			// Step 13.9.
-			if lastNode.Parent != nil {
-				lastNode.Parent.RemoveChild(lastNode)
-			}
-			node.AppendChild(lastNode)
-			// Step 13.10.
-			lastNode = node
-		}
-
-		// Step 14. Reparent lastNode to the common ancestor,
-		// or for misnested table nodes, to the foster parent.
-		if lastNode.Parent != nil {
-			lastNode.Parent.RemoveChild(lastNode)
-		}
-		switch commonAncestor.DataAtom {
-		case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:
-			p.fosterParent(lastNode)
-		default:
-			commonAncestor.AppendChild(lastNode)
-		}
-
-		// Steps 15-17. Reparent nodes from the furthest block's children
-		// to a clone of the formatting element.
-		clone := formattingElement.clone()
-		reparentChildren(clone, furthestBlock)
-		furthestBlock.AppendChild(clone)
-
-		// Step 18. Fix up the list of active formatting elements.
-		if oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {
-			// Move the bookmark with the rest of the list.
-			bookmark--
-		}
-		p.afe.remove(formattingElement)
-		p.afe.insert(bookmark, clone)
-
-		// Step 19. Fix up the stack of open elements.
-		p.oe.remove(formattingElement)
-		p.oe.insert(p.oe.index(furthestBlock)+1, clone)
-	}
-}
-
-// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
-// "Any other end tag" handling from 12.2.5.5 The rules for parsing tokens in foreign content
-// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
-func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
-	for i := len(p.oe) - 1; i >= 0; i-- {
-		if p.oe[i].DataAtom == tagAtom {
-			p.oe = p.oe[:i]
-			break
-		}
-		if isSpecialElement(p.oe[i]) {
-			break
-		}
-	}
-}
-
-// Section 12.2.5.4.8.
-func textIM(p *parser) bool {
-	switch p.tok.Type {
-	case ErrorToken:
-		p.oe.pop()
-	case TextToken:
-		d := p.tok.Data
-		if n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {
-			// Ignore a newline at the start of a