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

IntelliSense is not triggered by trigger characters #5022

Open
6 tasks done
MartinGC94 opened this issue Aug 3, 2024 · 2 comments
Open
6 tasks done

IntelliSense is not triggered by trigger characters #5022

MartinGC94 opened this issue Aug 3, 2024 · 2 comments
Labels

Comments

@MartinGC94
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

VS code will by default trigger IntelliSense when you start typing, however you can turn this off and only have it get triggered when certain characters are typed. This is controlled by the following settings:

"editor.suggestOnTriggerCharacters": true,
    "editor.quickSuggestions": {
        "other": "off",
        "comments": "off",
        "strings": "off"
    }

If you set these settings and try to edit the VS code settings.json file you will see that IntelliSense is automatically triggered when you type in " but not when you type normal words, so it works exactly as you'd expect. In PowerShell the only trigger characters that work are . and \ but there are more triggers defined in editor services: https://github.com/PowerShell/PowerShellEditorServices/blob/main/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs#L56

This setting used to work just fine back in 2021 when I added $ as a trigger character: PowerShell/PowerShellEditorServices#1427 but I have no idea when it stopped working.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.5.0-preview.3
PSEdition                      Core
GitCommitId                    7.5.0-preview.3
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2024.3.2
InstanceId       : 7aca87d3-2cd2-4ec6-984c-9d163813f6d5
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : da-DK
CurrentUICulture : da-DK
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.92.0-insider
b1c0a14de1414fcdaa400695b4db1c0799bc3124
x64

Extension Version

Steps to Reproduce

Configure the following VS code settings:

"editor.suggestOnTriggerCharacters": true,
    "editor.quickSuggestions": {
        "other": "off",
        "comments": "off",
        "strings": "off"
    }

Type in $ or Get- or $global: and notice how none of them trigger IntelliSense.
Type in "". or C:\ and notice that IntelliSense is triggered as expected.

Visuals

No response

Logs

No response

@MartinGC94 MartinGC94 added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Aug 3, 2024
@SydneyhSmith
Copy link
Collaborator

Thanks! @MartinGC94 are you saying that . and \ work but the other characters aren't working anymore?

@SydneyhSmith SydneyhSmith added Needs: Author Feedback Please give us the requested feedback! and removed Needs: Triage Maintainer attention needed! labels Aug 29, 2024
@MartinGC94
Copy link
Contributor Author

Yes exactly.

@github-actions github-actions bot added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels Aug 29, 2024
@SydneyhSmith SydneyhSmith added Area-IntelliSense and removed Needs: Maintainer Attention Maintainer attention needed! labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants