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

Implement codeAction/resolve for some of our code actions #3534

Closed
michaelpj opened this issue Mar 21, 2023 · 5 comments
Closed

Implement codeAction/resolve for some of our code actions #3534

michaelpj opened this issue Mar 21, 2023 · 5 comments

Comments

@michaelpj
Copy link
Collaborator

LSP allows you to implement codeAction/resolve to fill in details of code actions when the user is considering applying them, rather than immediately when the list of code actions is requested. This has two main advantages:

  • You can delay doing expensive work until you're asked to resolve the code action.
  • You can avoid sending lots of large text edits to the client every time they ask for code actions, even if they won't be used. (This can put pressure on clients JSON handling!)

Doing this properly would probably mean figuring out a way to make it easy to add support for code action resolution. Many of our code actions come from plugins, we'd like to make it as easy as possible for plugin authors to opt in to code action resolution.

@PrathmeshAdsod
Copy link

PrathmeshAdsod commented Apr 11, 2023

Hey, I am making proposal on "Implement Resolution Methods in HLS" for Summer of Haskell 2023. I am interested in this project. Can you please elaborate me what you want to say on "we'd like to make it as easy as possible for plugin authors to opt in to code action resolution". What I understand is that code completion resolution is in HLS Core and other resolutions like code action, code lenses etc. are in HLS Plugins.
Which plugin authors are you talking about, who are going to opt in to code action resolution. Please explain. Are they other plugin authors or the authors of HLS plugins which implements code resolutions ?
What I understood is -
We have to develop infrastructure that allows plugin authors to easily opt into resolution support for their plugins, regardless of whether they are part of the core of HLS or provided by plugins.

@joyfulmantis
Copy link
Collaborator

I'm planning on making a proposal for that, too; looking forward to the competition!
Most of the features provided by hls are done by plugins. This tutorial is a bit outdated, but it gives you some ideas of how plugins work. In addition, to understand them better, I suggest looking at some of the actual plugins (under /plugins in the source). Finally, this lsp spec can be a useful reference.

@michaelpj
Copy link
Collaborator Author

HLS plugins are not externally loaded, but are really just a code organization system for this repository. Many of them have specific maintainers who just maintain that plugin and don't contribute to the core of HLS. So we want to keep things as easy as possible for them.

@PrathmeshAdsod
Copy link

@michaelpj I understood it completely.
@joyfulmantis Thank you for resources.

@michaelpj
Copy link
Collaborator Author

We did this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants