Skip to content

Collapsing if/else block in a .PSM1 file hides the next else condition line #1598

Closed
@alongafni

Description

@alongafni

Issue Description

  1. Create a new file test.psm1 and paste this inside:
    Line 1: if (a -eq b) {
    Line 2: do Create Yeoman generator for PowerShell projects #1
    Line 3: } elseif (a -gt b) {
    Line 4: do Signature help does not appear in VS Code 0.10.0 #2
    Line 5: } else {
    Line 6: do Implement document and workspace symbol providers for classes #3
    Line 7: }

  2. collapse line 1

Expected: Only line #2 is hidden
Actual: Lines #2 and #3 are hidden

This happens in PSM1 files but not in PS1 files

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.17763
VSCode 1.28.2
PowerShell Extension Version 1.9.0

PowerShell Information

Name Value
PSVersion 5.1.17763.1
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.17763.1
BuildVersion 10.0.17763.1
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
beautify HookyQR 1.4.7
debugger-for-chrome msjsdiag 4.10.2
Go ms-vscode 0.6.93
json-tools eriklynd 1.0.2
markdown-preview-enhanced shd101wyy 0.3.11
npm-intellisense christian-kohler 1.3.0
PowerShell ms-vscode 1.9.0
rest-client humao 0.20.3
tslint eg2 1.0.40
vscode-docker PeterJausovec 0.3.1
vscode-eslint dbaeumer 1.7.0
vscode-markdownlint DavidAnson 0.21.0
vscode-npm-script eg2 0.3.5
vscode-todo-highlight wayou 1.0.4

Metadata

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