Skip to content

Conversation

@dustypomerleau
Copy link
Contributor

Fixes #6293.

I've included the possibility of the r# prefix in:

  • function definitions
  • function/method calls
  • variables/parameters

This way the raw ID will simply get whatever the intended scope was, instead of a unique scope that might be inappropriately themed for its purpose.

Will wait a bit for feedback, in case there are other places you might use raw IDs.

@matklad
Copy link
Contributor

matklad commented Oct 23, 2020

Technically a raw ID might be use everywhere a name could be, like in struct #async. But I think the most common cases are probably functions and modules.

bors d+

@bors
Copy link
Contributor

bors bot commented Oct 23, 2020

✌️ dustypomerleau can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@dustypomerleau
Copy link
Contributor Author

Ah - I’ll need to add a dedicated case for modules before merging.

- remove comment scope from ignored params
- underscores will automatically receive variable/param scope
- add raw ID syntax to modules, functions, and variables
@dustypomerleau dustypomerleau changed the title Textmate grammar: support raw identifiers (closes #6293) Textmate grammar: raw IDs, underscore fixes (closes #6293, #6340) Oct 24, 2020
@dustypomerleau
Copy link
Contributor Author

Removing comment scope for ignored params also simplified the previous issues with underscore-prefixed functions/macros, so I've reduced the complexity of those regexes. Ignored params will now automatically be matched as variable/parameter scope, which seems preferable to those that have spoken up. Latest push also adds raw IDs for module names, in addition to the scopes mentioned above.

This will close #6293 and #6340.

@dustypomerleau
Copy link
Contributor Author

bors r+

@matklad after you delegate, will bors still merge after additional pushes?

@bors
Copy link
Contributor

bors bot commented Oct 24, 2020

@bors bors bot merged commit 4105378 into rust-lang:master Oct 24, 2020
@dustypomerleau dustypomerleau deleted the raw-id branch November 2, 2020 04:52
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 this pull request may close these issues.

Textmate grammar does not highlight raw identifiers correctly

3 participants