-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Expose & Unexpose (existing code lens) as code actions #550
Comments
Personally I think this is just a question of Haskell having got it very wrong, and something like Rust having got it right. Instead of making the exposed-ness of a value dependent on a list at the top of the file, add a pub/export keyword before an identifier. I think that would be a worthwhile GHC proposal, but requires a fair amount of thought. As for adding code actions, that would result in at least 1 additional code action per top-level declaration, which would be very busy using the VS Code UI, and thus a bit of a problem. |
I think my comment in the other feature request could be applied here: till now we are not adding isolate code actions to minimize the amount of code logic in editors code. There is a |
Busy in what way? I'm not suggesting adding a per line code lens, just a "ctrl+." action that doesn't add a bunch of lines. Did I understand your concern correctly? |
My understanding was code lens always showed up in VS Code. In other editors it might not. If there is some LSP functionality that could put this behind a key binding that would be great. CC @alanz as our LSP expert. |
As I understand it "ctrl+." in vscode brings up the code actions, which are then presented in a sorted way. The hierarchical sorting is based on /**
* The kind of a code action.
*
* Kinds are a hierarchical list of identifiers separated by `.`,
* e.g. `"refactor.extract.function"`.
*
* The set of kinds is open and the client needs to announce the kinds it
* supports to the server during initialization.
*/
export type CodeActionKind = string; So we should perhaps start applying a disciplined process to putting a code action kind hierarchy into place, and push the other LSP clients to use them properly in the UI |
Cross-posting my comment in #496 (comment) since it is relevant for both issues: This would be a great thing to have. I have chosen to disable code lenses since I find it clutters the code (granularity of settings for enabling code lenses in various contexts is limited, so electing to turn them off completely for the moment), however, this currently means I can't use the eval plugin. |
When I want to expose a Thing (= type, class, function, pattern etc) to other modules, I have to:
I propose 2 new code actions to make this easier:
The text was updated successfully, but these errors were encountered: