-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Improve Regex syntax highlighting #25332
Conversation
Release Notes: - Improved JavaScript and TypeScript syntax highlighting. | Zed 0.174.6 | With this PR | | --- | --- | |  |  | - `regex_flags`: `keyword.regex`, see the [Regex PR](#25332) for other Regex scopes - `@`: `punctuation.special`, as in Python - `jsx_text`: `text.jsx` - `=`: `operator` -> `punctuation.jsx.delimiter`, `punctuation` as in [VS Code](https://github.com/microsoft/vscode/blob/0fe195613ed9901f669cd0f799fe807f0189d029/extensions/html/syntaxes/html.tmLanguage.json#L78) and [Atom](https://github.com/atom/language-html/blob/ee750a014a003c3d6f10b91e3cd5f9bfa0f051e6/grammars/tree-sitter-html.cson#L47) - added `jsx` scope to target JSX tokens specifically ```javascript /** * @Keyword comment */ @log class X { render() { return ( <div jsx_attribute="value"> <Input onKeyPress={super.bind(this)}/> jsx_text </div> ); } } const IDENTIFIER = true ``` --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com>
After @ConradIrwin's 6faa7cd, now we don't see the text as green: I'm finding a little weird having the enclosing @ConradIrwin @chbk @maxdeviant thoughts? |
no strong opinion; feel free to change it. One thing to note is that we use the regex highlighting in the search box, so needs to work in both contexts. |
Alright! I think the current version is looking decent in both search box and normal editor. |
Release Notes:
(?P=
,<
:punctuation.bracket
group_name
:property
->label
^
,$
:string.escape
->operator
\b
,\B
,\k
:string.escape
->keyword.operator
regex
scope to target regex tokens specifically