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

When going to definition it shows Error detected while processing function go#guru#SameIds #2162

Closed
jgimeno opened this issue Mar 8, 2019 · 5 comments

Comments

@jgimeno
Copy link

jgimeno commented Mar 8, 2019

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

Go to the definition of an interface, it works correctly but if I go several times ramdonly it fails. Once it fails the first time, it fails always until restart nvim.

When it fails and I do gd it shows on the bottom:

vim-go: [searching declaration] SUCCESS
Error detected while processing function go#guru#SameIds[27]..<SNR>151_run_guru[2]..<SNR>151_async_guru[31]..go#job#Options:
line  129:
E127: Cannot redefine function <SNR>163_exit_cb: It is in use

I press then enter and it goes to the definition.

What did you expect to happen?

Not show the error.

What happened instead?

Showed an error and after it it goes to the definition.

Configuration (MUST fill this out):

  • vim-go version: 1.19

  • Vim version (first three lines from :version):
    NVIM v0.3.4
    Build type: Release
    LuaJIT 2.0.5

  • Go version (go version):
    go version go1.12 darwin/amd64

  • Go environment (go env):

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jgimeno/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/jgimeno/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
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/lr/20v7hz1j5cnfrzxlyw47bw5r0000gn/T/go-build544694843=/tmp/go-build -gno-record-gcc-switches -fno-common"
@bhcleek
Copy link
Collaborator

bhcleek commented Mar 11, 2019

Do you have the same problem with latest master?

@bhcleek
Copy link
Collaborator

bhcleek commented Mar 23, 2019

closing due to lack of feedback

@bhcleek bhcleek closed this as completed Mar 23, 2019
@entombedvirus
Copy link
Contributor

I can repro this locally on vim-go master @ 5eab407

Steps to repro for me are:

  1. have both of these turned on:
let g:go_auto_sameids = 1
let g:go_auto_type_info = 1
  1. open nvim
  2. open any .go file
  3. place cursor over a method symbol
  4. press Ctrl-] to jump to defn. The jump succeeds without any errors
  5. press Ctrl-t to jump back
  6. press Ctrl-] again. This time this error shows up in the status area: Error detected while processing function go#guru#SameIds[27]..<SNR>117_run_guru[2]..<SNR>117_async_guru[31]..go#job#Options: After pressing enter, jump succeeds normally.

My env details:

  • NVIM v0.3.1
    Build type: Release
    LuaJIT 2.0.5

  • go version
    go version go1.11 linux/amd64

  • go env

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/rravi-1/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/rravi-1/.gotools:/home/rravi-1/analytics/go:/home/rravi-1/.gotools:/home/rravi-1/analytics/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build115200486=/tmp/go-build -gno-record-gcc-switches"

@bhcleek bhcleek reopened this Mar 23, 2019
bhcleek added a commit to bhcleek/vim-go that referenced this issue Mar 24, 2019
Move all script scoped function definitions within a function out of
those functions, because defining them within a function causes them to
be redefined each time the function is executed. When the previous
definition is still in use, errors can result.

Fixes fatih#2162
@bhcleek
Copy link
Collaborator

bhcleek commented Mar 24, 2019

Thank you for confirming @entombedvirus . With your steps and the vim-go settings you provided, I was able to identify the problem. Please open another issue if you find that it's still a problem for you.

@entombedvirus
Copy link
Contributor

Just updated to master @ 2a21c6a and confirm that the error no longer shows up. Thank you @bhcleek!

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

3 participants