ZIm/crates/languages/src/javascript
chbk 8f40bcc86c
Improve JavaScript and TypeScript syntax highlighting (#25328)
Release Notes:

  - Improved JavaScript and TypeScript syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/a64f0abf-3b4e-4369-80c5-1d1381c925fc)
|
![Image](https://github.com/user-attachments/assets/f8224243-f4ab-4af9-8dd8-5062dd7ea743)
|

- `regex_flags`: `keyword.regex`, see the [Regex
PR](https://github.com/zed-industries/zed/pull/25332) for other Regex
scopes
- `@`: `punctuation.special`, as in Python
- `jsx_text`: `text.jsx`
- `=`: `operator` -> `punctuation.jsx.delimiter`, `punctuation` as in
[VS
Code](0fe195613e/extensions/html/syntaxes/html.tmLanguage.json (L78))
and
[Atom](ee750a014a/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>
2025-02-21 21:54:16 +00: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 Improve auto-detection via shebang of TypeScript, JavaScript and Shell Script (#19114) 2024-10-13 02:35:46 -04:00
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 JavaScript and TypeScript syntax highlighting (#25328) 2025-02-21 21:54:16 +00: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