Stephan Seitz
3ff725e654
indents(c): fix ternary
2022-02-05 18:54:55 +01:00
Stephan Seitz
e4675bc410
highlights(c/cpp): highlight case labels as constants
2022-01-29 13:11:56 +01:00
Stephan Seitz
1d3111ccb1
highlights(c): highlight enum variants as @constant
...
Fixes #2120
2022-01-29 13:11:56 +01:00
Stephan Seitz
7f7ef0af9d
folds(c): fold raw compound_statements
...
This will fold in particular around raw braces
as reported in #2359 while avoiding to have double folds
at functions+braces.
2022-01-28 19:54:26 +01:00
Cédric Barreteau
91fdda9b5c
folds(c): fold at compound_statement
2022-01-24 22:56:58 +01:00
Munif Tanjim
782e299cd6
fix(indent): c/cpp - 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
John Drouhard
d0158c053d
highlights(c): don't highlight type qualifiers in declarations as types
2022-01-20 08:40:51 +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
b972f1d985
C: fix preproc parameters
...
This was capturing too much,
we only want to highlight the identifier.
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1999
2021-11-14 11:02:57 +01:00
igorlfs
6e25164004
Fix #1853
2021-09-30 19:36:29 +02:00
Stephan Seitz
18dc243188
highlights(c): add Mircosoft attributes
2021-09-19 20:02:28 +02:00
Stephan Seitz
5fa6e27427
highlights(c): add __attribute__
2021-09-19 14:13:50 +02:00
Stephan Seitz
440d666b68
test
2021-09-17 22:03:47 +02:00
Stephan Seitz
37d93ec017
highlights(c/cpp): react to upstream changes to attributes
2021-09-17 22:03:47 +02:00
Sergio Alejandro Vargas
9446ff4aa4
highlights(c): make sizeof a keyword.operator
2021-09-01 07:07:16 +02:00
leo60228
1a4b5da758
Indent C compound_literal_expression
2021-08-01 11:01:47 +02:00
Gregory Anders
27f5e99cdd
c: don't treat uppercase functions as constants
...
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.
2021-07-18 16:44:40 +00:00
Stephan Seitz
6b31df7852
c(folds): fold on enums
2021-07-14 23:00:14 +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
Stephan Seitz
b57194325c
indents(c/cpp): let C++ use the C indents and add class_specifier
...
Fixes #1320
2021-05-20 19:37:42 +02:00
Stephan Seitz
506e998da2
highlights(c/c++): "..." also exists in C (variadic macros)
2021-05-18 07:07:16 +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
Stephan Seitz
2873d1efda
highlights(c): highlight (escape_sequence)
2021-05-01 09:39:41 +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
563616738b
folds(c): fold at case_statement
2021-04-26 05:15:55 +02:00
Thomas Vigouroux
03bb038c70
fix(c): fold switch statements
2021-04-22 16:30:31 +02:00
Stephan Seitz
423fb7b4aa
C highlights: Make char_literal @character
2021-04-21 18:37:38 +02:00
Santos Gallegos
e4083fc8e1
Add comment parser to highlight comment tags ( #893 )
...
Closes #236
2021-03-12 11:21:46 -05:00
Stephan Seitz
866f39bb71
highlights(c): update declaration and cast_expression
2021-03-02 16:55:18 +01:00
elianiva
0bf8f58cd2
feat: use @ignore for comments and multiline strings
2021-03-01 23:28:53 +01:00
Fabian Viöl
34bb66c48f
Add 'register' as c-keyword
...
See https://en.wikipedia.org/wiki/Register_(keyword)
2021-03-01 09:12:44 -05:00
Santos Gallegos
72ecefc859
C/CPP: add injections for macros
2021-02-10 22:26:04 +01:00
Santos Gallegos
00ad11eb2f
C: add goto to locals
2021-01-22 20:19:43 +01:00
elianiva
9184cf3953
feat: added more indent queries
2021-01-14 14:43:04 +01:00
Thomas Vigouroux
632a9f1e3c
fix(c highlights): add missing operators
2021-01-06 10:48:35 -05:00
Stephan Seitz
40588da97c
Remove usages of @embedded in highlights
2021-01-06 09:12:32 -05:00
Stephan Seitz
382e09aa56
Fix #724 : Add (initializer_list) to C folds
2020-11-30 11:13:20 +01:00
Thomas Vigouroux
049028ef3e
c highlights: fix define/undef arguments
2020-11-22 22:33:56 +01:00
John Drouhard
33ffdce690
c/cpp highlights: Fix field declarations and initializers
...
After a recent fix for #446 , declarations in class/struct definitions
stopped being marked as properties or methods. This fix will add
property highlights to field declarations, and method highlight to field
function declarations.
2020-11-20 14:03:06 +01:00
Stephan Seitz
289cdc9da8
Do not highlight Uppercase function as type
2020-11-18 21:54:04 +01:00
Stephan Seitz
3674ad89df
fix(predicates): Fix #446 : highlight property only if not a method
2020-11-18 21:54:04 +01:00
Stephan Seitz
3362f45196
Remove textobjects module
2020-10-04 14:20:20 +02:00
Stephan Seitz
bcf421b4e7
Fix #307 : Use and document TSVariable/TSVariableBuiltin in all languages
2020-09-14 18:27:20 +02:00
Santos Gallegos
50991e370b
Folds: rename query files to folds.scm to be consistent
...
We use plural names for all query files except folds.
2020-09-14 18:26:30 +02:00
Stephan Seitz
da6bc7be20
fix(cpp highlights): Use @include for preproc_include ( fix #445 )
2020-09-13 12:46:52 +02:00
Stephan Seitz
985c5def34
C/C++ locals: Deduplicate C++ locals contained in C
2020-09-08 22:02:39 +02:00
Stephan Seitz
8bc5d1ff3f
Add C++ folds and C comment/preproc folds
2020-09-08 22:02:39 +02:00
Thomas Vigouroux
d5e11c41cf
fold(c): ignore compound statements
2020-09-01 21:51:17 +02:00