x/tools/gopls: "no ParseGoHandle for file.go" error from CodeAction #36608
Comments
To add a bit of colour, contrasting between a run of this test that succeeds and fails. Here is a section of the
Now the failure case:
Notice in the failure case there are no This could of course be a coincidence and the success/failure might be entirely a function of the |
This is actually incorrect. |
Ok, I was able to reproduce this locally. You're right that this seems exactly like the earlier bug. @heschik will not be pleased... Writing down the repro steps here so that I can figure out how to do it again. $ export GOVIM_TESTSCRIPT_WORKDIR_ROOT=$(mktemp -d)
$ export VIM_FLAVOR=vim
$ go test ./cmd/govim -gopls $(which gopls) -run=TestScripts/scenario_default/format_on_save_new_file_existing_package -race
$ code $GOVIM_TESTSCRIPT_WORKDIR_ROOT/govim/cmd/govim/scenario_default/script-format_on_save_new_file_existing_package/_tmp/gopls.log |
Change https://golang.org/cl/215318 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This looks very similar to #35638.
govim
has a test that starts with the following setup:We then create a new buffer in Vim called
const.go
which is initially empty. No file exists on disk at this point.Then we populate the buffer with:
Note the leading blank line.
Then we save
const.go
. This triggersCodeAction
(to fix imports) followed by (assuming there was no error from the previous step)Formatting
.However we are seeing an error from the call to
CodeAction
:gopls.log
For some reason this is only triggering in our
-race
tests. But still, worth flagging because this looks, from the logs, like a genuine error.Related to #35694
What did you expect to see?
No error from
CodeAction
, then the call toFormatting
to succeed.What did you see instead?
As above.
cc @stamblerre
FYI @leitzler
The text was updated successfully, but these errors were encountered: