Commit graph

52 commits

Author SHA1 Message Date
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
Santos Gallegos
8cf90f81a4 Rust: highlight loop labels
Closes https://github.com/nvim-treesitter/nvim-treesitter/issues/1891
2021-10-01 22:33:49 +02:00
Santos Gallegos
f05f471185 Rust: fix some highlights
Closes https://github.com/nvim-treesitter/nvim-treesitter/issues/1856
2021-10-01 19:05:19 +02:00
Sergio Alejandro Vargas
eb3a09cb28 highlights(rust): Add colon : to delimiters 2021-09-26 12:24:48 +02:00
Sergio Alejandro Vargas
5ebc74c1a8 highlights(rust): fix bang ! in macro_invocation 2021-09-26 12:24:48 +02:00
Sergio Alejandro Vargas
0cd64db48f highlights(rust): Fix angle brackets, and closures
Highlight angle brackets in type parameters and bars in closures bars as
`@punctuation.bracket` not as `@operator`.
2021-09-26 12:24:48 +02:00
agarof
419153c1f1
folds(rust): Fold trait definitions (#1582) 2021-07-18 15:59:58 +00:00
Sergio Alejandro Vargas
a2b9b9bd9d highlights(rust): Reorder macro queries
Derive macros have to be defined before attribute macros to highlight
them properly.

See #570
2021-07-08 23:37:38 +02:00
antonk52
90f15d9bf7 feat(keywords) merge return and yield into keyword.return group 2021-07-04 21:49:17 +02:00
antonk52
bd9095e969 feat(keywords) add keyword.return & keyword.yield 2021-07-04 21:49:17 +02:00
tami5
89b1254cde rust: inject html to html! macro 2021-06-21 08:52:38 +02:00
Santos Gallegos
709f3a73b3 Rust: fix macros highlights
- The derive query was incorrect, it was only matching `#[derive(derive)]`
- Macros were being highlighted as keywords
- Procedural macros symbols weren't highlighted (`#`, `#!`)
2021-06-11 07:54:56 +02:00
Stephan Seitz
db7f10370d highlights(rust): highlight fields with shorthand_field_initializer 2021-05-24 20:43:31 +02:00
Santos Gallegos
9d1d9b1b94 Rust: highlight constants 2021-05-22 13:17:15 +02:00
Santos Gallegos
67f0857015 Revert "Comment: use @combined to create just one tree per buffer (#1252)"
This reverts commit 4a7a713c52.
2021-05-07 16:51:57 +02:00
Santos Gallegos
4a7a713c52
Comment: use @combined to create just one tree per buffer (#1252)
* Comment: use `@combined` to create just one tree per buffer

There is no need to create a tree per line/block for comments.
Should fix https://github.com/nvim-treesitter/nvim-treesitter/issues/1251

* Add injections for scss

* Fix jsonc

* Combine jsdoc
2021-04-28 07:19:07 -05:00
Stephan Seitz
853caf5b3d highlights(rust): Add operator "?" 2021-04-06 19:50:23 +02:00
Stephan Seitz
edcac596ce highlights(rust): Highlight dereferenced closure parameters 2021-03-26 20:12:38 +01:00
Yuki Ito
0c12ff67fe rust: tread , as a punctuation delimiter 2021-03-22 07:07:27 +01:00
Santos Gallegos
065ff440d4 Rust: add mod_item to folds 2021-03-15 19:23:59 +01:00
Rohit Pradhan
0e3dd8d3fa Rust: Add variable and closure parameter highlights 2021-03-15 19:02:39 +01:00
Santos Gallegos
e4083fc8e1
Add comment parser to highlight comment tags (#893)
Closes #236
2021-03-12 11:21:46 -05:00
Brian Shu
7ffcaf4ee8 fixed rust match indents 2021-03-01 23:35:25 +01:00
elianiva
0bf8f58cd2 feat: use @ignore for comments and multiline strings 2021-03-01 23:28:53 +01:00
elianiva
6533fb9af7 fix: rust use_list + tuple_expression indent 2021-02-08 07:03:16 +01:00
Cédric Barreteau
74b84a66d7 Use function keyword highlight group for Rust's fn 2021-01-20 20:26:35 +01:00
elianiva
9184cf3953 feat: added more indent queries 2021-01-14 14:43:04 +01:00
Brian Shu
005a3ca7f1 started branch 2021-01-07 01:31:39 +01:00
Santos Gallegos
3d4662e797 Rust: highlight brackets 2021-01-04 08:22:54 +01:00
Stephan Seitz
45397ebbd9 fix(highlights): Add TSNamespace highlight
Start adding highlights for
     - C++
     - Rust (including other scoped_identifier/scoped_type_identifier fixes)
     - JS (only namespace_import)

Addresses #516
2020-10-10 15:31:51 +02:00
Stephan Seitz
3362f45196 Remove textobjects module 2020-10-04 14:20:20 +02:00
Stephan Seitz
7e3c4f8089 Add @keyword.operator for operators that are English words and add @exception for Java/JS 2020-09-19 07:30:49 +02:00
kiyan42
feead20c04 change @meta to @type for derive directives because @meta is not defined 2020-09-06 17:00:41 +02:00
Avi Dessauer
d2538ab7a7 Change self back to variable.builtin 2020-08-20 09:03:58 +02:00
Avi Dessauer
aacca0abf1 Deduplicate queries/rust/highlights.scm
Co-authored-by: TravonteD <tman1300@aol.com>
2020-08-20 09:03:58 +02:00
Avi Dessauer
df37483e3a Highlight operators + improve consistency with Vim syntax 2020-08-20 09:03:58 +02:00
Steven Sojka
ce43dbf54c fix(queries): use vim-match for non lua regexes 2020-08-16 18:31:56 +02:00
Thomas Vigouroux
6133257ed6 highlights(rust): fix some type highlights. 2020-08-07 15:03:20 +02:00
Thomas Vigouroux
94a5056269 highlights(rust): add async/await keywords 2020-08-07 15:03:20 +02:00
Stephan Seitz
58c6d2a73f Attach kind of reference to query result instead of using subfields
This makes smart_rename work also for types out of the box and we don't
need to search for the path of actual node.
2020-07-20 08:55:53 +02:00
winwisely268
59c084b5d8 go loop and func literal, rust textobject support 2020-07-17 20:44:43 +02:00