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

GoDebugTest freezes nvim #2123

Closed
akupila opened this issue Jan 9, 2019 · 2 comments
Closed

GoDebugTest freezes nvim #2123

akupila opened this issue Jan 9, 2019 · 2 comments

Comments

@akupila
Copy link

akupila commented Jan 9, 2019

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

I attempted to debug a test with :GoDebugTest but neovim froze.

I did some digging and found that delve is not started with the correct package. If my project root is github.com/a/b, i open github.com/a/b/mypkg and attempt to debug it there, delve is started with github.com/a/b as the package. I found this by modifying debug.vim to print the package:

diff --git a/autoload/go/debug.vim b/autoload/go/debug.vim
index aeba4fd..798dfec 100644
--- a/autoload/go/debug.vim
+++ b/autoload/go/debug.vim
@@ -627,6 +627,8 @@ function! go#debug#Start(is_test, ...) abort
       let l:args = ['--'] + a:000[1:]
     endif
 
+    echo l:pkgname
+
     let l:cmd = [
           \ dlv,
           \ (a:is_test ? 'test' : 'debug'),

The strange thing is that it did sometimes work correctly, without any (known) changes from my side. Still, this occurrence was rare and i've not been able to pin point any specific action i took to make it work.

:GoDebugStart works fine but it's different because it doesn't target the sub package. Also, explicitly passing the package works: :GoDebugTest github.com/a/b/mypkg.

Here's a repro repo: https://github.com/akupila/vim-go-debug

nvim -u init.vim pkg/foo_test.go

What did you expect to happen?

Delve should start and debug UI open, as with :GoDebugStart

What happened instead?

Neovim freezes (not able to get it to respond to any input)

Configuration (MUST fill this out):

  • vim-go version:
$  git rev-parse HEAD
74425f16e82e16932135557eea8b659152a77690
  • vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):
call plug#begin()
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
call plug#end()
  • Vim version (first three lines from :version):
:version
NVIM v0.3.3
Build type: Release
LuaJIT 2.0.5 
  • Go version (go version):

not applicable

  • Go environment (go env):

not applicable

bhcleek added a commit to bhcleek/vim-go that referenced this issue Jan 12, 2019
@bhcleek
Copy link
Collaborator

bhcleek commented Jan 12, 2019

@akupila Thank you for the bug report.

You identified an issue where Neovim could sometimes lock up. That's been resolved in #2125.

Without a package argument, both :GoDebugTest and :GoDebug target the package in the working directory, not the package of the current buffer. That's intentional: https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt#L1995-L1996

@akupila
Copy link
Author

akupila commented Jan 12, 2019

Oh, i completely missed that part in the doc. Thanks for the response! However, i would probably interpret current directory as the directory the file is in that i'm running the command from.

Confirmed your fix to the lock up works (although it's a bit strange to the user since there's no feedback)

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