aboutsummaryrefslogtreecommitdiffstats
path: root/queries/c/highlights.scm
Commit message (Collapse)AuthorAgeFilesLines
* feat!: drop modules, general refactor and cleanupChristian Clason2025-05-121-341/+0
|
* fix(c): highlight `"."` as `@punctuation.delimiter`Riley Bruins2025-03-181-1/+1
| | | | Aligns C with the other language highlights
* feat(c): use `@constant.macro` for macro identifiers (#7266)Omar Valdez2024-10-201-2/+11
|
* refactor(queries): Remove quotes from properties in set! directiveOmar Valdez2024-07-281-1/+1
|
* feat: more `@keyword.type` capturesRiley Bruins2024-05-011-4/+7
|
* fix(c): don't highlight preproc_argJaehwang Jung2024-03-271-3/+0
| | | | | | `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.
* refactor(format): drop extra indentation for fieldPhạm Huy Hoàng2024-03-211-7/+5
|
* feat(highlights)!: `@keyword.storage` → `@keyword.modifier`Jaehwang Jung2024-03-161-2/+2
|
* feat(highlights)!: keyword `@type.qualifier` → `@keyword.modifier`Jaehwang Jung2024-03-161-1/+1
|
* feat(c): local label highlightsRiley Bruins2024-02-261-0/+5
|
* chore: format queriesPhạm Huy Hoàng2024-01-211-2/+2
|
* chore: query formattingPham Huy Hoang2024-01-191-43/+86
|
* refactor: manual pre-cleanupPham Huy Hoang2024-01-191-3/+5
| | | | | Moving comments, adding `format-ignore` to lines that will be better with it
* feat!: align standard captures with upstreamChristian Clason2024-01-191-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`
* refactor: Remove all `(ERROR) @error` capturesPham Huy Hoang2023-10-251-2/+0
| | | | | | | | | | | | 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.
* feat(c): mention how to highlight K&R functionsAmaan Qureshi2023-08-131-0/+23
|
* feat(c): update highlightsAmaan Qureshi2023-08-111-3/+40
|
* chore: update C, improve preproc_arg highlightsAmaan Qureshi2023-07-271-0/+8
|
* fix(c)!: update C, CPP parsers and queriesAmaan Qureshi2023-07-271-8/+18
| | | also update derived parsers (arduino, cuda, glsl, hlsl, ispc, objc)
* fix(highlights): lower priority for codeblocks with injections (#4905)Christian Clason2023-06-051-4/+2
|
* fix(c): types are optional in sized_type_specifierAmaan Qureshi2023-04-211-1/+1
|
* feat(c): highlight parenthesized function pointer decl identifiers as ↵Amaan Qureshi2023-04-211-1/+6
| | | | `@function`
* feat: add `@comment.documentation` where applicableAmaan Qureshi2023-03-051-0/+3
|
* highlights(c): extern in linkage specificationObserverOfTime2023-01-261-0/+3
|
* highlights: create subscoping for ternary operatorStephan Seitz2022-12-021-1/+1
| | | | | | | | | | 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.
* highlights(c): primitive type as builtinAaron Rancsik2022-12-011-1/+2
|
* highlights(c): use more specific groupsObserverOfTime2022-11-261-8/+9
| | | | Co-Authored-By: Stephan Seitz <stephan.seitz@fau.de>
* highlights: use @preproc where appropriateObserverOfTime2022-10-151-1/+1
|
* highlights(c): highlight standard streamsObserverOfTime2022-10-151-0/+3
|
* feat(spell): support more languagesLewis Russell2022-09-261-2/+1
|
* feat(spell): upstream spell queries from spellsitterLewis Russell2022-09-061-0/+1
|
* Split func/method definition from calls in C highlighting querieslfenzo2022-08-031-2/+2
|
* highlights(c/cpp): move attributes to C (again)Stephan Seitz2022-07-281-0/+1
| | | | | Let's hope that this time the C tests pass, also for the built-in C parser.
* highlights(c): Lower the priority of @variablemliszcz2022-07-201-1/+2
| | | | | | | Lower the priority of @variable to prefer @parameter highlight when identifier appears in parameter_declaration. Fixes #3061
* highlights(c): highlight `,` operator as operator (#3107)guijan2022-07-081-7/+10
|
* highlights(c): highlight member-access as operator (#3096)guijan2022-07-011-1/+2
|
* highlights(c): highlight field_designator as `@property`Stephan Seitz2022-05-291-0/+1
|
* highlights(c/cpp): highlight case labels as constantsStephan Seitz2022-01-291-0/+2
|
* highlights(c): highlight enum variants as `@constant`Stephan Seitz2022-01-291-0/+2
| | | | Fixes #2120
* highlights(c): don't highlight type qualifiers in declarations as typesJohn Drouhard2022-01-201-2/+0
|
* Prefer lua-match over matchLewis Russell2021-11-231-1/+1
| | | | as string.find is much quicker than vim.regex:match*
* C: fix preproc parametersSantos Gallegos2021-11-141-2/+1
| | | | | | | This was capturing too much, we only want to highlight the identifier. Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1999
* highlights(c): add Mircosoft attributesStephan Seitz2021-09-191-1/+13
|
* highlights(c): add __attribute__Stephan Seitz2021-09-191-0/+1
|
* testStephan Seitz2021-09-171-7/+5
|
* highlights(c/cpp): react to upstream changes to attributesStephan Seitz2021-09-171-0/+2
|
* highlights(c): make sizeof a `keyword.operator`Sergio Alejandro Vargas2021-09-011-1/+1
|
* c: don't treat uppercase functions as constantsGregory Anders2021-07-181-9/+9
| | | | | | | | | | | | | | | | | 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.
* feat(keywords) merge return and yield into keyword.return groupantonk522021-07-041-3/+1
|
* feat(keywords) add keyword.return & keyword.yieldantonk522021-07-041-1/+4
|