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

Add kind and preferred flag for all Wingman code actions #1499

Merged
merged 6 commits into from Mar 5, 2021

Conversation

isovector
Copy link
Collaborator

@isovector isovector commented Mar 5, 2021

#1458 suggests that Wingman export its code actions with descriptive LSP kinds so that editors can more easily filter them. This PR does that, under the refactor.wingman. prefix.

@TOTBWF @michaelpj please review. Does this do what you want?

@isovector
Copy link
Collaborator Author

This seems to be a success; I've managed to bind the code actions in my editor. What a great improvement!

@michaelpj
Copy link
Collaborator

Nice! My only quibble is with refactor.inline. These don't seem like they're mostly inlinings? refactor.rewrite might fit better, or maybe we should make up something like refactor.synthesis 😆

@isovector
Copy link
Collaborator Author

Fair enough. I was thinking about case split when I named them, which does sorta inline the definition. But I'd prefer to have a common prefix for all of the actions, so maybe just refactor.wingman. is the play here.

@michaelpj
Copy link
Collaborator

refactor.wingman seems totally reasonable. I don't think we need to invent some semantic grouping of these commands that doesn't exist. The reality is: it's all the wingman commands, and that's fine.

@isovector isovector added the merge me Label to trigger pull request merge label Mar 5, 2021

mkTacticKind :: TacticCommand -> CodeActionKind
mkTacticKind =
CodeActionUnknown . mappend "refactor.wingman." . tacticKind
Copy link
Member

@Ailrun Ailrun Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar to action kind things, but since tactics plugin resolves (or changes) some errors, it may be better to use quickfix.wingman.. WDYT?

CC: @michaelpj

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too slow, sorry! Feel free to file a bug if this is terribly worrisome!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't seem very quickfix-y to me, and I think a bunch of them work with holes, so they won't actually be fixing errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelpj I mean a hole produces a compile error, so... But I'm not strongly inclined to anything :)

@mergify mergify bot merged commit 9bd0928 into haskell:master Mar 5, 2021
@isovector isovector deleted the tactic-kinds branch April 5, 2021 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants