Skip to content

IntelliSense in debug mode is behaving strange #948

Closed
@DarkLite1

Description

System Details

  • Operating system name and version: Windows Server 2012 64 bit
  • VS Code version: 1.15.0-insider
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:
    Name Value

PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.16406
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2

Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here

code -v
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pa
th is correct and try again.
At line:1 char:1
+ code -v
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS S:\Prod> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0


PS S:\Prod> code --list-extensions --show-versions
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pa
th is correct and try again.
At line:1 char:1
+ code --list-extensions --show-versions
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Issue Description

When putting a breakpoint in the editor and running the code, the code execution is correctly stopped at the breakpoint. However, when we then open the terminal to try out some code in that session, IntelliSense is acting a bit weird. It's not suggesting CmdLets or functions but rather selecting them immediately without showing the suggestion first.

Ecample code with a breakpoint at line 7:

[CmdLetBinding()]
Param (
    [String]$MyParam
)

Write-Verbose "Script started"
Write-Verbose "$MyParam"
Get-Process | Select-Object Name
Write-Verbose "Debugging done"

When the execution stops at line 6, you can type in the Terminal for example get-he, then use a TAB to complete the CmdLet to Get-Help but it's not just completing the CmdLet but also executing it at the same time. This makes it hard to see what CmdLets are available and if we really want to execute that specific one....

If you instead type Get-he and do a TAB you get different behavior, the Terminal then executes something that has nothing to do with the Get-Help CmdLet.

I'm using here Get-Help as an example, but this problem is for all CmdLets in the session. This is a very annoying issue as it hinders development.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions