ZIm/crates/languages/src
chbk f97546b6ef
Improve Regex highlighting (#28183)
| Zed 0.180.2 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/e840bd81-25ff-4c7a-af03-bac6db11f910)
|
![Image](https://github.com/user-attachments/assets/3fd58164-8992-44e1-be01-8c6d70f9587d)
|

```js
match = "424242"
regex = /(42)+?\d{2}\1/g
```

- `/`: `operator` -> `string.regex` (like `"` for regex strings)
- `+?`: `operator.regex`
- `\d`: `string.escape` -> `string.escape.regex`
- `\1`: `keyword.operator.regex` (backreference)
- `/g`: `keyword.regex` -> `keyword.operator.regex`
- `{2}`: `number` -> `number.quantifier.regex`

Release Notes:

  - Improved Regex highlighting
2025-04-18 12:44:13 -04:00
..
bash Improve Bash heredoc highlighting (#28185) 2025-04-06 11:14:05 -04:00
c Improve C and C++ syntax highlighting (#25325) 2025-02-21 12:01:39 -05:00
cpp Recognize ixx as part of the cpp suffix (#26333) 2025-03-10 09:10:29 -05:00
css Add completion_query_characters in language (#27175) 2025-03-20 16:45:35 +05:30
diff Improve diff syntax highlighting queries (#21740) 2024-12-12 15:18:36 -08:00
gitcommit Fix syntax highlighting of git commit messages (#26988) 2025-03-18 18:18:56 +00:00
go Improve Go syntax highlighting (#25327) 2025-02-21 11:32:14 -05:00
gomod Add "tool" support to go.mod (#22995) 2025-01-15 17:44:28 +02:00
gowork File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
javascript Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
jsdoc Add language icons to the language selector (#21298) 2024-12-02 15:01:09 -03:00
json Add completion_query_characters in language (#27175) 2025-03-20 16:45:35 +05:30
jsonc Treat bun.lock as JSONC (#27359) 2025-03-24 09:46:23 -04:00
markdown Add completion_query_characters in language (#27175) 2025-03-20 16:45:35 +05:30
markdown-inline Hide Markdown-Inline language from users with a new 'hidden' flag on language configs (#17104) 2024-08-29 11:23:33 -07:00
python python: Auto-close f-strings (#28709) 2025-04-14 21:22:27 +00:00
regex Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
rust rust: Improve runnable detection for test modules (#28024) 2025-04-03 14:56:28 +00:00
tsx Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
typescript Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
yaml vim: Update anyquotes and anybrackets to behave like mini.ai plugin (#24167) 2025-02-17 14:55:48 -07:00
bash.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
c.rs Support tasks from rust-analyzer (#28359) 2025-04-08 15:07:56 -06:00
css.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
go.rs Escape carets (^) in Go test regex (#27746) 2025-04-04 12:04:38 +02:00
json.rs snippet_provider: Use proper casing of VsCode in identifiers (#29038) 2025-04-18 12:11:54 +00:00
lib.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
python.rs pylsp: Upgrade existing installation if possible (#28338) 2025-04-08 20:01:09 +02:00
rust.rs debugger: Remove LLDB adapter, switch Rust tasks to CodeLLDB (#28773) 2025-04-15 15:29:43 +00:00
tailwind.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
typescript.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
vtsls.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
yaml.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00