ray-x / go.nvim

G'day Nvimer, Joyful Gopher: Discover the Feature-Rich Go Plugin for Neovim
MIT License
1.9k stars 119 forks source link

GoTest execution changes makeprg #449

Open IlyasYOY opened 2 months ago

IlyasYOY commented 2 months ago

As a user I want to be able:

You can reproduce the issue here: https://github.com/IlyasYOY/go-retry/

Steps:

I expect running make's verify goal, but get:

:!go test verify 2>&1| tee /var/folders/f2/s841xw414zqfscfkvn76cfv40000gn/T/nvim.ilyasyoy/MYfAF5/5
package verify is not in std (/opt/homebrew/Cellar/go/1.22.2/libexec/src/verify)

(1 of 1): package verify is not in std (/opt/homebrew/Cellar/go/1.22.2/libexec/src/verify)

I found some clues in source code using "makeprg" search term: https://github.com/ray-x/go.nvim/blob/591a0b837420f27c734600fa5c6de87f18352e50/lua/go/gotest.lua#L282. Seems like a few commands change "makeprg" thus changing "makeprg" for the user. I tried to use float term to run commands and it works now, but I'd rather prefer old UX w/o running floating terminal.

I guess we might be able to same currently used "makeprg" and reset it after the job is done.

PS. Thanks for this plugin! I use it every day! I'd be glad to work on a solution if you think it may (or should) be fixed

IlyasYOY commented 2 months ago

small workaround on client side: https://github.com/IlyasYOY/dotfiles/commit/ab97e8b862b4f2578c0845048d16bd1383e44324