Assume that any identifiers that aren't function calls, types, fields or
constants are variables. This is consistent with the highlighting
definitions for other languages. Some themes (e.g. zenbones) make use of
this information and they don't look quite right unless we set those
groups.
* feat(fusion): update tests
* fix(fusion): update lockfile
* fix(fusion): update to (highlight breaking) version 1.1.0
* update grammer to introduce afx support
* update tests and queries
* fix: revert lockfile update of unrelated grammars
* fix: update to 1.1.1 and fix hightlights
* fix: use @tag.attribute capture to match specs
Co-authored-by: Jirgn <jirgn76@googlemail.com>
1. This function simplifies an unnecessary lua-match usage.
2. Fixes an accidental change, where "cls" was changed to "class" (fe4f320b66)
3. Match functions, which have have a decorator.
4. But exclude @staticmethod
5. Only highlight "cls" as @variable.builtin when the decorator is @classmethod
This might be a bit to complicated and some of this not to useful,
as this existing rule:
```scm
((identifier) @variable.builtin
(#eq? @variable.builtin "self"))
```
overwrites the queries anyway.
Now that there are 4 cases handled, I thought it probably needs some comments to
show which case each injection is for.
There are other unsupported cases, such as `.withConfig` but I'm not sure if
they all belong here or into their own plugin or something.
The API reference is available here:
https://styled-components.com/docs/api
Also, not sure if there is a more generic way of handling all these cases at
once, a rule that would read: "any template string descendant from 'styled'".
Will attempt to open a PR and get some advice.
I've never written this sort of code before but I was able to get this to work
with the help of copy and paste and using nvim-treesitter/playground.
I had a hard time trying to understand how to indent this style of code so I let
vim do it with `=` and 2 spaces seems to match other files I looked at.
This works for a basic example, like this:
```
const Layout = styled.div`
position: absolute;
inset: 0;
display: grid;
grid-template-rows: 100px 1fr 3rem;
`
```
- sort keywords
- highlight super as a namespace (same as crate)
- highlight `break` and `continue` as `repeat` keywords
- don't highlight `macro_rules!` as a keyword
- place all literal queries together
- place function definition queries alongside function call queries
- sort operators
- remove duplicated `*`
- add missing `<<=`
- highlight `as` correctly in path aliasing
- highlight leading quote `'` as part of a label (not an operator)
- highlight never type `!` as a type
- sort and format punctuation