zed/styles
Nate Butler 45c635872b
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
2023-07-27 13:14:01 -04:00
..
.zed Update settings.json 2023-06-21 13:58:42 -04:00
src Extract syntax highlighting properties from tree-sitter highlight queries (#2797) 2023-07-27 13:14:01 -04:00
.eslintrc.js Organize and update dotfiles 2023-06-29 11:47:58 -04:00
.gitignore Set up vitest and add tests for interactive 2023-06-20 16:05:23 -07:00
.prettierignore
.prettierrc Organize and update dotfiles 2023-06-29 11:47:58 -04:00
package-lock.json Use theme store to pass color_scheme directly to components 2023-07-04 00:13:04 -04:00
package.json Add the generate-syntax action 2023-07-27 12:55:32 -04:00
tsconfig.json Format 2023-07-27 12:56:54 -04:00
vitest.config.ts Format 2023-06-20 16:05:23 -07:00