Add Name as tooltip when tab completing process ID#3664
Add Name as tooltip when tab completing process ID#3664daxian-dbw merged 4 commits intoPowerShell:masterfrom
Conversation
b10bb4a to
c9edd3a
Compare
|
The failure seems unrelated to my checkin |
0d05b36 to
118b0ab
Compare
There was a problem hiding this comment.
I've always thought the user experience wasn't quite right with this completion.
I wonder if it would be better to use listItemText instead of tooltip to show the process name and the process id.
There was a problem hiding this comment.
I guess you are right, since it is harder to see the tooltip
There was a problem hiding this comment.
There is some weird case here where I have a null/empty process name on macOS. Is that expected or a bug somewhere in the process code?
118b0ab to
8c02c06
Compare
|
New version with listtext and tooltip "{id} - {name}" |
| $cmd = 'Get-Process -Id ' | ||
| $res = TabExpansion2 -inputScript $cmd -cursorColumn $cmd.Length | ||
| $res.CompletionMatches[0].CompletionText -match '^\d+$' | Should be true | ||
| $res.CompletionMatches[0].ToolTip -match '^\w' | Should be true |
There was a problem hiding this comment.
\w stands for "word character", usually [A-Za-z0-9_]
So ToolTip -match '^\w' doesn't guarantee it's in our expected form "<digits - string>".
There was a problem hiding this comment.
We don't know that we get the name string. Some tests on mac fail with null (or maybe empty) string. But maybe we could have '^\d+ - '
|
Keep in mind that the PowerShell extension for VSCode uses the TooltipText for the detail text in IntelliSense. ListItemCompletion is used for sorting and the Label. |
|
@powercode can you please update the test with |
0220380 to
997e567
Compare
There was a problem hiding this comment.
You changed the wrong one. It's the ToolTip test below that you should change the pattern to ^\d+ - '
There was a problem hiding this comment.
Shouldn't do this in the middle of the night :) Fixing
997e567 to
3f64b47
Compare
|
pushed a rebased version |
No description provided.