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
Christian Clason
dd89cafd2b
fix(rust): update queries to breaking changes
...
* `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`)
2022-11-05 11:09:54 +01:00
Stephan Seitz
53742779e3
highlights(rust): distinguish between "for" in loops and impl_item
...
Fixes #3641
2022-10-15 04:02:20 -07:00
Lewis Russell
37398c7d68
feat(spell): support more languages
2022-09-26 13:47:12 +01:00
Lewis Russell
2a63ea5665
feat(spell): upstream spell queries from spellsitter
2022-09-06 12:44:19 +01:00
lfenzo
c784720917
Split func/method definition from calls in several programming language queries
2022-08-03 12:05:30 -07:00
kiyan
8bc4d046e7
fix(rust): remove if_let from indent captures
...
fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/3073
2022-07-08 00:27:51 +02:00
Stephan Seitz
f301caffc5
highlights(rust): highlight as in <Struct as Trait>::Type
2022-03-11 19:07:11 +01:00
Munif Tanjim
c2e3938510
fix(indent): rust - support newline after closing brace
2022-01-21 16:40:36 +01:00
Munif Tanjim
c0110e34aa
feat: rewrite indent module
2022-01-21 10:51:51 +01:00
Stephan Seitz
7889b3aea8
highlights(rust): add "yield" keyword
2022-01-16 16:27:29 +01:00
Stephan Seitz
225cac5e6b
injections(rust): inject regex into Regex::new
2021-12-14 14:28:26 +01:00
Stephan Seitz
e6eeda7da9
rust(highlights): fix highlighting of char_literal
2021-12-06 21:20:58 +01:00
Sergio Alejandro Vargas
fbbcfa7b6c
highlights(rust): organize keywords and literals
...
- 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
2021-11-25 23:53:41 +01:00
Sergio Alejandro Vargas
81f75a54ff
highlights(rust): update operators
...
- 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
2021-11-25 23:53:41 +01:00
Lewis Russell
011ac894ec
Prefer lua-match over match
...
as string.find is much quicker than vim.regex:match*
2021-11-23 10:02:06 +01:00
Santos Gallegos
bd13991050
Rust: highlight uppercase identifiers in match arms as constant ( #1940 )
...
* Rust: highlight uppercase identifiers in match arms as constant
Closes https://github.com/nvim-treesitter/nvim-treesitter/issues/1928
* Highlight builtins
2021-10-30 12:09:54 -05:00