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

Double-quoted strings treat @tokens as interpolations #149

Closed
NReilingh opened this issue Nov 14, 2018 · 4 comments · Fixed by #165
Closed

Double-quoted strings treat @tokens as interpolations #149

NReilingh opened this issue Nov 14, 2018 · 4 comments · Fixed by #165

Comments

@NReilingh
Copy link

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
@msftrncs
Copy link
Contributor

This has been mentioned in #137.

msftrncs added a commit to msftrncs/EditorSyntax that referenced this issue Apr 24, 2019
remove #variable from #doubleQuotedString, remove @ from #variableNoProperty
@msftrncs
Copy link
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.

@msftrncs
Copy link
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

@TylerLeonhardt
Copy link
Member

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

TylerLeonhardt pushed a commit that referenced this issue Apr 26, 2019
* fixes #149, #164
remove #variable from #doubleQuotedString, remove @ from #variableNoProperty

* add tests: no @splats in double quoted strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants