ZIm/crates/languages/src/javascript
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
..
brackets.scm vim: Update anyquotes and anybrackets to behave like mini.ai plugin (#24167) 2025-02-17 14:55:48 -07:00
config.toml languages: Fix JS/TS imports not showing correct suggestions after using period (#27235) 2025-03-21 15:13:31 +05:30
contexts.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
embedding.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
highlights.scm Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
indents.scm Automatically indent JSX (#18816) 2024-10-10 15:15:12 +03:00
injections.scm Use standard injection.language and injection.content captures (#22268) 2025-01-07 18:17:49 +00:00
outline.scm Added JavaScript runnable detection for context and suite methods (#21719) 2024-12-09 13:17:51 +02:00
overrides.scm Add inclusive range scope overrides. Don't auto-close quotes at the ends of line comments (#20206) 2024-11-04 15:36:39 -08:00
runnables.scm Added JavaScript runnable detection for context and suite methods (#21719) 2024-12-09 13:17:51 +02:00
textobjects.scm Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00