...
 
Commits (18)
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/vim-go/' changes from 0906172085..991197f379 · 05e9bef2
    Dustin L. Howett authored
    991197f379 update CHANGELOG.md for #2961
    f3a082c36a Merge pull request #2961 from peterstace/omnifunc_icase
    1ea46befbc Remove icase link in docs, since there is no corresponding tag
    8b0acbd37b Add omnifunc icase override setting
    dad052d7bc update CHANGELOG.md for #2960
    b6647f7803 Merge pull request #2960 from bhcleek/diagnostics/autosave
    5f102e7ece lsp: return current diagnostics when file is unchanged
    124b73da9a update CHANGELOG.md for #2959
    840a27c83c Merge pull request #2959 from mattr-/patch-1
    4dc1f0ff5e Ensure Neovim version requirements match
    7b439888bb update CHANGELOG.md for #2956
    44a270cd91 Merge pull request #2956 from wy100101/master
    20d976fea5 Update mappings.vim
    2c6bffb492 update CHANGELOG.md for #2952
    5d93026418 Merge pull request #2952 from bhcleek/doc/debug/commands
    989ff3108a doc: update documentation for #2948
    faa8bdb97a update CHANGELOG.md for #2950
    7ea7242314 Merge pull request #2950 from bhcleek/debug/check-stale
    4a4b7a8cbf update CHANGELOG.md for #2951
    8d1552cbc8 Merge pull request #2951 from bhcleek/lsp/definition-null
    2766de49d4 debug: warn when file is written after starting debugger
    14f368447a lsp: ignore nulls in definition and type definition handlers
    54a49ebd7c update CHANGELOG.md for #2948
    aaf5969118 Merge pull request #2948 from bhcleek/debug/responsive
    9bc2842a55 debug: refactor to make rpc response handling async
    75ffad527a promise: teach promises to handle exceptions
    f919e0c50d update CHANGELOG.md for #2943
    088343d50e Merge pull request #2943 from bhcleek/debug/signs-viml
    1d788f3407 debug: refactor sign management
    3c4c4cdea5 update CHANGELOG.md for #2932
    9bf04697b5 Merge pull request #2932 from bhcleek/debug/responsive
    e8b8d39b24 update CHANGELOG.md for #2944
    d3bfa19c06 Merge pull request #2944 from nstratos/use-generic-implements-mapping
    c741d55e1f Fix go-implements mapping using guru
    a330a518ab update CHANGELOG.md for #2942
    0354defe57 Merge pull request #2942 from bhcleek/lint/missing-close-brace-eof
    59a6135947 lsp: handle errors at EOF
    092e3aa06d update CHANGELOG.md for #2939
    48b70197f4 Merge pull request #2939 from bhcleek/package/completion/gomodcache
    4905afbfcb package: use GOMODCACHE for searching for completion candidates
    ac1fb5adb0 Merge pull request #2938 from bhcleek/fmt/test/goimports
    761d6d79c3 fmt: fix goimports test
    ab8bb56c4e update CHANGELOG.md for #2936
    905ed7ebd2 Merge pull request #2936 from WhoIsSethDaniel/fix_package_completion
    14a28a2bdc Look for packages in $GOPATH/pkg/mod/. Strip out version information placed in the path.
    5a7cecb0b0 debug: non blocking messages in Vim
    eb89837b83 update CHANGELOG.md for #2921
    fd63ba60a7 Merge pull request #2921 from bhcleek/debug/stop-on-exit
    8e8c0f20ac debug: use sign_getplaced() when possible
    6b2a24a7bd debug: handle sign place output variation
    802ee59f04 debug: refactor NextInProgress handling
    217e0b0a63 debug: make error messages more useful
    3df3e2d4fd debug: handle process exit cleanly
    79cd1ba4d3 explain why CancelNext needs to be called
    4ebfb5967f update CHANGELOG.md for #2930
    5db6da952e Merge pull request #2930 from miyaviee/add-key-exits-check-when-compare-lsp-file-versions
    d1574ccf8a add key exists check when compare lsp file versions
    3e992bfbf4 update CHANGELOG.md for #2902
    60cd21d836 Merge pull request #2902 from bhcleek/lsp/buffer-changed
    eb5995268f update CHANGELOG.md for #2928
    b807ca6f76 Merge pull request #2928 from bhcleek/def/reuse/winid/notnr
    ad54abdee4 def: fix buffer reuse
    33bf26891c update CHANGELOG.md for #2922
    734f737e26 Merge pull request #2922 from bhcleek/rename/gopls-by-default
    b66ba71e45 rename: use gopls by default
    b6c2efa78b update CHANGELOG.md for #2917
    9a8e76cdef Merge pull request #2917 from lvht/rename-root
    ab332288bc util: simplify go#util#Chdir use
    d6bf8c43c1 util: small readability improvements to util
    95ba4eb654 switch to the dir of the current buffer
    2fcd8b2062 lsp: send textDocument/didChange only when buffer has changed
    1dd6f955ac fix pr review
    9ba8161cac support rename all file for go.mod
    354774cd7a update CHANGELOG.md for #2913
    58f8a2ff3e Merge pull request #2914 from bhcleek/lsp/resolve-wd
    b43dc5d89a util: resolve module root
    e3bcc4ca13 Merge pull request #2909 from bhcleek/debug/str2nr-at-source
    ac85b4cd3d debug: convert strings to numbers at their source
    8e34cbad6e update CHANGELOG.md for #2908
    9fea0c6f8d Merge pull request #2908 from MarcoQin/master
    71633c41d4 update CHANGELOG.md for #2905
    ceb75d799e Merge pull request #2905 from bhcleek/lsp/remote
    d5b0ab89d8 update CHANGELOG.md for #2907
    c0e20c527f Merge pull request #2907 from bhcleek/completion/echo-go-info
    4280c439bf fix: RPC params of method CreateBreakpoint
    bec9b93969 completion: do not show documentation at command-line
    fb5b7dc7ed config: use remote gopls by default
    8e72eef0b3 update CHANGELOG.md for #2903
    2f6732c2c6 Merge pull request #2903 from bhcleek/metalinter/errcheck
    911b9a357e lint: enable errcheck by default for golangci-lint metalinting
    b4a0222d6e update CHANGELOG.md for #2884
    fd554ee100 Merge pull request #2884 from Code-Hex/fix/godoc_url
    9d76bb022e update CHANGELOG.md for #2900
    ce3e8bd278 Merge pull request #2900 from zhengkai/master
    0f33ac5001 remove g:go_doc_popup_border
    6e7a0bd86c chore: godoc border style
    9fa8d1edb2 update CHANGELOG.md for #2892
    a8b8003dbb Merge pull request #2892 from bhcleek/highlight/handle-exceptions
    843ca2351c Merge pull request #2897 from bhcleek/docker-caching
    dfaa55da1a update CHANGELOG.md for #2883
    f8fe1fde7c Merge pull request #2883 from swithek/error-snippets
    6c9531d4e7 update CHANGELOG.md for #2898
    52534b4985 Merge pull request #2898 from bhcleek/doc/gorun/wd
    b5f8fffab0 use the docker cache more frequently
    cd0ef866dd doc: document :GoRun's working directory
    7f68ff36a8 update CHANGELOG.md for #2895
    1105b62439 Merge pull request #2895 from bhcleek/term/warn-fix
    52b40130df term: fix warning
    d2165d67e3 update CHANGELOG.md for #2893
    ddff07bfe0 Merge pull request #2893 from bhcleek/doc/autosave
    cd23dcc7f1 doc: clarify how g:go_fmt_autosave and g:go_imports_autosave behave
    76caa3ac2b highlight: handle exceptions when trying to add properties
    7fef39e6ca Merge pull request #2886 from kinbiko/changelog-typo-fix
    4bba73b8c3 Fix link in recent changelog entry
    81e2558b64 update CHANGELOG.md for v1.23 release
    5732d1a335 use pkg.go.dev instead of godoc.org
    cfc3017257 snippets: add fmt.Errorf error wrapping snippets
    d8bbc29e83 update CHANGELOG.md for #2882
    c70ccdb376 Merge pull request #2882 from bhcleek/lint/vet/path-handling
    ff437ecd53 lint: interpret go vet's errors relative to the correct directory
    696ca666ec lint: correct go#lint#Vet tests
    05f691e501 lint: add test for go#lint#Vet
    ee16ce6da1 util: add go#util#Chdir
    620d285ff6 Merge pull request #2875 from bhcleek/lint/golangci-lint-is-awful
    aeddfbc2ff lint: adjust test for reverted commits
    4092fd0e5e Revert "lint: try to parse golangci-lint errors better"
    b2657f574e Revert "update CHAGNELOG.md for #2835"
    961642bc34 lint: add tests for multiple golangci-lint
    13af5df6a1 update CHANGELOG.md for #2862
    999dab020c Merge pull request #2862 from bhcleek/import/ignore-commented
    93d1b4438c update CHANGELOG.md for #2863
    a3a9fbbd24 Merge pull request #2863 from paukul/patch-1
    9d5b39a18f fixes errormessage when detecting a neovim version < 0.4.0
    64e8f47792 import: add test
    536cf81c48 import: disregard commented imports
    d5bc2aee70 update CHANGELOG.md for #2858
    52c65b8235 Merge pull request #2858 from bhcleek/imports_autosave/disable-by-default
    dc58a081e2 config: disable g:go_imports_autosave by default
    b1a9a96bac update CHANGELOG.md for #2856
    397997eabf Merge pull request #2856 from bhcleek/neovim/v0.4.0-required
    00096f2f6e plugin: require Neovim >= 0.4.0
    8cceae5c5c update CHANGELOG.md for #2853
    a9890914d5 Merge pull request #2853 from bhcleek/nvim/0.4.0
    df1eac5870 update CHANGELOG.md for #2854
    c5a046dc10 Merge pull request #2854 from bhcleek/docs/jump-to-error
    9492db5ba3 doc: update g:go_jump_to_error documentation
    6ac9bf8449 require Neovim v0.4.0
    b7edb21cc5 update CHANGELOG.md for #2852
    6d0d894fe0 Merge pull request #2852 from bhcleek/lsp/actions/keep-pos
    6bd1952bbc lsp: preserve the cursor position after text edits
    d71ad2d956 update CHANGELOG.md for #2848
    a51a6182f2 Merge pull request #2848 from bhcleek/lsp/fmt-and-imports/no-progress
    48afe6474a lsp: do not show status for formatting and imports
    075cbc81d9 Merge pull request #2846 from bhcleek/no-travis
    a759b392e3 remove TravisCI config
    d6f4680f06 update CHANGELOG.md for #2844
    e524fa5cec Merge pull request #2844 from bhcleek/cmd/run/term-wd-relative-files
    b351478a54 cmd: use absolute paths for go run in a terminal
    32704bf159 update CHANGELOG.md for #2842
    94ac6c7c4b Merge pull request #2842 from bhcleek/cmd/run/args/not-a-file
    97df26fdba update CHANGELOG.md for #2824
    f9d2ca1bad Merge pull request #2824 from bhcleek/term/early-deletion
    2570b89e5b term: warn when the working directory is removed
    6cbb292880 cmd: do not expand non-file arguments to :GoRun
    ee863a9b78 update CHANGELOG.md for #2843
    db6c48e293 Merge pull request #2843 from bhcleek/doc/term_enabled
    9d73ce5036 doc: update terminal options documentation
    07869cdfb0 update CHANGELOG.md for #2839
    34d94eadc0 Merge pull request #2839 from bhcleek/lsp/doc/null
    de1a8ca822 lsp: handle a null hover result for documentation
    c9f97c83c2 Merge pull request #2837 from bhcleek/tests/no-viminfo
    7ab5c718d3 disable viminfo in tests
    af951d9b34 update CHAGNELOG.md for #2835
    2880123a98 Merge pull request #2835 from bhcleek/lint/golangci-lint-is-inconsistent-and-undocumented
    38ebb28890 lint: try to parse golangci-lint errors better
    3c68cba465 update CHANGELOG.md for #2822
    82a5ed6a66 Merge pull request #2822 from bhcleek/lsp/doc
    b639fb48a1 remove gogetdoc
    53bb2d653b doc: use gopls to get link for :GoDocBrowser
    64458ac220 doc: respect arguments to :GoDocBrowser
    f935649819 update CHANGELOG.md for #2833
    2a95c3507e Merge pull request #2833 from bhcleek/golint/clear
    7dcb533ed2 lint: clear the quickfix window when linting passes
    e1436c20fa update CHANGELOG.md for #2832
    1cfea68702 Merge pull request #2832 from eddiezane/ez/fix-doc
    ab3dda97c0 Fix typo in doc
    6dfba509a4 doc: use gopls for getting documentation under the cursor
    4da6c80845 lsp: use structured hover content
    b995086646 Merge pull request #2826 from bhcleek/github-actions
    d8254a9251 add github action to test and lint
    08d131b8b6 term: handle buffer/directory deletion on exit
    8fd4c4a766 Merge pull request #2825 from bhcleek/neovim/lsp/exit-error
    6e5f8fe80f ignore invalid channel ids when stopping gopls
    124c7b7f7a update CHANGELOG.md for #2821
    80943242fa Merge pull request #2821 from bhcleek/gopls/local-imports
    bb5822c739 lsp: add suppport for gopls' local option
    e44647460e update CHANGELOG.md for #2820
    abea9f0104 Merge pull request #2820 from bhcleek/analysis-options
    e2995a42cc add an option to control gopls' analyses config
    766d778f62 update CHANGELOG.md for #2817
    c9765cc32a Merge pull request #2817 from bhcleek/cmd/run/debug
    adda601d01 update CHANGELOG.md for #2818
    918d475138 Merge pull request #2818 from bhcleek/run/abspath
    ecabf14ac7 run: fix command output
    fd75f3b2ac run: transform file arguments to absolute paths
    6ab6fd2f74 update CHANGELOG.md for #2800
    785f5855f1 Merge pull request #2800 from bhcleek/fmt/imports-on-save
    5203113dd6 clarify a message in CHANGELOG.md
    2b8a3f6db1 update CHANGELOG.md for #2810
    dab3d365c8 Merge pull request #2810 from bhcleek/lint/preserve-errors
    cb1206b27c lint: allow errors to be cleared on save
    5bc5315780 lint: fix function reference
    c074280f70 update CHANGELOG.md for #2804
    3ad8780320 Merge pull request #2804 from andyjack/gogetdoc-chdir
    cf0c43eaca adjust imports on save
    0a4295dab2 update CHANGELOG.md for #2805
    0ba3095737 Merge pull request #2805 from bhcleek/lsp/not-readable-ok
    f311bc8108 lsp: send sync messages when files don't exist
    eff935469e Run gogetdoc in the dir containing the file
    d2e82b50a8 update CHANGELOG.md for #2803
    41bcfb0107 Merge pull request #2803 from bhcleek/test-text-edits
    5bbf43ba02 lsp: fix TextEditAction handling
    8273d532a2 lsp: test text edits
    ba3713aa05 update CHANGELOG.md for #2802
    58ab62097e Merge pull request #2802 from bhcleek/fix-apply-text-edits
    9c8f33242f lsp: handle text edit edge cases
    b3b0eb2f54 update CHANGELOG.md for #2799
    e1f31a6753 Merge pull request #2798 from frescoraja/fix_missing_argument_ParseFormat
    d72748bc3b Merge pull request #2799 from bhcleek/implements/fix-list
    9233d7b768 implements: pass the last argument to go#list#ParseFormat
    16eeab343d add missing argument go#list#ParseFormat call from s:parse_output in implements.go
    95373fb24a update CHANGELOG.md for #2796
    d076f0fa1e Merge pull request #2796 from bhcleek/fmt/goimports
    d86bd02c78 fmt: fix :GoImports
    e710d16a48 update CHANGELOG.md for #2794
    cd97995943 Merge pull request #2794 from bhcleek/config/rename-imports-mode
    7f6df0cfae config: spell g:go_imports_mode correctly
    45221d45c9 correct CHANGELOG.md
    4f8595613d update CHANGELOG.md for #2791
    8a8159b99e Merge pull request #2791 from bhcleek/lsp/imports
    24e6f2b622 update CHANGELOG.md for #2741
    2d9460e499 Merge pull request #2741 from woodstok/GoImplementsLsp
    5e39e42a34 lsp: small refactors to lsp's implementation for :GoImplements
    4b4e11b6df lsp: add support for using gopls for :GoImports
    32b3d07d4b Merge pull request #2792 from bhcleek/lsp/disable-instructions
    c4fded318b gopls: add FAQ and README bits about disabling and sharing
    057a63e420 update CHANGELOG.md for #2790
    77caa8897c Merge pull request #2790 from bhcleek/lsp/fmt/clear
    948066e227 lsp: clear list when formatting
    5f26c1adb2 Add support for gopls 'implements' functionality
    
    git-subtree-dir: pack/3rdparty/start/vim-go
    git-subtree-split: 991197f379d3bf5ca87a69e1dcbb40595fcd15e1
    05e9bef2
  • Dustin L. Howett's avatar
    Merge commit '05e9bef2' · 6b6a0da7
    Dustin L. Howett authored
    6b6a0da7
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/tagbar/' changes from 679a9d9ac9..d7063c7484 · d57461f6
    Dustin L. Howett authored
    d7063c7484 Reset window after jump to tag if zoomed (#625)
    56399f446c Document extra languages supported by universal-ctags (#621)
    fcabc99ca6 Add link to docs and how to open docs in README.md (#619)
    a36880be22 Prevent temporary window creation on Windows (#611)
    f1bea00e5b Merge pull request #610 from majutsushi/no-cache
    e8d127bf40 Catch error message from u/e ctags variants
    92752b89ce Add option to disable use of tmp file cache
    2a1486447a Play nicely with popup windows (#604)
    1e50ea8536 Fix license link in readme file (#599)
    
    git-subtree-dir: pack/3rdparty/start/tagbar
    git-subtree-split: d7063c7484f0f99bfa182b02defef7f412a9289c
    d57461f6
  • Dustin L. Howett's avatar
    Merge commit 'd57461f6' · c1f523f1
    Dustin L. Howett authored
    c1f523f1
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/ultisnips/' changes from ee31ea1c7d..e83c82099d · fd90f896
    Dustin L. Howett authored
    e83c82099d Fix errors in state handling when switching buffers (#1229)
    e35158de39 Reestablish compatibility for python 3.5 (#1208)
    b5452954c5 Enable spell checking in comments (#1216)
    
    git-subtree-dir: pack/3rdparty/start/ultisnips
    git-subtree-split: e83c82099d9bd43dc7895e3cb5b114ee5a2a07c6
    fd90f896
  • Dustin L. Howett's avatar
    Merge commit 'fd90f896' · cf0f8117
    Dustin L. Howett authored
    cf0f8117
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/vim-snippets/' changes from a18c2155dd..75e828ab92 · 9d5d79c6
    Dustin L. Howett authored
    75e828ab92 Elixir: Fix mirror of `defsd`, add `defs`
    bf94550e93 Eliminate Python encoding error on every startup
    64567da52e fix clojure snippets
    2a4beefc7d Add missing closing paren in useCallback hook
    3f805a0101 add snippet for gitcommit co-author directive
    900bf93c66 Add use snippet
    2347d4b2da Improve generic support for some snippets
    f80f6426ff Add if-let and while-let snippets
    7f61b57981 Rename box snippet to boxp
    087d3e7c72 Add missing angle bracket for markdown Disclosure snippet
    25aee70abf Fix async function definitions to actually be async
    e2267a7fb5 Add UltiSnips formatted rust impl snippet
    a75c8eaec4 Add missing quote in src attribute of audio tag
    541f50ac92 async function definitions
    f1ae43d6e2 fixes useState hook in javascript_react file
    5332d404e4 add more Racket snippets
    63a72e1a30 haskell: removed repeated whitespaces
    ad4407f31b Add basic Svelte snippets
    dbfffb971b c.snippets: make argv modifiable
    0344b2dbce Add python snippet to assign attributes to self.
    15304b9439 added javascript_react.snippets file
    94b0aa4f9b added ejs.snippets file
    b62dfce844 Add Dart Flutter snippets
    bb3f87e444 Add Flutter snippets
    1ed162971d awk: removed empty lines
    
    git-subtree-dir: pack/3rdparty/start/vim-snippets
    git-subtree-split: 75e828ab9295b0b4cc475691ee3d7e484282b192
    9d5d79c6
  • Dustin L. Howett's avatar
    Merge commit '9d5d79c6' · d1dd9c3a
    Dustin L. Howett authored
    d1dd9c3a
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/vim-fugitive/' changes from 0e35c9bbc7..1da7c133b1 · 5b3d4060
    Dustin L. Howett authored
    1da7c133b1 Recommend :Git log over :Gclog
    27a5c3abd2 Trigger OptionSet on automatic :diffoff
    03fa78141e Improve weird :Ggrep --column quickfix title
    f1a75478cb Tighten syntax highlighting for SHA
    0646a53c6b Add Help: header
    d2abfca08f Refactor run loop
    e87fe092a2 Extract s:RunEdit()
    5d32f75289 Fix stash map
    caf3b1d569 Don't default :Git grep to --column
    f17a91d010 Provide completion relative to working directory
    5dfe8581ca Extract :Ggrep/:Glgrep wrapper function
    92ad06f70d Use parameterized Git dir when completing heads
    05bbfcd0dc Remove commit entry from :{range}Glog
    85e2c73830 Favor :Ggrep over :Git grep
    f5391f0bfc Fix race condition resuming job after editor invocation
    53dd9b3957 Encapsulate update-index --index-info
    792f51a58b Leverage Git config retrieval helpers
    a9bf9de61d Move Quickfix section under Git section
    
    git-subtree-dir: pack/3rdparty/start/vim-fugitive
    git-subtree-split: 1da7c133b109cd329060174a104e325e4d6bcc82
    5b3d4060
  • Dustin L. Howett's avatar
    Merge commit '5b3d4060' · 1421b293
    Dustin L. Howett authored
    1421b293
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/ctrlp/' changes from 585143acbe..d93d97813d · fdb4830d
    Dustin L. Howett authored
    d93d97813d Merge pull request #543 from prabirshrestha/events
    e99893b118 fixed NotifySearch
    feca722b3b rename to 'search'
    381fc3098e remove ctrlp#get() and ctrlp#set()
    a9a001d0e1 Update autoload/ctrlp.vim
    04bd228102 Update autoload/ctrlp.vim
    d93b53ff5a Update autoload/ctrlp.vim
    386012f79b Update autoload/ctrlp.vim
    add8c7b5b6 Update autoload/ctrlp.vim
    3bbdfbe3c0 Update autoload/ctrlp.vim
    c347749336 Update autoload/ctrlp.vim
    2f689828ab Update autoload/ctrlp.vim
    855b14ceb0 Update autoload/ctrlp.vim
    cc3c8977da Update autoload/ctrlp.vim
    869a31c657 undo line changes
    4dc9de3ed7 implement ctrlp#set(lines) ctrlp#get() ctrlp#update()
    c51ecaeef8 add 'change' event and ctrlp#input() instead of 'event'
    32812289cb add e:type == 'init' example
    45b5c4dd74 add createEventContext and notifyEvent
    
    git-subtree-dir: pack/3rdparty/start/ctrlp
    git-subtree-split: d93d97813dc839ef0782302a0debd7c4877f09f3
    fdb4830d
  • Dustin L. Howett's avatar
    Merge commit 'fdb4830d' · 08b8fa76
    Dustin L. Howett authored
    08b8fa76
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/neocomplete/' changes from 0f83788cb6..5c18aacf03 · c6e55325
    Dustin L. Howett authored
    5c18aacf03 Remove Vim 8.2.1066 support
    
    git-subtree-dir: pack/3rdparty/start/neocomplete
    git-subtree-split: 5c18aacf03e210a23800775bf3585f3735d00a30
    c6e55325
  • Dustin L. Howett's avatar
    Merge commit 'c6e55325' · 46adc2ed
    Dustin L. Howett authored
    46adc2ed
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/vim-ps1/' changes from 2decf51f19..9d52746c3f · 73294c5d
    Dustin L. Howett authored
    9d52746c3f Allow more liberal curly-brace variable names (#46)
    9fdf92846f Fix compiler detection (#43)
    
    git-subtree-dir: pack/3rdparty/start/vim-ps1
    git-subtree-split: 9d52746c3f879aa1aca4deb46edd63823d76d89d
    73294c5d
  • Dustin L. Howett's avatar
    Merge commit '73294c5d' · 2aeb8ecc
    Dustin L. Howett authored
    2aeb8ecc
  • Dustin L. Howett's avatar
    Squashed 'pack/3rdparty/start/vim-sneak/' changes from 98a5c946d6..afe94543bb · 5b6210f6
    Dustin L. Howett authored
    afe94543bb fix: dot-repeat the register used with "z" text-object #254
    
    git-subtree-dir: pack/3rdparty/start/vim-sneak
    git-subtree-split: afe94543bb3bb95ef9ae2a58eebcbc17d69eb304
    5b6210f6
  • Dustin L. Howett's avatar
    Merge commit '5b6210f6' · 879f7f12
    Dustin L. Howett authored
    879f7f12
......@@ -790,6 +790,9 @@ fu! s:BuildPrompt(upd)
if empty(prt[1]) && s:focus
exe 'echoh' hibase '| echon "_" | echoh None'
en
if a:upd
cal s:NotifySearch()
en
endf
" - SetDefTxt() {{{1
fu! s:SetDefTxt()
......@@ -2609,6 +2612,10 @@ fu! ctrlp#clearmarkedlist()
let s:marked = {}
endf
fu! ctrlp#input()
retu s:getinput()
endf
fu! ctrlp#exit()
cal s:PrtExit()
endf
......@@ -2735,8 +2742,21 @@ fu! ctrlp#init(type, ...)
en
cal s:BuildPrompt(1)
if s:keyloop | cal s:KeyLoop() | en
return 1
retu 1
endf
" - Events {{{1
fu! s:NotifySearch()
let l:cb = s:getextvar('search')
if l:cb != -1
cal eval(l:cb)
en
endf
fu! ctrlp#update()
cal s:ForceUpdate()
endf
" - Autocmds {{{1
if has('autocmd')
aug CtrlPAug
......
neocomplete
===========
Note: This plugin is not compatible with above Vim 8.2.1066!
https://github.com/vim/vim/commit/bd84617d1a6766efd59c94aabebb044bef805b99
**Note**: Active development on neocomplete.vim has stopped. The only future
changes will be bug fixes.
......
......@@ -41,6 +41,12 @@ function! neocomplete#init#enable() abort "{{{
return
endif
if has('patch-8.2.1066')
echomsg 'neocomplete does not work with this version of Vim.'
echomsg 'Vim 8.2.1066 is not backwards compatible.'
return
endif
if !exists('b:neocomplete')
call neocomplete#init#_current_neocomplete()
endif
......
......@@ -47,6 +47,9 @@ FAQ |neocomplete-faq|
==============================================================================
INTRODUCTION *neocomplete-introduction*
Note: This plugin is not compatible with above Vim 8.2.1066!
https://github.com/vim/vim/commit/bd84617d1a6766efd59c94aabebb044bef805b99
*neocomplete* is the next generation auto completion framework and a superior
successor of the |neocomplcache| plugin. It provides a keyword completion
system by maintaining a keyword cache of the current buffer. The neocomplete
......
......@@ -53,7 +53,7 @@ nmap <F8> :TagbarToggle<CR>
If you do this the F8 key will toggle the Tagbar window. You can of course use
any shortcut you want. For more flexible ways to open and close the window
(and the rest of the functionality) see the documentation.
(and the rest of the functionality) see the [documentation](https://github.com/majutsushi/tagbar/blob/master/doc/tagbar.txt) using `:help tagbar`.
## Support for additional filetypes
......@@ -87,7 +87,7 @@ against Tagbar](https://github.com/majutsushi/tagbar/issues?labels=ctags-bug&pag
## License
Tagbar is distributed under the terms of the *Vim license*, see the included [LICENSE][] file.
Tagbar is distributed under the terms of the *Vim license*, see the included [LICENSE](LICENSE) file.
## Contributors
......
......@@ -1182,29 +1182,34 @@ function! s:ProcessFile(fname, ftype) abort
call tagbar#debug#log('typeinfo for file to process: ' . string(typeinfo))
" Use a temporary files for ctags processing instead of the original one.
" This allows using Tagbar for files accessed with netrw, and also doesn't
" slow down Tagbar for files that sit on slow network drives.
let tempfile = tempname()
let ext = fnamemodify(fileinfo.fpath, ':e')
if ext !=# ''
let tempfile .= '.' . ext
endif
call tagbar#debug#log('Caching file into: ' . tempfile)
let templines = getbufline(fileinfo.bufnr, 1, '$')
let res = writefile(templines, tempfile)
if res != 0
call tagbar#debug#log('Could not create copy '.tempfile)
return
endif
let fileinfo.mtime = getftime(tempfile)
if g:tagbar_use_cache
" Use a temporary files for ctags processing instead of the original one.
" This allows using Tagbar for files accessed with netrw, and also doesn't
" slow down Tagbar for files that sit on slow network drives.
let tempfile = tempname()
let ext = fnamemodify(fileinfo.fpath, ':e')
if ext !=# ''
let tempfile .= '.' . ext
endif
call tagbar#debug#log('Caching file into: ' . tempfile)
let templines = getbufline(fileinfo.bufnr, 1, '$')
let res = writefile(templines, tempfile)
if res != 0
call tagbar#debug#log('Could not create copy '.tempfile)
return
endif
let fileinfo.mtime = getftime(tempfile)
let ctags_output = s:ExecuteCtagsOnFile(tempfile, a:fname, typeinfo)
let ctags_output = s:ExecuteCtagsOnFile(tempfile, a:fname, typeinfo)
if !tagbar#debug#enabled()
call delete(tempfile)
if !tagbar#debug#enabled()
call delete(tempfile)
endif
else
call tagbar#debug#log('File caching disabled')
let ctags_output = s:ExecuteCtagsOnFile(a:fname, a:fname, typeinfo)
endif
if ctags_output == -1
......@@ -1362,7 +1367,7 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
let ctags_output = s:ExecuteCtags(ctags_cmd)
if v:shell_error || ctags_output =~? 'Warning: cannot open source file'
if v:shell_error || ctags_output =~? 'Warning: cannot open \(source\|input\) file'
call tagbar#debug#log('Command output:')
call tagbar#debug#log(ctags_output)
call tagbar#debug#log('Exit code: ' . v:shell_error)
......@@ -2255,6 +2260,9 @@ function! s:JumpToTag(stay_in_tagbar) abort
if s:pwin_by_tagbar
pclose
endif
if s:is_maximized
call s:ZoomWindow()
endif
call s:HighlightTag(0)
endif
endfunction
......@@ -2866,6 +2874,39 @@ function! s:EscapeCtagsCmd(ctags_bin, args, ...) abort
return ctags_cmd
endfunction
" run shell command in a proper way: prevent temporary window creation
function! s:run_system(cmd, version) abort
if has('win32') && !has('nvim') && a:version > 0 && (has('python3') || has('python2'))
if a:version == 3 && has('python3')
let pyx = 'py3 '
let python_eval = 'py3eval'
elseif a:version == 2 && has('python2')
let pyx = 'py2 '
let python_eval = 'pyeval'
else
let pyx = 'pyx '
let python_eval = 'pyxeval'
endif
let l:pc = 0
exec pyx . 'import subprocess, vim'
exec pyx . '__argv = {"args":vim.eval("a:cmd"), "shell":True}'
exec pyx . '__argv["stdout"] = subprocess.PIPE'
exec pyx . '__argv["stderr"] = subprocess.STDOUT'
exec pyx . '__pp = subprocess.Popen(**__argv)'
exec pyx . '__return_text = __pp.stdout.read()'
exec pyx . '__pp.stdout.close()'
exec pyx . '__return_code = __pp.wait()'
exec 'let l:hr = '. python_eval .'("__return_text")'
exec 'let l:pc = '. python_eval .'("__return_code")'
let s:shell_error = l:pc
return l:hr
endif
let hr = system(a:cmd)
let s:shell_error = v:shell_error
return hr
endfunction
" s:ExecuteCtags() {{{2
" Execute ctags with necessary shell settings
" Partially based on the discussion at
......@@ -2903,7 +2944,8 @@ function! s:ExecuteCtags(ctags_cmd) abort
call tagbar#debug#log('Exit code: ' . v:shell_error)
redraw!
else
silent let ctags_output = system(a:ctags_cmd)
let py_version = get(g:, 'tagbar_python', 1)
silent let ctags_output = s:run_system(a:ctags_cmd, py_version)
endif
if &shell =~? 'cmd\.exe'
......@@ -3371,6 +3413,18 @@ endfunction
" s:goto_win() {{{2
function! s:goto_win(winnr, ...) abort
"Do not go to a popup window to avoid errors.
"Hence, check first if a:winnr is an integer,
"if this integer is equal to 0,
"the window is a popup window
if has('popupwin')
if type(a:winnr) == type(0) && a:winnr == 0
return
endif
if a:winnr ==# 'p' && winnr('#') == 0
return
endif
endif
let cmd = type(a:winnr) == type(0) ? a:winnr . 'wincmd w'
\ : 'wincmd ' . a:winnr
let noauto = a:0 > 0 ? a:1 : 0
......
......@@ -103,6 +103,10 @@ The following features are supported by Tagbar:
Fortran, HTML, Java, JavaScript, Lisp, Lua, Make, MatLab, OCaml, Pascal,
Perl, PHP, Python, REXX, Ruby, Scheme, Shell script, SLang, SML, SQL, Tcl,
Tex, Vera, Verilog, VHDL, Vim and YACC.
- Additional languages are supported through universal-ctags, including
CUDA, R, Rust, Go, and many others. See
https://github.com/universal-ctags/ctags/blob/master/docs/news.rst#new-parsers
for the complete list.
- Can be extended to support arbitrary new types.
------------------------------------------------------------------------------
......@@ -123,12 +127,13 @@ The following requirements have to be met in order to be able to use tagbar:
- Vim 7.0 or higher. Older versions will not work since Tagbar uses data
structures that were only introduced in Vim 7.
- Exuberant ctags 5.5 or higher. Ctags is the program that generates the
tag information that Tagbar uses. It is shipped with most Linux
distributions, otherwise it can be downloaded from the following
website:
- At a minimum Exuberant Ctags >= 5.5, or (highly recommended) any version
of Universal Ctags which is a currently maintained fork of Exuberant Ctags
with many bugfixes, support for many more formats, and proper Unicode
support. Some additional formats can also be handled by other providers
such as jsctags, phpctags, or others.
http://ctags.sourceforge.net/
Universal Ctags can be downloaded from https://ctags.io/
Tagbar will work on any platform that ctags runs on -- this includes
UNIX derivatives, Mac OS X and Windows. Note that other versions like
......@@ -784,6 +789,24 @@ about the tag is echoed out. Set this option to disable that behavior.
Example:
>
let g:tagbar_silent = 1
*g:tagbar_use_cache*
g:tagbar_use_cache~
Default: 1
By default the file contents are passed to ctags by writing them to
a temporary file and invoking ctags on that file. This greatly speeds up tag
generation in the event of slow file systems such as network shares and
enables tagbar to run even on netrw virtual files that ctags would otherwise
not be able to find at all. However it does incure the cost of an extra write
operation. Additionally not all sysems are able to let programs share access
to temporary file space (for example Snap packages cannot read from the host
system's temp file space). This setting can disable the cache mechanism
entriely forcing the tags to be generated from the existing copy of the file
on disk rather than the current buffer written to a temporary file.
Example:
>
let g:tagbar_use_cache = 0
<
------------------------------------------------------------------------------
......
......@@ -77,6 +77,7 @@ function! s:setup_options() abort
\ ['width', 40],
\ ['zoomwidth', 1],
\ ['silent', 0],
\ ['use_cache', 1],
\ ]
for [opt, val] in options
......
......@@ -2,6 +2,10 @@ sudo: required
services: docker
env:
- VIM_VERSION="7.4" PYTHON_IMAGE=3.5-stretch TAG=vim_74_py35
- VIM_VERSION="8.0" PYTHON_IMAGE=3.5-stretch TAG=vim_80_py35
- VIM_VERSION="8.1" PYTHON_IMAGE=3.5-stretch TAG=vim_81_py35
- VIM_VERSION="git" PYTHON_IMAGE=3.5-stretch TAG=vim_git_py35
- VIM_VERSION="7.4" PYTHON_IMAGE=3.6-stretch TAG=vim_74_py36
- VIM_VERSION="8.0" PYTHON_IMAGE=3.6-stretch TAG=vim_80_py36
- VIM_VERSION="8.1" PYTHON_IMAGE=3.6-stretch TAG=vim_81_py36
......
......@@ -2,6 +2,14 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir ${MAKEFILE_PATH})
# Test images as run on CI.
image_vim_74_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=7.4 .
image_vim_80_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=8.0 .
image_vim_81_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=8.1 .
image_vim_git_py35:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.5-stretch --build-arg VIM_VERSION=git .
image_vim_74_py36:
docker build -t ultisnips:$@ --build-arg PYTHON_IMAGE=3.6-stretch --build-arg VIM_VERSION=7.4 .
image_vim_80_py36:
......
......@@ -23,7 +23,7 @@ def find_snippet_files(ft, directory):
"""Returns all matching snippet files for 'ft' in 'directory'."""
patterns = ["%s.snippets", "%s_*.snippets", os.path.join("%s", "*")]
ret = set()
directory = os.path.expanduser(directory)
directory = os.path.expanduser(str(directory))
for pattern in patterns:
for fn in glob.glob(os.path.join(directory, pattern % ft)):
ret.add(normalize_file_path(fn))
......@@ -42,7 +42,7 @@ def find_all_snippet_directories():
if len(snippet_dirs) == 1:
# To reduce confusion and increase consistency with
# `UltiSnipsSnippetsDir`, we expand ~ here too.
full_path = os.path.expanduser(snippet_dirs[0])
full_path = os.path.expanduser(str(snippet_dirs[0]))
if os.path.isabs(full_path):
return [full_path]
......@@ -57,7 +57,7 @@ def find_all_snippet_directories():
"directory for UltiSnips snippets."
)
pth = normalize_file_path(
os.path.expanduser(os.path.join(rtp, snippet_dir))
os.path.expanduser(str(os.path.join(rtp, snippet_dir)))
)
all_dirs.append(pth)
return all_dirs
......
......@@ -481,12 +481,13 @@ class SnippetManager:
vim_helper.command("augroup UltiSnips")
vim_helper.command("autocmd!")
vim_helper.command("augroup END")
self._inner_state_up = False
except vim_helper.error:
# This happens when a preview window was opened. This issues
# CursorMoved, but not BufLeave. We have no way to unmap, until we
# are back in our buffer
pass
finally:
self._inner_state_up = False
@err_to_scratch_buffer.wrap
def _save_last_visual_selection(self):
......
......@@ -31,7 +31,7 @@ endtry
" Comments {{{2
syn match snipComment "^#.*" contains=snipTODO display
syn match snipComment "^#.*" contains=snipTODO,@Spell display
syn keyword snipTODO contained display FIXME NOTE NOTES TODO XXX
" Errors {{{2
......
......@@ -21,7 +21,6 @@ improvements:
enter on a line to view the commit where the line changed, or `g?` to see
other available maps. Omit the filename argument and the currently edited
file will be blamed in a vertical, scroll-bound split.
* `:Git grep` loads matches into the quickfix list, just like `:grep`.
* `:Git mergetool` and `:Git difftool` load their changesets into the quickfix
list.
* Called with no arguments, `:Git` opens a summary window with dirty files and
......@@ -48,6 +47,7 @@ Additional commands are provided for higher level operations:
* `:Gwrite` writes to both the work tree and index versions of a file, making
it like `git add` when called from a work tree file and like `git checkout`
when called from the index or a blob in history.
* `:Ggrep` is `:grep` for `git grep`. `:Glgrep` is `:lgrep` for the same.
* `:GMove` does a `git mv` on the current file and changes the buffer name to
match. `:GRename` does the same with a destination filename relative to the
current file's directory.
......
......@@ -100,6 +100,9 @@ that are part of Git repositories).
|quickfix| list. Jumps to the first commit unless [!]
is given.
The quickfix list can be slow and awkward for many use
cases. Consider using |:Git| log instead.
:{range}Gclog[!] [args] Use git-log -L to load previous revisions of the given
range of the current file into the |quickfix| list.
The cursor is positioned on the first line of the
......
......@@ -437,9 +437,9 @@ unlet s:cmd
exe "command! -bar -bang -nargs=? -complete=customlist,fugitive#CdComplete Gcd exe fugitive#Cd(<q-args>, 0)"
exe "command! -bar -bang -nargs=? -complete=customlist,fugitive#CdComplete Glcd exe fugitive#Cd(<q-args>, 1)"
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Ggrep exe fugitive#Command(<line1>, <count>, +"<range>", <bang>0, "<mods>", "grep " . <q-args>)'
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Gcgrep exe fugitive#Command(<line1>, <count>, +"<range>", <bang>0, "<mods>", "grep " . <q-args>)'
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Glgrep exe fugitive#Command(0, <count> > 0 ? <count> : 0, +"<range>", <bang>0, "<mods>", "grep " . <q-args>)'
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Ggrep exe fugitive#GrepCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Gcgrep exe fugitive#GrepCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Glgrep exe fugitive#GrepCommand(0, <count> > 0 ? <count> : 0, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Glog :exe fugitive#LogCommand(<line1>,<count>,+"<range>",<bang>0,"<mods>",<q-args>, "")'
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Gclog :exe fugitive#LogCommand(<line1>,<count>,+"<range>",<bang>0,"<mods>",<q-args>, "c")'
......
......@@ -8,6 +8,9 @@ syn spell notoplevel
syn include @fugitiveDiff syntax/diff.vim
syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
syn match fugitiveBareHeader /^Bare:/
syn match fugitiveHelpHeader /^Help:/ nextgroup=fugitiveHelpTag skipwhite
syn match fugitiveHelpTag /\S\+/ contained
syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/
syn cluster fugitiveSection contains=fugitiveSection
......@@ -20,8 +23,8 @@ syn match fugitiveDone /^done\>/ contained containedin=@fugitiveSection nextgrou
syn match fugitiveStop /^stop\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
syn match fugitiveModifier /^[MADRCU?]\{1,2} / contained containedin=@fugitiveSection
syn match fugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@<!/ contained
syn match fugitiveHash /^\x\{4,\}\>/ contained containedin=@fugitiveSection
syn match fugitiveHash /\<\x\{4,\}\>/ contained
syn match fugitiveHash /^\x\{4,\}\S\@!/ contained containedin=@fugitiveSection
syn match fugitiveHash /\S\@<!\x\{4,\}\S\@!/ contained
syn region fugitiveHunk start=/^\%(@@\+ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=@fugitiveSection fold
......@@ -33,7 +36,10 @@ for s:section in ['Untracked', 'Unstaged', 'Staged']
endfor
unlet s:section
hi def link fugitiveBareHeader fugitiveHeader
hi def link fugitiveHelpHeader fugitiveHeader
hi def link fugitiveHeader Label
hi def link fugitiveHelpTag Tag
hi def link fugitiveHeading PreProc
hi def link fugitiveUntrackedHeading PreCondit
hi def link fugitiveUnstagedHeading Macro
......
......@@ -4,3 +4,5 @@
.dlv/
.git/
.viminfo
issues/
autoload/go/**/pkg/
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: install tools
run: $GITHUB_WORKSPACE/scripts/install-tools 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: install tools
run: $GITHUB_WORKSPACE/scripts/install-tools ${{ 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
*.pyc
.DS_Store
/doc/tags
/.bash_history
/.cache
/.config
/.coverage.covimerage
/.local
/.viminfo
/coverage.xml
*.pyc
/doc/tags
/issues
language: go
go:
- 1.14
notifications:
email: false
matrix:
include:
- env: SCRIPT="test -c" VIM_VERSION=vim-8.0
- env: SCRIPT="test -c" VIM_VERSION=vim-8.2
- env: SCRIPT="test -c" VIM_VERSION=nvim
- env: ENV=vimlint SCRIPT=lint VIM_VERSION=vim-8.2
language: python
python: 3.6
install:
- ./scripts/install-vim $VIM_VERSION
- |
if [ "$ENV" = "vimlint" ]; then
pip install vim-vint covimerage==0.2.1 codecov pathlib
else
pip install --user vim-vint covimerage==0.2.1 codecov pathlib
fi
script:
- ./scripts/$SCRIPT $VIM_VERSION
This diff is collapsed.
......@@ -10,11 +10,18 @@ RUN pip3 install vim-vint
RUN useradd -ms /bin/bash -d /vim-go vim-go
USER vim-go
COPY . /vim-go/
COPY scripts/install-vim /vim-go/scripts/install-vim
WORKDIR /vim-go
RUN scripts/install-vim vim-8.0
RUN scripts/install-vim vim-8.2
RUN scripts/install-vim nvim
COPY . /vim-go/
WORKDIR /vim-go
RUN scripts/install-tools vim-8.0
RUN scripts/install-tools vim-8.2
RUN scripts/install-tools nvim
ENTRYPOINT ["make"]
......@@ -6,6 +6,7 @@ install:
@echo "==> Installing Vims: $(VIMS)"
@for vim in $(VIMS); do \
./scripts/install-vim $$vim; \
./scripts/install-tools $$vim; \
done
test:
......
# vim-go [![Build Status](http://img.shields.io/travis/fatih/vim-go.svg?style=flat-square)](https://travis-ci.org/fatih/vim-go)
# 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)
<p align="center">
<img style="float: right;" src="assets/vim-go.png" alt="Vim-go logo"/>
......@@ -13,8 +15,8 @@ This plugin adds Go language support for Vim, with the following main features:
* Quickly execute your current file(s) with `:GoRun`.
* Improved syntax highlighting and folding.
* Debug programs with integrated `delve` support with `:GoDebugStart`.
* Completion support via `gopls`.
* `gofmt` or `goimports` on save keeps the cursor position and undo history.
* 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`.
......@@ -30,10 +32,12 @@ This plugin adds Go language support for Vim, with the following main features:
`: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.3.1.
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,
......
......@@ -57,15 +57,15 @@ function! s:echo_go_info()
endif
let item = v:completed_item
if !has_key(item, "info")
if !has_key(item, "user_data")
return
endif
if empty(item.info)
if empty(item.user_data)
return
endif
redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None
redraws! | echo "vim-go: " | echohl Function | echon item.user_data | echohl None
endfunction
let s:timer_id = 0
......@@ -133,11 +133,28 @@ function! s:handler(timer_id)
endfunction
function! go#auto#fmt_autosave()
if !(go#config#FmtAutosave() && isdirectory(expand('%:p:h')) && expand('<afile>:p') == expand('%:p'))
if !(isdirectory(expand('%:p:h')) && expand('<afile>: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
" Go code formatting on save
call go#fmt#Format(-1)
endfunction
......
......@@ -125,7 +125,7 @@ function! go#cmd#RunTerm(bang, mode, files) abort
if empty(a:files)
call extend(cmd, go#tool#Files())
else
call extend(cmd, map(copy(a:files), "expand(v:val)"))
call extend(cmd, map(copy(a:files), funcref('s:expandRunArgs')))
endif
call go#term#newmode(a:bang, cmd, s:runerrorformat(), a:mode)
endfunction
......@@ -163,7 +163,7 @@ function! go#cmd#Run(bang, ...) abort
if a:0 == 0
let l:files = go#tool#Files()
else
let l:files = map(copy(a:000), "expand(v:val)")
let l:files = map(copy(a:000), funcref('s:expandRunArgs'))
endif
let l:cmd = l:cmd + l:files
......@@ -174,7 +174,7 @@ function! go#cmd#Run(bang, ...) abort
if go#util#IsWin()
try
if go#util#HasDebug('shell-commands')
call go#util#EchoInfo('shell command: ' . l:cmd)
call go#util#EchoInfo(printf('shell command: %s', string(l:cmd)))
endif
execute l:cd . fnameescape(expand("%:p:h"))
......@@ -354,6 +354,18 @@ function! s:runerrorformat()
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 |
" ---------------------
......
......@@ -168,8 +168,8 @@ function! go#config#EchoCommandInfo() abort
endfunction
function! go#config#DocUrl() abort
let godoc_url = get(g:, 'go_doc_url', 'https://godoc.org')
if godoc_url isnot 'https://godoc.org'
let godoc_url = get(g:, 'go_doc_url', 'https://pkg.go.dev')
if godoc_url isnot 'https://pkg.go.dev'
" strip last '/' character if available
let last_char = strlen(godoc_url) - 1
if godoc_url[last_char] == '/'
......@@ -264,23 +264,11 @@ function! go#config#MetalinterCommand() abort
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)
return get(g:, "go_metalinter_autosave_enabled", ["govet", "golint"])
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)
return get(g:, "go_metalinter_enabled", ["vet", "golint", "errcheck"])
endfunction
function! go#config#GolintBin() abort
......@@ -307,6 +295,10 @@ 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
......@@ -351,6 +343,10 @@ 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
......@@ -373,7 +369,7 @@ function! go#config#RenameCommand() abort
endfunction
function! go#config#GorenameBin() abort
return get(g:, "go_gorename_bin", "gorename")
return get(g:, "go_gorename_bin", "gopls")
endfunction
function! go#config#GorenamePrefill() abort
......@@ -498,6 +494,10 @@ function! go#config#CodeCompletionEnabled() abort
return get(g:, "go_code_completion_enabled", 1)
endfunction
function! go#config#CodeCompletionIcase() abort
return get(g:, "go_code_completion_icase", 0)
endfunction
function! go#config#Updatetime() abort
let go_updatetime = get(g:, 'go_updatetime', 800)
return go_updatetime == 0 ? &updatetime : go_updatetime
......@@ -507,6 +507,10 @@ 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
......@@ -534,6 +538,14 @@ 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
......@@ -543,7 +555,7 @@ function! go#config#DiagnosticsEnabled() abort
endfunction
function! go#config#GoplsOptions() abort
return get(g:, 'go_gopls_options', [])
return get(g:, 'go_gopls_options', ['-remote=auto'])
endfunction
" Set the default value. A value of "1" is a shortcut for this, for
......
......@@ -172,7 +172,7 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort
" 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))
call win_gotoid(bufwinid(filename))
else
if &modified
let cmd = 'hide edit'
......
......@@ -6,40 +6,25 @@
let s:cpo_save = &cpo
set cpo&vim
scriptencoding utf-8
let s:buf_nr = -1
function! go#doc#OpenBrowser(...) abort
" check if we have gogetdoc as it gives us more and accurate information.
" Only supported if we have json_decode as it's not worth to parse the plain
" non-json output of gogetdoc
let bin_path = go#path#CheckBinPath('gogetdoc')
if !empty(bin_path) && exists('*json_decode')
let [l:json_out, l:err] = s:gogetdoc(1)
if len(a:000) == 0
let [l:out, l:err] = go#lsp#DocLink()
if l:err
call go#util#EchoError(json_out)
call go#util#EchoError(l:out)
return
endif
let out = json_decode(json_out)
if type(out) != type({})
call go#util#EchoError("gogetdoc output is malformed")
if len(l:out) == 0
call go#util#EchoWarning("could not path for doc URL")
endif
let import = out["import"]
let name = out["name"]
let decl = out["decl"]
let godoc_url = go#config#DocUrl()
let godoc_url .= "/" . import
if decl !~ '^package'
let anchor = name
if decl =~ '^func ('
let anchor = substitute(decl, '^func ([^ ]\+ \*\?\([^)]\+\)) ' . name . '(.*', '\1', '') . "." . name
endif
let godoc_url .= "#" . anchor
endif
let l:godoc_url = printf('%s/%s', go#config#DocUrl(), l:out)
call go#util#OpenBrowser(godoc_url)
call go#util#OpenBrowser(l:godoc_url)
return
endif
......@@ -52,7 +37,7 @@ function! go#doc#OpenBrowser(...) abort
let exported_name = pkgs[1]
" example url: https://godoc.org/github.com/fatih/set#Set
let godoc_url = go#config#DocUrl() . "/" . pkg . "#" . exported_name
let godoc_url = printf('%s/%s#%s', go#config#DocUrl(), pkg, exported_name)
call go#util#OpenBrowser(godoc_url)
endfunction
......@@ -60,11 +45,8 @@ 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: run gogetdoc on cursor position.
let [l:out, l:err] = s:gogetdoc(0)
if out == -1
return
endif
else " Without argument: use gopls to get documentation
let [l:out, l:err] = go#lsp#Doc()
endif
if l:err
......@@ -72,7 +54,7 @@ function! go#doc#Open(newmode, mode, ...) abort
return
endif
call s:GodocView(a:newmode, a:mode, out)
call s:GodocView(a:newmode, a:mode, l:out)
endfunction
function! s:GodocView(newposition, position, content) abort
......@@ -81,10 +63,14 @@ function! s:GodocView(newposition, position, content) abort
if exists('*popup_atcursor') && exists('*popup_clear')
call popup_clear()
let borderchars = ['-', '|', '-', '|', '+', '+', '+', '+']
if &encoding == "utf-8"
let borderchars = ['─', '│', '─', '│', '┌', '┐', '┘', '└']
endif
call popup_atcursor(split(a:content, '\n'), {
\ 'padding': [1, 1, 1, 1],
\ 'borderchars': ['-','|','-','|','+','+','+','+'],
\ "border": [1, 1, 1, 1],
\ 'borderchars': borderchars,
\ 'border': [1, 1, 1, 1],
\ })
elseif has('nvim') && exists('*nvim_open_win')
let lines = split(a:content, '\n')
......@@ -181,23 +167,6 @@ function! s:GodocView(newposition, position, content) abort
nnoremap <buffer> <silent> <Esc>[ <Esc>[
endfunction
function! s:gogetdoc(json) abort
let l:cmd = [
\ 'gogetdoc',
\ '-tags', go#config#BuildTags(),
\ '-pos', expand("%:p:gs!\\!/!") . ':#' . go#util#OffsetCursor()]
if a:json
let l:cmd += ['-json']
endif
if &modified
let l:cmd += ['-modified']
return go#util#Exec(l:cmd, go#util#archive())
endif
return go#util#Exec(l:cmd)
endfunction
" returns the package and exported name. exported name might be empty.
" ie: fmt and Println
" ie: github.com/fatih/set and New
......
......@@ -20,10 +20,24 @@ set cpo&vim
function! go#fmt#Format(withGoimport) abort
let l:bin_name = go#config#FmtCommand()
if a:withGoimport == 1
let l:bin_name = "goimports"
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
......@@ -128,18 +142,7 @@ function! go#fmt#update_file(source, target)
let &fileformat = old_fileformat
let &syntax = &syntax
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"
call go#list#Clean(l:listtype)
endif
call go#fmt#CleanErrors()
endfunction
" run runs the gofmt/goimport command for the given source file and returns
......@@ -181,6 +184,21 @@ function! s:replace_filename(filename, content) abort
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
......
......@@ -35,7 +35,7 @@ func! Test_update_file() abort
endfunc
func! Test_goimports() abort
let $GOPATH = 'test-fixtures/fmt/'
let $GOPATH = printf('%s/%s', fnamemodify(getcwd(), ':p'), 'test-fixtures/fmt')
let actual_file = tempname()
call writefile(readfile("test-fixtures/fmt/src/imports/goimports.go"), actual_file)
......@@ -50,71 +50,6 @@ func! Test_goimports() abort
call assert_equal(expected, actual)
endfunc
func! Test_run_fmt_gopls() abort
try
let g:go_fmt_command = 'gopls'
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)
finally
unlet g:go_fmt_command
endtry
endfunc
func! Test_update_file_gopls() abort
try
let g:go_fmt_command = 'gopls'
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)
finally
unlet g:go_fmt_command
endtry
endfunc
func! Test_goimports_gopls() abort
try
let g:go_fmt_command = 'gopls'
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)
finally
unlet g:go_fmt_command
endtry
endfunc
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save
......
" 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
......@@ -82,7 +82,7 @@ function! go#import#SwitchImport(enabled, localname, path, bang) abort
while line <= line("$")
let line = line + 1
let linestr = getline(line)
let m = matchlist(getline(line), '^\()\|\(\s\+\)\(\S*\s*\)"\(.\+\)"\)')
let m = matchlist(getline(line), '^\()\|\(\s\+\)\(\w\+\s\+\)\="\(.\+\)"\)')
if empty(m)
if siteprefix == "" && a:enabled
" must be in the first group
......
" 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
......@@ -83,9 +83,11 @@ function! go#lint#Gometa(bang, autosave, ...) abort
endif
if a:autosave
let l:listtype = go#list#Type("GoMetaLinterAutoSave")
let l:listtype = go#list#Type('GoMetaLinterAutoSave')
let l:for = 'GoMetaLinterAutoSave'
else
let l:listtype = go#list#Type("GoMetaLinter")
let l:listtype = go#list#Type('GoMetaLinter')
let l:for = 'GoMetaLinterAuto'
endif
if l:err == 0
......@@ -100,7 +102,7 @@ function! go#lint#Gometa(bang, autosave, ...) abort
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, 'GoMetaLinter', s:preserveerrors(a:autosave, l:listtype))
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))
......@@ -175,12 +177,12 @@ function! go#lint#Golint(bang, ...) abort
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())
let l:listtype = go#list#Type("GoLint")
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))
......@@ -194,6 +196,7 @@ function! go#lint#Golint(bang, ...) abort
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
......@@ -201,8 +204,8 @@ function! go#lint#Golint(bang, ...) abort
call go#statusline#Update(expand('%:p:h'), l:status)
endfunction
" Vet calls 'go vet' on the current directory. Any warnings are populated in
" the location list
" 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()
......@@ -247,7 +250,12 @@ function! go#lint#Vet(bang, ...) abort
let l:winid = win_getid(winnr())
let l:errorformat = "%-Gexit status %\\d%\\+," . &errorformat
call go#list#ParseFormat(l:listtype, l:errorformat, out, "GoVet", 0)
let l:dir = 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)
......@@ -370,15 +378,15 @@ function! s:lint_job(metalinter, args, bang, autosave)
let l:opts = {
\ 'statustype': a:args.statustype,
\ 'errorformat': a:args.errformat,
\ 'for': "GoMetaLinter",
\ 'for': 'GoMetaLinter',
\ 'bang': a:bang,
\ }
if a:autosave
let l:opts.for = "GoMetaLinterAutoSave"
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 = function('s:preserveerrors')
let l:opts.preserveerrors = funcref('s:preserveerrors', [a:autosave])
endif
" autowrite is not enabled for jobs
......@@ -444,13 +452,13 @@ function! s:errorformat(metalinter) abort
" 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'
return '%f:%l:%c:%t:\ %m,%f:%l:%c::\ %m,%f:%l::%t:\ %m'
endif
endfunction
function! s:preserveerrors(listtype) abort
return a:listtype == go#list#Type("GoFmt") && go#config#FmtAutosave() && isdirectory(expand('%:p:h'))
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
......
......@@ -163,7 +163,8 @@ let s:default_list_type_commands = {
\ "GoRun": "quickfix",
\ "GoTest": "quickfix",
\ "GoVet": "quickfix",
\ "GoReferrers": "quickfix",
\ "GoReferrers": "locationlist",
\ "GoImplements": "locationlist",
\ "_guru": "locationlist",
\ "_term": "locationlist",
\ "_job": "locationlist",
......
......@@ -26,6 +26,13 @@ function! go#lsp#message#Initialize(wd) abort
\ 'snippetSupport': go#config#GoplsUsePlaceholders() ? v:true : v:false,
\ },
\ },
\ 'codeAction': {
\ 'codeActionLiteralSupport': {
\ 'codeActionKind': {
\ 'valueSet': ['source.organizeImports'],
\ },
\ },
\ },
\ }
\ },
\ 'workspaceFolders': [s:workspaceFolder(0, a:wd)],
......@@ -63,6 +70,29 @@ function! go#lsp#message#Format(file) abort
\ }
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)