Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctags /gotags stopped working #2496

Closed
ehrktia opened this issue Sep 17, 2019 · 5 comments
Closed

ctags /gotags stopped working #2496

ehrktia opened this issue Sep 17, 2019 · 5 comments

Comments

@ehrktia
Copy link

ehrktia commented Sep 17, 2019

What did you do? (required: The issue will be closed when not provided)

started new project outside $GOPATH and ran Ctags -R . command in terminal to generate tag file .
tag file was empty so added support to go in Ctags using custom ~/.ctags file.
Tag generation was successful after custom tag file .
when trying to jump to defn using C-] command the following error message is flashing
vim-go: initialized gopls vim-go: [definition] FAIL vim-go: method "textDocument/definition" did not reply

gopls

had updated gopls and re-tried no luck.
same with previous projects as well.
Tags stopped working completely.
NOTE - When manually grepped the tag file the required tag was present in the file.

What did you expect to happen?

expecting to jump to the tag generated.

What happened instead?

received error in message
vim-go: initialized gopls vim-go: [definition] FAIL vim-go: method "textDocument/definition" did not reply

Configuration (MUST fill this out):

osx -10.14.6
vim version :
VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 8 2019 07:17:45) macOS version Included patches: 1-1999 Compiled by Homebrew Huge version without GUI. Features included (+) or not (-):

vim-go version:

latest - v.1.2.1

vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):

vimrc


let g:go_updatetime = 800 let g:go_doc_keywordprg_enabled = 1 let g:go_doc_max_height = 20 let g:go_snippet_engine = "automatic" let g:go_get_update = 1 let g:go_def_mapping_enabled = 1 let g:go_list_type = "quickfix" let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck'] "let g:go_metalinter_command='golangci-lint' "Ultisnip mappings let g:UltisnipUsePythonVersion = 3 let g:UltiSnipsExpandTrigger="<c-j>" let g:UltiSnipsListSnippets="<c-tab>" let g:UltiSnipsJumpForwardTrigger="<c-h>" let g:UltiSnipsJumpBackwardTrigger="<c-k>" "Fugitive git leader mappings :nmap <Leader>gs :Gstatus<CR> :nmap <Leader>gd :GDoc :nmap <Leader>gb :Gbrowse<CR> :nmap <Leader>gpu :Gpush<CR> :nmap <Leader>gsd :Gsdiff<CR> :nmap <Leader>ga :Git add -- .<CR> "vimgo mappings let g:go_def_mode='gopls' let g:go_info_mode='gopls' :nmap <Leader>ga :GoAlternate<CR> autocmd FileType go nmap <leader>r <Plug>(go-run) autocmd FileType go nmap <leader>b <Plug>(go-build) autocmd FileType go nmap <Leader>c <Plug>(go-coverage-toggle) :nmap <Leader>gl :GoMetaLinter<CR> :nmap <Leader>gd :GoDebugStart<CR>

Vim version (first three lines from :version):

VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 8 2019 07:17:45) macOS version Included patches: 1-1999 Compiled by Homebrew Huge version without GUI. Features included (+) or not (-):

Go version (go version):

go version go1.13 darwin/amd64

Go environment

go env Output:
`GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/karthickayyapillai/Library/Caches/go-build"
GOENV="/Users/karthickayyapillai/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/karthickayyapillai/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wk/2mxs2gf122x1knb02422fwcw0000gn/T/go-build185965872=/tmp/go-build -gno-record-gcc-switches -fno-common"`
@bhcleek
Copy link
Collaborator

bhcleek commented Sep 17, 2019

vim-go doesn't use tags files for jumping to definitions.

Can you provide some more details on how to duplicate the error you're seeing? (e.g. path to a file to jump from and path to a file to jump to, perhaps a simple reproduction case with code).

How did you update gopls?

Finally, this might be related to golang/go#34298.

@ehrktia
Copy link
Author

ehrktia commented Sep 17, 2019

gopls
went in to $GOPATH in terminal and ran the following command
go get -u golang.org/x/tools/cmd/gopls
go install golang.org/x/tools/cmd/gopls
output of gopls version command
version v0.1.6-cmd.gopls, built in $GOPATH mode
thanks for link with related to GOVIM plugin. one more silly query can you please let me know the command to check the vim-go version in VIM.

@ehrktia
Copy link
Author

ehrktia commented Sep 17, 2019

thanks very much 👍 some how it started working again now.
i did install govim and remove it from system.
All went fine left the vimrc with C-] mapping i had created for govim.
please close this issue for now. i can understand govim and vim-go are taking different directions i need to follow either one not both.

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 17, 2019

Just FYI: installing gopls that way will install its master, which may be in a broken state. You can install using go get golang.org/x/tools/gopls@latest at the command line or :GoUpdateBinaries gopls from within vim with vim-go to install the latest release of gopls.

@bhcleek bhcleek closed this as completed Sep 17, 2019
@ehrktia
Copy link
Author

ehrktia commented Sep 18, 2019

thanks bhcleek for your additional info. sorry i did remove all my go plugins along with YCM & UltiSnips , now able to get everything back to working state and normal in case any one faces similar issue in future can follow same .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants