Riley Bruins
9a47a523e3
feat: import statement folds for common languages
2024-05-01 10:00:01 +02:00
Riley Bruins
f58cae6c22
feat: more @keyword.type captures
2024-05-01 09:59:50 +02:00
Amaan Qureshi
53c48a9229
fix(rust): update queries from upstream
2024-04-07 02:58:11 -04:00
ganhaque
1b050206e4
fix(rust): indentation in multi-line tuple pattern ( #6402 )
...
* fix(rust): indentation in multi-line tuple pattern
* test(indent): rust - add test for tuple pattern indent
2024-04-04 15:12:31 +00:00
ganhaque
5489e2150f
fix(rust): indentation in multi-line for expression
...
Fix indentation when the for loop expression is on multiple lines
Example:
previous:
```rust
for (
abc,
def
) in thing.iter() {
// ...
}
```
new:
```rust
for (
abc,
def
) in thing.iter() {
// ...
}
```
2024-04-04 09:50:27 +02:00
ganhaque
4d4b63692f
fix(rust): indentation in tuple type patterns
2024-04-04 09:50:27 +02:00
Amaan Qureshi
3d473a4d5d
fix(rust): indentation in tuple struct patterns
2024-03-26 22:34:53 -04:00
Phạm Huy Hoàng
722617e672
refactor(format): drop extra indentation for field
2024-03-21 15:51:26 +01:00
Amaan Qureshi
c28396de30
feat(rust): improve indents
2024-03-21 06:48:53 -04:00
Amaan Qureshi
4d76587eec
fix(rust): dedent on macro definition end
2024-03-20 19:22:23 -04:00
Riley Bruins
3c7a0e9d94
feat(rust): move pub to @keyword.modifier
...
Also consolidates most of the captures
2024-03-16 20:45:29 -04:00
Jaehwang Jung
8f5513a1f2
feat(rust,lalrpop): @attribute for lifetimes
...
`@keyword` is only for language-defined keywords.
2024-03-16 20:51:16 +08:00
Jaehwang Jung
dccf31f9b1
feat(highlights)!: @keyword.storage → @keyword.modifier
2024-03-16 20:51:16 +08:00
Jaehwang Jung
998b230a77
feat(highlights)!: keyword @type.qualifier → @keyword.modifier
2024-03-16 20:51:16 +08:00
Christian Clason
99ddf57353
feat(highlights)!: enforce documented captures ( #6232 )
...
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.
2024-03-03 11:00:11 +01:00
Amaan Qureshi
6f1f407d71
feat(rust): add more regex injection queries
2024-02-25 09:05:08 -05:00
Christian Clason
17d68ac13c
feat(rust): add doc comments
2024-02-17 13:24:12 +01:00
Tobias Hunger
0f3183dda8
feat(slint)!: change to the official parser ( #6027 )
...
This change replaces the slint parser written and maintained by @jrmoulton
with the official one hosted in the slint-ui organization on github.
A huge thank you to @jrmoulton for all his work on the tree-sitter
parser!
---------
Co-authored-by: jrmoulton <jaredmoulton3@gmail.com>
2024-02-09 13:46:57 +00:00
Amaan Qureshi
527eb602ff
chore(rust): update highlights
2024-01-24 01:29:48 -05:00
Phạm Huy Hoàng
41128a7724
fix(rust): Follow upstream injections
...
tree-sitter-rust and helix both have `injection.include-children` for
the pattern in this PR. So it's best to changed to match the intended
results
2024-01-24 12:18:32 +09:00
Phạm Huy Hoàng
77e298e4de
chore: format queries
2024-01-21 23:55:02 +09:00
Amaan Qureshi
1ce6000a95
fix(rust): add const_item to folds
2024-01-20 18:50:31 +09:00
Pham Huy Hoang
c41d38b70e
fix(rust): Add back 1 indent for macro rules ( #5834 )
2024-01-20 18:50:31 +09:00
Amaan Qureshi
8c629a9327
chore(rust): tweak injections, add json macro injection
2024-01-19 16:58:37 +01:00
Pham Huy Hoang
57a8acf0c4
chore: query formatting
2024-01-19 16:58:37 +01:00
Christian Clason
1ae9b0e455
feat!: align standard captures with upstream
...
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"
(3f44b89685/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`
2024-01-19 16:58:37 +01:00
Christian Clason
5b90ea2aba
feat(locals)!: switch to upstream captures
2024-01-19 16:58:37 +01:00
Riley Bruins
24be1534db
fix(rust): highlight inline attributes properly
2023-12-18 11:47:01 -05:00
Amaan Qureshi
557561fbc1
chore(rust): update queries from upstream
2023-11-17 13:32:09 +01:00
Amaan Qureshi
6f8387f05d
fix(rust): add foreign_mod_item to folds
2023-10-30 04:30:30 -04:00
Amaan Qureshi
a4f4fcdd3e
feat: add Doxygen
2023-08-26 04:58:36 -04:00
Amaan Qureshi
c58694685d
feat: add re2c
2023-08-24 02:52:48 -04:00
Pham Huy Hoang
78b54eb7f6
chore(injections)!: update injection syntax to 0.9
...
Since 0.9, @lang syntax is still available as fallback but will soon be deprecated.
Because of that, new syntax should be adopted once 0.9 becomes the
baseline requirements for nvim-treesitter
- update health check
- update doc
2023-08-12 17:34:15 +02:00
Christian Clason
e58bbe83f9
lint(locals): use #set! to keep query linter happy
2023-06-22 08:39:17 +02:00
Amaan Qureshi
5182759e17
style(rust): better formatting
2023-05-09 08:33:38 -04:00
Amaan Qureshi
6df6dd2622
feat(rust): distinguish enum members better
2023-05-09 08:33:38 -04:00
Iron-E
239bb86b54
feat(rust): capture debug macros as @debug
...
* 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>
2023-05-04 15:49:20 -04:00
Amaan Qureshi
831f37635d
feat(rust): move some keywords & operators to where they belong
2023-04-19 02:28:00 -04:00
Jaehwang Jung
fa9fe9a95b
fix(rust): highlight SNAKE_CASE scoped identifier name as @constant
2023-04-09 08:12:17 -07:00
George Harker
cb568af539
use indent.X syntax for captures and properties of set directives
...
update CONTRIBUTING.md
adjust indents for bass
fix doc capture comment
2023-03-24 13:07:53 -04:00
Amaan Qureshi
5a87bc98da
feat: add @comment.documentation where applicable
2023-03-05 17:15:32 -05:00
Amaan Qureshi
33ba346e60
feat!: add @keyword.coroutine capture
2023-03-03 07:07:52 -08:00
Chinmay Dalal
68e8181dbc
folds(rust): add array_expression
2023-01-05 20:37:14 +01:00
Stephan Seitz
6a31d9086e
highlights(rust): use @namespace for [(crate) (self) (super)]
...
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/3992
2023-01-01 15:32:07 +01:00
Trard
00b42ac6d4
rust: use @type.qualifier and @storageclass
2022-11-06 18:10:42 +01:00
Cormac Relf
00add7e4b4
highlights(rust): pub(self/super/crate), use super::thing, etc
2022-11-06 14:32:47 +01:00
Cormac Relf
68c3533852
highlights(rust): ["<" ">"] @punctuation.bracket in bracketed_type, for_lifetimes
2022-11-06 14:32:47 +01:00
Cormac Relf
1379119c31
highlights(rust): "for" @keyword everywhere else (for<'a>, HRTBs)
2022-11-06 14:32:47 +01:00
Cormac Relf
15d3849dcf
highlights(rust): highlight Type in Type::Associated as @type instead of @namespace
2022-11-06 14:32:47 +01:00
Cormac Relf
8c7ffaf66b
highlights(rust): panic!() and assert!() as @exception
2022-11-06 11:34:13 +01:00