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

Distinguish between anonymous * token and wildcard selector #18382

Merged
merged 1 commit into from Nov 3, 2018

Conversation

Projects
None yet
2 participants
@Ben3eeE
Member

Ben3eeE commented Nov 1, 2018

Paired with @maxbrunsfeld

Identify the Bug

An anonymous token "*" is not distinguished with the wildcard selector *. So if a tree-sitter grammar has a scope mapping like this:

'"*"': 'keyword.operator'
'relational_expression > ">"': 'keyword.operator'

It will scope any > as keyword.operator

Description of the Change

This changes setTableDefaults to add a parameter for allowing wildcard selectors so we can disallow it when mapping the anonymous nodes.

Verification Process

  • This PR atom/language-c#303 adds scope mappings for relational_expression > ">" and "*" to be keyword.operator. Without this change tree-sitter will still scope > and < in templates as keyword.operator
  • Passing tests

Release Notes

Distinguish between anonymous * token and wildcard selector
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>

@Ben3eeE Ben3eeE referenced this pull request Nov 1, 2018

Merged

Add more scopes to the tree-sitter grammar #303

1 of 2 tasks complete
@maxbrunsfeld

This comment has been minimized.

Contributor

maxbrunsfeld commented Nov 1, 2018

I'd say we don't need a release note for this one, because its only user-facing impact is via atom/language-c#303 - basically fixing a bug with how < and > were highlighted.

@Ben3eeE Ben3eeE merged commit e158dce into master Nov 3, 2018

3 checks passed

Atom Pull Requests #20001 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Ben3eeE Ben3eeE deleted the b3-mb-wildcard-selector branch Nov 3, 2018

maxbrunsfeld added a commit that referenced this pull request Nov 6, 2018

Merge pull request #18382 from atom/b3-mb-wildcard-selector
Distinguish between anonymous * token and wildcard selector

maxbrunsfeld added a commit that referenced this pull request Nov 6, 2018

Merge pull request #18382 from atom/b3-mb-wildcard-selector
Distinguish between anonymous * token and wildcard selector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment