Skip to content

regex should be supported in tokenTypes #304883

Closed

Description

Extension developers can specify tokenTypes for a grammar to map specific scopes to content mode. Behind the scenes, these tokenTypes are parsed into a StandardTokenType, which is one of Other, String, Comment, or RegEx. In tokenTypes, however, users can only specify other, string, or comment, but not regex.

Activity

  1. amunger commented on Mar 26, 2026

    @amunger
    Collaborator

    can you add some context on what this is for. Those are some very overloaded terms and I'm not sure what feature this is about

  2. added
    info-needed
    on Mar 26, 2026
  3. zackbach commented on Mar 26, 2026

    @zackbach
    ContributorAuthor

    Sure thing, sorry for my lack of clarity.

    This documentation (under the section "Token types and embedded languages") specifies how one can provide a mapping from certain TextMate scope names to token types to override the default behavior.

    The allowed strings in this position are string, comment, and other, which map onto three of the four cases of this enum.

    The change that I am proposing (and that I have fixed in the associated PR) is to allow the string regex in this position as well, which should be parsed into the fourth case of StandardTokenType.

  4. RedCMD commented on Mar 26, 2026

    @RedCMD
    Contributor
    Image
  5. removed
    info-needed
    on Mar 26, 2026
  6. added
    feature-request
    tokenization
    on Apr 8, 2026
  7. added
    unreleased
    insiders-released
    verification-needed
    and removed
    unreleased
    on Apr 9, 2026
  8. added
    verified
    and removed
    verification-needed
    on Apr 13, 2026
  9. locked and limited conversation to collaborators on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestinsiders-releasedtokenizationverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions