Skip to content

Add code_action_picker command - #9875

Open
John-Toohey wants to merge 3 commits into
helix-editor:masterfrom
John-Toohey:master
Open

Add code_action_picker command#9875
John-Toohey wants to merge 3 commits into
helix-editor:masterfrom
John-Toohey:master

Conversation

@John-Toohey

Copy link
Copy Markdown

Fixes #3502, adding a separate command code_action_picker which opens code_action but in a picker, allowing for searching.

An Asciinema recording

Apologies for my slow computer loading lsp in this recording, but here is a demonstration of the functionality provided by this MR:

Asciinema recording; lsp loads at 0:25

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-command Area: Commands labels Mar 15, 2024
@John-Toohey

Copy link
Copy Markdown
Author

Okay, I have fixed the PR to fix the workflow. Clippy is now happy.

@nikolaiser

Copy link
Copy Markdown

Thanks for this PR! For me this feature is really important because my primary use case for code actions is importing a class in Scala. And often there are a lot of classes with the same name coming from different package. Being able to use picker to select them would bring a lot of value

@archseer archseer added this to the next milestone Sep 30, 2024
Comment on lines +760 to +764
let Some(language_server) = editor.language_server_by_id(language_server_id)
else {
editor.set_error("Language Server disappeared");
return;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Out of curiosity: Is that really the default formatting style for let ... else {}? My brain needed some time to understand what else was doing there.

I was more expecting something like this:

Suggested change
let Some(language_server) = editor.language_server_by_id(language_server_id)
else {
editor.set_error("Language Server disappeared");
return;
};
let Some(language_server) = editor.language_server_by_id(language_server_id) else {
editor.set_error("Language Server disappeared");
return;
};

But could be just me and that I'm still a bit unfamiliar with it or that it's just a style-thingy.

@anis-campos

Copy link
Copy Markdown

can we resurrect this PR ?

this feature would indeed facilitate imports resolution, for now it is most of the time faster for me to type the imports than trying to find it in the menu in your mono-repo.

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

Labels

A-command Area: Commands S-waiting-on-review Status: Awaiting review from a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some sort of filtering on code actions menu

6 participants