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: feature: support SnippetTextEdit in codeactions #70432

Open
xzbdmw opened this issue Nov 18, 2024 · 2 comments
Open

x/tools/gopls: feature: support SnippetTextEdit in codeactions #70432

xzbdmw opened this issue Nov 18, 2024 · 2 comments
Labels
FeatureRequest 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

@xzbdmw
Copy link

xzbdmw commented Nov 18, 2024

gopls version

.

go env

.

What did you do?

Jdtls's preview version has this feature, and lsp has snippetTextEdit merged

What did you see happen?

iShot_2024-11-19_06.57.51.mp4

What did you expect to see?

With snippets, for extract function/method/variable, we can change function/variable name in two places at the same time; for fill struct, all the right side of property assignment can be a snippet node; and for generate missing function/method, we can select the panic("unimplemented") so user can replace it right away.

Editor and settings

No response

Logs

No response

@xzbdmw xzbdmw added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Nov 18, 2024
@gopherbot gopherbot added this to the Unreleased milestone Nov 18, 2024
@adonovan
Copy link
Member

I think the intent of the video is to illustrate that applying the code action causes the selection and cursor to change, not just a mere text edit. The mechanism is similar to a snippet completion, which returns a snippet of text with placeholder fields in it.

@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest 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

5 participants