-
Notifications
You must be signed in to change notification settings - Fork 234
Improve completion logic #1738
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
Improve completion logic #1738
Conversation
@MartinGC94 I think you'll like this! From your demo (ignore |
You are right, this looks great and great choice of icons as well. The only icon that looks a little out of place is the ParameterName. I know it shares its icon with the operators but parameters are used much more frequently so maybe the chosen icon should look more like a parameter? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a couple of nits
src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs
Outdated
Show resolved
Hide resolved
22b4b96
to
684b0ff
Compare
@MartinGC94 That is an artifact of the way that test displays all of them at once and the logic that figures out if it's a parameter. They're actually currently mapped to However, I'm trying to decide if instead they should map to Field (which is so far unused): Property (which already has the PowerShell |
I see. All 3 of those are fine but if I had to pick I would go with Field because I like the icon and the fact that it's unique. |
684b0ff
to
28912a8
Compare
Thanks for pointing that out @JustinGrote, I agree. What tool are you using to inspect like that? |
28912a8
to
59be311
Compare
@andschwa it's built into vscode, very useful for troubleshooting syntax highlighting |
I'm so sad I've learned about this a year later...what else should I know?! |
@andschwa uuuh, you can access devtools for the running vscode instance maybe? Basically check out everything prefixed with |
@JustinGrote @SeeminglyScience @MartinGC94 Give this new commit a whirl would you? I removed the middle abstraction layer as it seemed superfluous. |
Oops, probably tests expecting old code. Fixing up. |
fda3a76
to
1424359
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, couple of little things
src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs
Outdated
Show resolved
Hide resolved
bb14056
to
15c3b85
Compare
This makes the deduced `CompletionItemKind` enum more accurate, which results in better icons for the user when viewing completions in an editor. Also cleaned up the file as there were remnants of dead code.
This removes an abstraction that sat between `SMA.CompletionResults` and `OmniSharp.CompletionItems`. It most likely existed out of necessity before a prior refactor that introduced OmniSharp. Now we can skip the middle layer and instead convert directly, massively simplifying the code (and fixing tooltips).
Makes it a thousand times more readable, and therefore less error-prone. Also verified fields against the spec and so finished the TODOs.
15c3b85
to
912392e
Compare
This makes the deduced
CompletionItemKind
enum more accurate, whichresults in better icons for the user when viewing completions in an
editor. Also cleaned up the file as there were remnants of dead code.
Fixes PowerShell/vscode-powershell#3364