Skip to content

IntelliSense uses the wrong icons for some completion result types #3364

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

Closed
MartinGC94 opened this issue May 23, 2021 · 2 comments · Fixed by PowerShell/PowerShellEditorServices#1738
Assignees
Labels
Area-IntelliSense Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@MartinGC94
Copy link
Contributor

Issue Description

See the following screenshot:
image

A lot of them seem to use the text icon even though VS code includes icons that are more appropriate.
VS Code icons can be found here: https://code.visualstudio.com/api/references/icons-in-labels#icon-listing all of the icons intended for IntelliSense start with "Symbol-"

If I had to map them I would map them like this:

Text              = symbol-text
History           = symbol-reference (Or if we don't limit ourselves to the symbol- icons: history)
Command           = symbol-function
ProviderItem      = symbol-file
ProviderContainer = symbol-folder
Property          = symbol-property
Method            = symbol-method
ParameterName     = symbol-parameter
ParameterValue    = symbol-value
Variable          = symbol-variable
Namespace         = symbol-namespace
Type              = symbol-class
Keyword           = symbol-keyword
DynamicKeyword    = symbol-keyword (Or if we don't want the same icon for 2 different types: symbol-misc)

It's probably worth checking the seemingly working mappings as well because people can customize the icons and if Command and Method for example are both mapped to symbol-function then their icon theme will have to compromise.

If you want to see this for yourself you can use the following code:

function DummyFunction
{
    Param
    (
        [ArgumentCompleter(
        {
            [System.Enum]::GetNames([System.Management.Automation.CompletionResultType]) | ForEach-Object -Process {
                [System.Management.Automation.CompletionResult]::new($_,$_,$_,"ToolTip")
            }
        }
        )]
        $Param1
    )
}

and then try to complete Param1 for the DummyFunction

@ghost ghost added the Needs: Triage Maintainer attention needed! label May 23, 2021
@andyleejordan
Copy link
Member

That sounds like a great thing to improve!

@andyleejordan andyleejordan added Area-IntelliSense Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs. and removed Needs: Triage Maintainer attention needed! labels May 25, 2021
@andyleejordan andyleejordan added this to the Consider-vNext milestone Sep 22, 2021
@glennsarti
Copy link
Contributor

glennsarti commented Oct 7, 2021

Completions are generated by PS Editor Services so you are restricted to CompletionItemKind (https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#completionItemKind). But I'll have a poke around in PSES and see what I can see

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Oct 7, 2021
@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Oct 7, 2021
@andyleejordan andyleejordan moved this to Todo in Sea Biscuit Feb 28, 2022
@andyleejordan andyleejordan moved this from Todo to Wishlist in Sea Biscuit Feb 28, 2022
@andyleejordan andyleejordan moved this from Wishlist to In Progress in Sea Biscuit Mar 8, 2022
@andyleejordan andyleejordan self-assigned this Mar 8, 2022
andyleejordan added a commit to PowerShell/PowerShellEditorServices that referenced this issue Mar 10, 2022
Improve completion logic

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.

Fixes PowerShell/vscode-powershell#3364
Repository owner moved this from In Progress to Done in Sea Biscuit Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IntelliSense Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants