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: 'refactor'-only codeAction should return all available 'refactor.*' code action items #44213

hyangah opened this issue Feb 10, 2021 · 1 comment


Copy link

@hyangah hyangah commented Feb 10, 2021

gopls version v0.6.5

When vscode user selects 'Refactor...' context menu entry, vscode requests codeAction with "context": { ... "only": ["refactor"]}. Gopls doesn't return anything even though there are possible refactoring actions applicable to the selected range.

[Trace - 14:38:03.583 PM] Sending request 'textDocument/codeAction - (10)'.
Params: {

[Trace - 14:38:03.584 PM] Received response 'textDocument/codeAction - (10)' in 1ms.
Result: null

Compare against the result for the previous codeAction request on the same range:

[Trace - 14:37:57.484 PM] Sending request 'textDocument/codeAction - (8)'.
Params: {

[Trace - 14:37:57.485 PM] Received response 'textDocument/codeAction - (8)' in 0ms.
Result: [{
   "title":"Extract to function",
@gopherbot gopherbot added this to the Unreleased milestone Feb 10, 2021
Copy link

@heschik heschik commented Feb 10, 2021;l=165-178;drc=d4590503678b9a270e7c2a91fe6dccea617322a6 does exact matches on the only attribute. It seems we should return refactor.extract for only=refactor.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Feb 10, 2021
@stamblerre stamblerre changed the title x/tools/gopls: 'refactor'-only codeAction should return all available 'refactor.*' code action items. x/tools/gopls: 'refactor'-only codeAction should return all available 'refactor.*' code action items Feb 10, 2021
@stamblerre stamblerre added this to To Do in gopls: v1.0.0 Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants