# Extract syntax highlighting properties from tree-sitter highlight queries \(\#2797\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/45c635872b5ef7bb8994e16d593aa25edf8e94bf)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 45c635872b5ef7bb8994e16d593aa25edf8e94bf

Requested commit: 45c635872b5ef7bb8994e16d593aa25edf8e94bf

Commit: 45c635872b5ef7bb8994e16d593aa25edf8e94bf

Tree: 8dd45c77cc3a83ff4328cc0acdc007efe302ffd6

Author: Nate Butler

Committer: GitHub

## Message

````
Extract syntax highlighting properties from tree-sitter highlight queries (#2797)

This should be a purely internal change. Let me know if any visual
changes are observed from this!

### Syntax theme
- Update the theme to allow any syntax highlighting property used in any
`highlight.scm` to be styled
- Only define syntax styles that are baked into the default theme &
don't use the default text style
- Adds the `generate-syntax` command
- Removes a few unused properties that we were styling for some reason,
like `enum` and `variant`, neither of which exist in any `highlight.scm`
- Moves `@constructor` symbols to `@method.constructor` to prevent
issues with `constructor` being a reserved property in ts/js.

Syntax is now build as the theme is created rather than as part of the
styleTree. This means it no longer requires a compiled `Theme`, which
makes things a bit more straightforward if we need to access it in other
components that should be built before the styleTrees.

### Scheme

Also updates all uses of `#match` in our `highlights.scm` files, as
these break the scheme tree-sitter query. This fixes _most_ instances of
our scheme highlighting breaking.

For some reason something in here breaks the `highlights.scm` for PHP:

```scheme
((name) @constant.builtin
 (.match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))

((name) @method.constructor
(.match? @method.constructor "^[A-Z]"))

((name) @variable.builtin
 (.eq? @variable.builtin "this"))
```

Release Notes:

- No public facing changes
````

## Parents

- [f2b82369f27b79fdcaa6a4276bb047abddf7171c](https://git.cafe/gitcafe/zed/commit/f2b82369f27b79fdcaa6a4276bb047abddf7171c?format=markdown)

- [b08a2770b867951c38a4286ebf96223578f0fc4a](https://git.cafe/gitcafe/zed/commit/b08a2770b867951c38a4286ebf96223578f0fc4a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/45c635872b5ef7bb8994e16d593aa25edf8e94bf?format=markdown)
