| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
Aligns C with the other language highlights
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
`preproc_arg` is used for the body of `#define` macro definition, which
is not appropriate to highlight with `@function.macro`. In addition,
this region has an injection to C, so it will get highlights anyway.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Moving comments, adding `format-ignore` to lines that will be better
with it
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
|
| |
|
|
|
|
|
|
|
|
|
|
| |
As discussed in PR#5421, capturing `@error` is inconsistent, requiring
deep nesting (or priority) in order to correctly have red backgrounds to
it.
Some queries has this capture, some don't. For consistency purposes,
removing all of them is more preferable.
For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)`
to your custom queries.
|
| | |
|
| | |
|
| | |
|
| |
|
| |
also update derived parsers (arduino, cuda, glsl, hlsl, ispc, objc)
|
| | |
|
| | |
|
| |
|
|
| |
`@function`
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
After https://github.com/nvim-treesitter/nvim-treesitter/issues/470,
we decided to use `@conditional` for ternary operator instead of
operator despite `@conditional` is documented for keywords only.
A sub-scoping can make it easier for people to highlight this operator
group differently.
Also unify the usage of `@conditional...` across languages.
|
| | |
|
| |
|
|
| |
Co-Authored-By: Stephan Seitz <stephan.seitz@fau.de>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Let's hope that this time the C tests pass, also for the built-in C
parser.
|
| |
|
|
|
|
|
| |
Lower the priority of @variable to prefer @parameter
highlight when identifier appears in parameter_declaration.
Fixes #3061
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Fixes #2120
|
| | |
|
| |
|
|
| |
as string.find is much quicker than vim.regex:match*
|
| |
|
|
|
|
|
| |
This was capturing too much,
we only want to highlight the identifier.
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1999
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A macro function such as
#define FOO(x) ...
should be highlighted with @function.macro, even though the name is in
all-caps (which would otherwise be treated as a constant). Similarly,
call sites of such functions, e.g.
int y = FOO(x);
should be highlighted with @function instead of @constant.
This is as simple as moving the query definition for macro functions
after the query definition for constants.
|
| | |
|
| | |
|