Skip to content

Syntax highlighting on ParameterSetName not working with spaces around assignment operator #1202

Closed

Description

System Details

  • Operating system name and version: Windows 10, 1703
  • VS Code version: 1.20.1
  • PowerShell extension version: 1.5.1
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.15063.786
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.786
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
$pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      5      1      0

Issue Description

Syntax highlighting is not working for code like this:

        [Parameter(Mandatory = $True, ParameterSetName = "SharedResources")]
        [String]
        $VarName,

image

If I remove the whitespace after the assignment operator, it works fine:

        [Parameter(Mandatory = $True, ParameterSetName ="SharedResources")]
        [String]
        $VarName,

image

Since auto formatting the file places whitespaces around the assignment operator, I would assume that this is the correct way to format the parameter options.

Activity

  1. rkeithhill commented on Feb 20, 2018

    @rkeithhill
    Contributor
  2. totkeks commented on Sep 13, 2018

    @totkeks
    Author

    Closed, because the related issue (PowerShell/EditorSyntax#73) is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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