Skip to content
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

CompletionResult tooltips aren't displayed when tooltip text == ListItem/CompletionText #3903

Closed
3 tasks done
thegraffix opened this issue Dec 17, 2023 · 1 comment
Closed
3 tasks done
Labels
Resolution-By Design The behavior is by design.

Comments

@thegraffix
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

ISE doesn't filter out tooltips when the tooltip text is the same as the ListItem/CompletionText, but PSReadLine does.

Explorer:
image

Console:
Console

ISE:
ISE

Environment data

PS Version: 5.1.19041.3803
PS HostName: ConsoleHost
PSReadLine Version: 2.3.4
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 170
BufferHeight: 3000

Steps to reproduce

This is the test function I used:

function Test-ToolTip
{
    [CmdletBinding()]
    param (
        [ArgumentCompleter({
            param ($CommandName, $ParameterName, $WordToComplete, $CommandAst, $FakeBoundParameters)
            Get-ChildItem -Path 'C:\Test' -File | Where-Object {$_.Name -like "*$WordToComplete*"} | ForEach-Object {
                [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
            }
        })]
        [string]$FileName
    )

    Write-Output $FileName
}

Expected behavior

Tooltips are displayed even when the tooltip text is the same as the ListItem/CompletionText.

Actual behavior

Tooltips are not displayed when the tooltip text is the same as the ListItem/CompletionText.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Dec 17, 2023
@daxian-dbw
Copy link
Member

This is by design. PSReadLine chooses to not render the tooltips if it doesn't provide additional information.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Dec 18, 2023
@daxian-dbw daxian-dbw added the Resolution-By Design The behavior is by design. label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-By Design The behavior is by design.
Projects
None yet
Development

No branches or pull requests

2 participants