-
Notifications
You must be signed in to change notification settings - Fork 154
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
ide style completions #696
Conversation
This is so cool! Would it be possible to also show descriptions for each value when that particular value is highlighted? (like how IDEs show you doc comments when you go to a particular function) |
yes im planing to implement it like inshellisense |
wow, that looks super cool! nice work! |
is there an easy way to add descriptions to a completer? |
Seems like one of the types of completers has This is how I've enabled this in nushell menu
keybinding
|
that seems to be nushell specific. i guess for testing purposes i can just add the descriptions in the menu |
I don't think nushell could have a menu on its own if reedline didn't support it. You can see here that the reedline/src/completion/base.rs Lines 56 to 71 in aa101f4
Nushell has this "convert_to_suggestion" function that may help if there's no example of how to do it in reedline itself. |
yes i have seen this, but the DefaultCompleter in reedline always returns None as description reedline/src/completion/default.rs Lines 99 to 105 in aa101f4
reedline does support it, but the DefaultCompleter doesnt |
so i implemented descriptions like this i made a enum to control where the description box shows up |
should i add checks to make sure that the description or completion has a valid size? (maybe cut off some stuff if it doesnt fit) |
I thought there was a limit or it wrapped or something? |
i added that for the description box currently i guess ill cut of strings that dont fit. |
maybe truncate with |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #696 +/- ##
==========================================
- Coverage 49.69% 47.33% -2.37%
==========================================
Files 46 47 +1
Lines 8433 9304 +871
==========================================
+ Hits 4191 4404 +213
- Misses 4242 4900 +658
|
@maxomatic458 Do you have time to clean up these CI errors? |
@fdncred i will once im done, i marked it as draft again, i decided i want to change some stuff (more user input validation) |
Ah, ok. We just made a nushell release and we like to land things like this early after a release to give us time to test it. Not rushing you, just explaining how we usually work. |
@fdncred i think i have fixed it it works for me now using your config
could you give it a try now? |
@maxomatic458 I'm trying to build your nushell main and am getting this. Is there a different way I should try this? |
@fdncred did you run |
@maxomatic458 ok i did
I'm going to try cargo clean/rebuild. |
oh, this is because your main may be out of date. we had a plugin change in the last week or so. |
oh ok, ill sync my fork |
@fdncred i think you could fix that by just adding a |
LOL. I do have a weird config. I'll try your suggestion as soon as I'm done rebuilding. |
Thanks for all your hard work on this PR! Now to enable it in nushell. :) |
@maxomatic458 Is there a PR in nushell to use |
ill make one right now |
awe, thank you so much! we really appreciate it. |
@fdncred just made one nushell/nushell#11589 |
update to support the latest reedline changes from nushell/reedline#696
@maxomatic458 one last thing. I was trying to use this ide style menu and i'm getting errors in nushell. What am I getting wrong? I added this to my menus in config.nu
|
ya, i was looking for your fork. LOL. i'm fine with waiting for 708. thanks! |
on windows im able to do this here: same works with "word ", when the cursor is behind the the last space but i dont really see whats wrong in your clip, |
on mac, i was able to figure out that shift+left was doing the selection character by character. doing ctrl+shift+left is doing the selection word by word. what i was expecting was that ctrl+shift+left would select character by character vs word by word. maybe that's my mistake. I'm also wondering if terminal bindings come into play here with selection, like we saw with select_all previously with WT. |
update to support the latest reedline changes from nushell/reedline#696
#660
demo clip: