-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Send LSP Completion Item Kind #11443
Conversation
I'm not familiar with code completion either. Sorry. Here's my guess.
x is definitely a nushell enum Value here and Value can be any nushell datatype. when it's calling as_string() it's this function, so it's a limited set of nushell values. nushell/crates/nu-protocol/src/value/mod.rs Lines 312 to 336 in 21b3eee
the match for as_record is ensuring this is a nushell record. this is the function so I think we can be pretty sure it's a record. nushell/crates/nu-protocol/src/value/mod.rs Lines 403 to 413 in 21b3eee
I'm not exactly sure how we map to Not supported I guess? Nushell Types nushell/crates/nu-protocol/src/ty.rs Lines 11 to 36 in 21b3eee
Nushell Values nushell/crates/nu-protocol/src/value/mod.rs Lines 44 to 155 in 21b3eee
|
0426c2a
to
83ee1ad
Compare
I worry about this PR because I'm not sure if we have 100% code coverage in tests and this PR is changing a lot of completion files. I'm not saying it's not right. I'm just saying it makes me nervous. |
83ee1ad
to
815c7f4
Compare
@fdncred, I share your worries and therefore, I made my changes the least invasive as possible. I also updated the code and added some LSP tests. |
815c7f4
to
7631afe
Compare
@schrieveslaach would you mind fixing the conflicts? i'd love to get this in soon. |
Hey, I have been thinking about Kinds recently and closed a PR realizing you had already started one. Correct me if I'm wrong, but do we want to couple all of nushell completions to LspTypes? My intuition is that LspTypes should be only used in the LSP crate. To do this, we could possibly implement a completer in the lsp crate, instead of reusing the cli completer. Beyond the scope of this PR, though, the nushell cli could benefit from giving completion kinds as well. If we were to do this, I feel it would be best to create our own kind type in the cli completer, then implement From for Lsptypes completion kind. Let me know what you all think |
It would be nice to isolate these changes to nu-lsp if possible. I worry, as stated above already, that negative things might happen as is. Maybe it's ok but I'd rather be as safe as possible. Thoughts? |
@schrieveslaach been missing your prs for nu-lsp lately. hope everything is ok. do you think these changes can be somehow isolated to the nu-lsp crate? |
A lot of stuff going on here, sorry for not responding earlier. I'll try to reach out to you in the next days. |
No worries at all. Thanks for your help! We have a new release Tuesday. |
I revisited the stuff I changed here and I see follow options
After thinking for a while I prefer option 1 because it seems to me the option with the most clear boundaries among the crates. I would abandon option 2 because that means there has to a whole rewrite But still, option 1 requires for me that @fdncred, is that a viable approach to you? Even if I won't be able to provide a whole test suite for the |
@schrieveslaach I think option 1 sounds the safest compared to the other two. Although, at some point in the future, option 2 may be interesting. |
7631afe
to
21a6250
Compare
@fdncred, here is a new preliminary version. Do you mind to have a rough look into it? There are still some TODO comments but I want to double check if it is going into the right direction. |
The only real thing that kind of rubs me the wrong way is the Other than that, it seems good to me. What other changes do you have in mind with this PR? |
@schrieveslaach I think we may be able to land this if we can get the conflict(s) fixed. |
This commit fills in the completion item kind into the textDocument/completion response so that LSP client can present more information to the user.
21a6250
to
a081590
Compare
thanks |
Description
This commit fills in the completion item kind into the
textDocument/completion
response so that LSP client can present more information to the user.It is an improvement in the context of #10794
User-Facing Changes
Improved information display in editor's intelli-sense menu