Skip to content

Double-quoted strings treat @tokens as interpolations #149

Closed

Description

Environment

  • Editor and Version (VS Code, Atom, Sublime): VS Code 1.29.0
  • Your primary theme: Dark+ (default dark)

Issue Description

Double-quoted strings color @tokens the same as $tokens

Screenshots

image

Expected Behavior

Only $tokens or $(expressions) are string-interpolated in a double-quoted string. The @word is just going to be treated as part of the string.

Code Samples

This may be an appropriate spec test case:

    "This is a @double quoted string."
#   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.powershell

Activity

  1. msftrncs commented on Dec 16, 2018

    @msftrncs
    Contributor

    This has been mentioned in #137.

  2. added a commit that references this issue on Apr 24, 2019
    19cb3e6
  3. msftrncs commented on Apr 24, 2019

    @msftrncs
    Contributor

    I was looking at the possible test case, but I don't think it is sufficient, but I may not entirely understand how the test works. In my mind, the entire string will scope as spec'd, regardless of whether the @double scopes as a splat or not.

  4. msftrncs commented on Apr 24, 2019

    @msftrncs
    Contributor

    Looks like this is needed?

    # @splat references only work in argument mode, should not highlight in strings.
    "This is a @double quoted string."
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.powershell
    #           ^ not:variable.other.readwrite.powershell
  5. TylerLeonhardt commented on Apr 24, 2019

    @TylerLeonhardt
    Member

    That seems right, Carl Morris (@msftrncs). I would recommend running the test before and after your change to see if it fixes the test.

  6. added a commit that references this issue on Apr 26, 2019
    cf27d6e
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