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

wishlist: add support for a :GoDebugTestFunc command #2931

Closed
alexishevia opened this issue Jun 20, 2020 · 3 comments · Fixed by #3011
Closed

wishlist: add support for a :GoDebugTestFunc command #2931

alexishevia opened this issue Jun 20, 2020 · 3 comments · Fixed by #3011
Labels

Comments

@alexishevia
Copy link

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

Ran the :GoTestFunc command to run tests for the function under the cursor.

Since the tests failed, I wanted to debug the function to see where the issue was happening.

What did you expect to happen?

I expected there to be a :GoDebugTestFunc command, so I could start a debug session that ran the specific test under the cursor.

What happened instead?

Had to figure out the correct -test.run parameter to pass to :GoDebugTest.

I was eventually able to find it, but would have been a lot easier if a :GoDebugTestFunc (or similar) existed.

Configuration (MUST fill this out):

vim-go version: 33bf268

vimrc you used to reproduce: n/a

Vim version (first three lines from :version):

VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)
Included patches: 1-2269
Modified by [email protected]

Go version (go version):

go1.12.3 linux/amd64

Go environment

go env Output:
GOARCH="amd64"
GOBIN="/home/alexishevia/go/bin"
GOCACHE="/home/alexishevia/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/alexishevia/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-build378507522=/tmp/go-build -gno-record-gcc-switches"

gopls version

gopls version Output:
golang.org/x/tools/gopls 0.4.0
    golang.org/x/tools/[email protected] h1:G4+YP9kaV4dJb79J5MobyApxX493Qa6VoiTceUmxqik=
@bhcleek
Copy link
Collaborator

bhcleek commented Jun 20, 2020

:GoDebugTest would have worked for you, too, if you put a breakpoint in the test that you want to debug.

@bhcleek
Copy link
Collaborator

bhcleek commented Jun 20, 2020

The vim-go help is useful here, too. :help :GoDebugTest explicitly mentioned the test flags and explicitly calls out -test.run.

@alexishevia
Copy link
Author

hey @bhcleek , thanks for the answers.

What I'm trying to say is:
Even though the :GoTestFunc functionality can be achieved by running :GoTest with -run, there is value to having :GoTestFunc (it makes it easier/faster to run a specific test).

The same can be said of a :GoDebugTestFunc. Even though you could achieve the same with :GoDebugTest and -test.run, having a :GoDebugTestFunc would still have value because it makes it easier and faster to debug a specific test.

bhcleek added a commit to bhcleek/vim-go that referenced this issue Sep 7, 2020
bhcleek added a commit to bhcleek/vim-go that referenced this issue Sep 7, 2020
bhcleek added a commit to bhcleek/vim-go that referenced this issue Sep 7, 2020
bhcleek added a commit to bhcleek/vim-go that referenced this issue Sep 7, 2020
bhcleek added a commit to bhcleek/vim-go that referenced this issue Sep 8, 2020
bhcleek added a commit to bhcleek/vim-go that referenced this issue Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants