Skip to content

Reserved keywords in function names are highlighted incorrectly #164

Description

@Christophoclese

If a reserved keyword is used as the beginning of a hyphenated function name (e.g., Do-Something or If-Thing) the beginning part of the function name that matches the reserved keyword is highlighted in red.

image

Activity

  1. theaquamarine commented on Feb 2, 2020

    @theaquamarine
    Contributor

    This is actually an issue with the language definition from https://github.com/PowerShell/EditorSyntax thing rather than the module, so would have to be fixed there - it's still present in the current version of the definition (and functions the same way in VSCode).

    That said, it's possible they won't view it as a bug - comments on PowerShell/EditorSyntax#80 suggest they're only interested in approved verbs, which Do and If aren't.

  2. Christophoclese commented on Feb 3, 2020

    @Christophoclese
    Author

    That makes sense. Thanks for the response.

    I guess the takeaway is they don't really want you using hyphens in your function names unless you're going to stick to approved verbs?

  3. added theissue type on Dec 1, 2025
  4. linked a pull request that will close this issueA sizable refactor #202on Dec 9, 2025
  5. added this to the 5.0.0 milestone on Dec 9, 2025
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

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions