aboutsummaryrefslogtreecommitdiffstats
path: root/queries/rust/highlights.scm
Commit message (Collapse)AuthorAgeFilesLines
* feat!: drop modules, general refactor and cleanupChristian Clason2025-05-121-531/+0
|
* Fix panic!, assert*!, and dbg! macro queries.Kieran Siek2025-02-041-6/+6
|
* feat(rust): highlight "gen" and "raw" keywords (#7419)flippette2024-11-291-0/+2
|
* fix(rust): highlight parameters with ref in definitionRiley Bruins2024-11-031-0/+8
|
* fix(rust): regex injections, highlightsRiley Bruins2024-10-271-0/+44
| | | | | | | | | **Problem:** Rust's regex injections were not applied since the string content is behind a `(string_content)` node, and the injections were applied to the parent node without the `include-children` directive. **Solution:** Apply the injections to the string content. Also highlight them accordingly.
* feat(highlights): capture wildcard patterns as `@character.special` (#7153)Omar Valdez2024-09-201-4/+13
|
* fix(rust): comment marker should not be `@operator` (#7135)Amaan Qureshi2024-09-101-11/+14
|
* feat(rust): add highlight for shorthand_field_identifierTobias Schmitz2024-08-221-0/+2
|
* feat(highlights): capture wildcard imports as `@character.special`Omar Valdez2024-08-011-0/+3
|
* feat(rust): underscore match arms, parametersRiley Bruins2024-05-081-2/+8
|
* feat: more `@keyword.type` capturesRiley Bruins2024-05-011-5/+8
|
* fix(rust): update queries from upstreamAmaan Qureshi2024-04-071-1/+1
|
* refactor(format): drop extra indentation for fieldPhạm Huy Hoàng2024-03-211-29/+20
|
* feat(rust): move pub to `@keyword.modifier`Riley Bruins2024-03-161-4/+1
| | | | Also consolidates most of the captures
* feat(rust,lalrpop): `@attribute` for lifetimesJaehwang Jung2024-03-161-4/+8
| | | | `@keyword` is only for language-defined keywords.
* 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(highlights)!: enforce documented captures (#6232)Christian Clason2024-03-031-1/+1
| | | | | | | | | | | | | | | Problem: Allowing undocumented "secret" (sub)captures makes it harder to write comprehensive colorschemes and catch inconsistent captures. Solution: Only allow captures listed in CONTRIBUTING.md. Add useful (cross-language) subcaptures and drop language-specific or too niche ones. Follow-up: Adding further `*.builtin` captures and changing queries to use them. Language-specific subcaptures should instead be added in user config or a custom language plugin.
* feat(rust): add doc commentsChristian Clason2024-02-171-13/+4
|
* chore(rust): update highlightsAmaan Qureshi2024-01-241-0/+5
|
* chore: query formattingPham Huy Hoang2024-01-191-82/+160
|
* feat!: align standard captures with upstreamChristian Clason2024-01-191-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`
* fix(rust): highlight inline attributes properlyRiley Bruins2023-12-181-0/+1
|
* chore(rust): update queries from upstreamAmaan Qureshi2023-11-171-1/+1
|
* style(rust): better formattingAmaan Qureshi2023-05-091-26/+88
|
* feat(rust): distinguish enum members betterAmaan Qureshi2023-05-091-0/+12
|
* feat(rust): capture debug macros as `@debug`Iron-E2023-05-041-0/+2
| | | | | | | | | | | | | * ref(rust): highlight debug macros as `@debug` E.g. `dbg!` and `debug_assert!` * Update queries/rust/highlights.scm Co-authored-by: Amaan Qureshi <amaanq12@gmail.com> --------- Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
* feat(rust): move some keywords & operators to where they belongAmaan Qureshi2023-04-191-12/+10
|
* fix(rust): highlight SNAKE_CASE scoped identifier name as @constantJaehwang Jung2023-04-091-0/+3
|
* feat: add `@comment.documentation` where applicableAmaan Qureshi2023-03-051-0/+12
|
* feat!: add `@keyword.coroutine` captureAmaan Qureshi2023-03-031-2/+5
|
* highlights(rust): use `@namespace` for `[(crate) (self) (super)]`Stephan Seitz2023-01-011-4/+4
| | | | Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/3992
* rust: use @type.qualifier and @storageclassTrard2022-11-061-5/+12
|
* highlights(rust): pub(self/super/crate), use super::thing, etcCormac Relf2022-11-061-1/+2
|
* highlights(rust): ["<" ">"] @punctuation.bracket in bracketed_type, ↵Cormac Relf2022-11-061-0/+2
| | | | for_lifetimes
* highlights(rust): "for" @keyword everywhere else (for<'a>, HRTBs)Cormac Relf2022-11-061-2/+1
|
* highlights(rust): highlight Type in Type::Associated as @type instead of ↵Cormac Relf2022-11-061-0/+3
| | | | @namespace
* highlights(rust): panic!() and assert!() as @exceptionCormac Relf2022-11-061-0/+5
|
* fix(rust): update queries to breaking changesChristian Clason2022-11-051-6/+6
| | | | | | | * `if_let_expression` was removed in https://github.com/tree-sitter/tree-sitter-rust/pull/152 * `attributes` were reworked in https://github.com/tree-sitter/tree-sitter-rust/pull/163 (no more `meta-item`)
* highlights(rust): distinguish between "for" in loops and impl_itemStephan Seitz2022-10-151-2/+4
| | | | Fixes #3641
* feat(spell): support more languagesLewis Russell2022-09-261-6/+1
|
* feat(spell): upstream spell queries from spellsitterLewis Russell2022-09-061-0/+5
|
* Split func/method definition from calls in several programming language querieslfenzo2022-08-031-6/+6
|
* highlights(rust): highlight as in <Struct as Trait>::TypeStephan Seitz2022-03-111-0/+1
|
* highlights(rust): add "yield" keywordStephan Seitz2022-01-161-1/+4
|
* rust(highlights): fix highlighting of char_literalStephan Seitz2021-12-061-1/+1
|
* highlights(rust): organize keywords and literalsSergio Alejandro Vargas2021-11-251-59/+70
| | | | | | | | | - 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
* highlights(rust): update operatorsSergio Alejandro Vargas2021-11-251-68/+48
| | | | | | | | | | | | - 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
* Prefer lua-match over matchLewis Russell2021-11-231-10/+10
| | | | as string.find is much quicker than vim.regex:match*
* Rust: highlight uppercase identifiers in match arms as constant (#1940)Santos Gallegos2021-10-301-0/+15
| | | | | | | * Rust: highlight uppercase identifiers in match arms as constant Closes https://github.com/nvim-treesitter/nvim-treesitter/issues/1928 * Highlight builtins