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

x/tools/gopls: invoking source.addTest from CLI fails with ENOENT #70718

Open
adonovan opened this issue Dec 6, 2024 · 1 comment
Open

x/tools/gopls: invoking source.addTest from CLI fails with ENOENT #70718

adonovan opened this issue Dec 6, 2024 · 1 comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented Dec 6, 2024

While working on https://go.dev/cl/634197, I tried the new "Add test for function 'fingerprint'" code action within Emacs+eglot, and got an unhelpful "Internal error". I tried it again from the gopls CLI, and got a different error:

$ gopls codeaction -kind=source.addTest -exec ./gopls/internal/cache/methodsets/fingerprint.go:54
gopls: edits not applied because of getFile: file:///Users/adonovan/w/xtools/gopls/internal/cache/methodsets/fingerprint_test.go: open /Users/adonovan/w/xtools/gopls/internal/cache/methodsets/fingerprint_test.go: no such file or directory

Then I tried it from VS Code, and it worked great. (That said, the code action was not visible in the Command-. quick menu, and had to be selected from the right-click > Source Actions... menu. We should reinvestigate the endlessly fiddly algorithm that governs this.)

So, I don't think there's a bug in gopls' Code Action or command handler, but there is in the CLI, and in Eglot, and perhaps they are related.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Dec 6, 2024
@gopherbot gopherbot added this to the Unreleased milestone Dec 6, 2024
@findleyr findleyr modified the milestones: Unreleased, gopls/backlog Dec 12, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/635680 mentions this issue: slices,maps: delegate to go1.21 functions of the same name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants