Open AndydeCleyre opened 3 weeks ago
👋 I have a draft of this feature ongoing.
I made a SelectionCommand
slash command that basically copies the logic from quote_selection(). Instead of opening assistant_panel
and creating Crease
's, I create sections (SlashCommandOutputSection
) for each text selection. Those sections are added to the the resulting SlashCommandOutput
.
Here's a video of the outcome:
https://github.com/user-attachments/assets/e56ed552-e831-438a-886e-572ce1a57351
The 'no selections found' error case is inspired by the diagnostics_command
.
This approach does duplicate much of quote_selection()
. I could extract a method that takes the current editor selections and returns a list of tuples of the text required for both methods (label, text, selection ranges), though I don't know which file such a method would want to live.
Also, the end of the word selection
is cut off in the slash-command autocomplete. I didn't know where to adjust that. I tried messing with slash_command_picker#render_match()
but that didn't seem like the right spot 😅 .
I just saw https://github.com/zed-industries/zed/pull/19988/files so my WIP may be moot. ¯_(ツ)_/¯
Check for existing issues
Describe the feature
I finally found the
assistant: quote selection
action and corresponding shortcut, which is great!But I'd assumed it wasn't possible, because I expected such an action to be in the same place as the assistant slash-commands
/file
and/tab
.So I'm requesting an additional slash-command for the assistant, maybe
/selection
but the name doesn't matter much, that has the same effect as the existing actionassistant: quote selection
.If applicable, add mockups / screenshots to help present your vision of the feature
No response