Riley Bruins
f58cae6c22
feat: more @keyword.type captures
2024-05-01 09:59:50 +02:00
Phạm Huy Hoàng
722617e672
refactor(format): drop extra indentation for field
2024-03-21 15:51:26 +01:00
Jaehwang Jung
998b230a77
feat(highlights)!: keyword @type.qualifier → @keyword.modifier
2024-03-16 20:51:16 +08:00
Chad Condon
b781fd0582
fix(c): improve doxygen comment matching ( #6278 )
2024-03-11 19:02:53 +02: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
Phạm Huy Hoàng
62b0bb4f24
feat(format): extra newline after modeline
2024-02-29 23:05:30 +09:00
Jaehwang Jung
2b6020247d
fix(cpp): add back comment injection
2024-02-13 13:16:00 +01:00
Phạm Huy Hoàng
77e298e4de
chore: format queries
2024-01-21 23:55:02 +09: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
Jędrzej Boczar
d496c5e08e
fix(cpp): incorrect indent of class with opening { on new line ( #5811 )
2023-12-22 05:49:13 +09:00
HumblePresent
ba588ee0cf
fix(cpp): remove @field for identifiers with _ prefix ( #5731 )
2023-11-27 18:18:38 -05:00
Amaan Qureshi
f53e6e82df
fix(cpp): highlight constexpr
2023-11-10 16:08:46 -05:00
Amaan Qureshi
a4f4fcdd3e
feat: add Doxygen
2023-08-26 04:58:36 -04:00
Amaan Qureshi
b5f2030312
chore(c-family): inject all preproc args again
2023-08-13 18:57:23 -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
Amaan Qureshi
41f35eac4f
fix(c-family): inject into preproc args in preproc defs when it spans multiple lines only
2023-08-11 14:38:50 -04:00
Amaan Qureshi
3d3b335ace
fix(cpp): update injections from C
2023-08-10 16:09:50 +02:00
Amaan Qureshi
ad3805f5c3
fix(c)!: update C, CPP parsers and queries
...
also update derived parsers (arduino, cuda, glsl, hlsl, ispc, objc)
2023-07-27 09:51:13 +02:00
Christian Clason
e58bbe83f9
lint(locals): use #set! to keep query linter happy
2023-06-22 08:39:17 +02:00
fab4100
8e59b4919d
fear(cpp): highlight brackets in template_parameter_list
2023-05-20 14:41:54 -04:00
Amaan Qureshi
85330918f0
perf: remove match where possible
2023-04-21 18:24:17 -04:00
John Drouhard
dad0864fa3
feat(cpp): improve function.call to support any level of nesting for qualified identifiers
2023-04-15 07:00:14 -07:00
Jaehwang Jung
e482c9b4e2
feat(cpp): more distinction between function/method declaration and call
2023-04-08 09:40:30 -07:00
John Drouhard
300ba8d5a5
feat(cpp): simplify namespace query rules now that parser is a bit more consistent
2023-03-27 10:20:38 -04: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
6a269f197e
fix(cpp): nullptr should be @constant.builtin
2023-03-19 08:14:10 -04:00
Amaan Qureshi
33ba346e60
feat!: add @keyword.coroutine capture
2023-03-03 07:07:52 -08:00
John Drouhard
ed021ac3af
injections(cpp): add injections for raw string literals
...
the delimiter describes the language to use for the injection content
```cpp
auto python_code = R"python(
import os
if __name__ == '__main__':
print(os.name)
)python";
```
2023-01-09 21:41:13 +02:00
Aaron Rancsik
4e21b50fbd
highlights(cpp): auto as @type.builtin
2022-12-01 15:08:07 +01:00
ObserverOfTime
79705a1f80
highlights(cpp): use more specific groups
2022-11-26 13:17:51 +02:00
mliszcz
276718c245
highlights(cpp): add alternative operator names
...
These keywords are now supported by the parser.
See: https://github.com/tree-sitter/tree-sitter-cpp/pull/179
2022-10-11 14:37:14 +02:00
lfenzo
576287ac84
Split func/method definition from calls in C++ highlighting queries
2022-08-03 12:05:30 -07:00
Stephan Seitz
f9176e560c
highlights(c/cpp): move attributes to C (again)
...
Let's hope that this time the C tests pass, also for the built-in C
parser.
2022-07-28 08:24:51 +02:00
Stephan Seitz
a4f9539a0c
highlights(cpp): make "::" @punctuation.delimiter
...
Fixes #2902
2022-05-07 13:30:36 +02:00
Fabian Viöl
68c36cc59f
highlights(cpp): Add operator cast highlight
...
See https://en.cppreference.com/w/cpp/language/cast_operator for
reference.
2022-03-02 11:00:01 +01:00
Fabian Viöl
4990db79a8
highlights(cpp): Highlight method with nested qualified_identifier
...
so that methods like these are correctly highlighted
```cpp
class A {
class B {
void foo();
};
};
void A::B::foo() {
// ^^^
}
```
This only increases the nesting level by one.
AFAIK abritrary nesting is difficult to do with current queries.
But this nesting is a pretty common case
2022-02-09 21:35:00 +01:00
Stephan Seitz
62982378b8
indents(cpp): indent at field_initializer_list
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
974e2181a0
highlights(cpp): fix function highlighting of Foo::bar::baz()
...
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2396
2022-01-29 12:40:35 +01:00
Munif Tanjim
c0110e34aa
feat: rewrite indent module
2022-01-21 10:51:51 +01:00
Stephan Seitz
788814fb06
highlights(cpp): add support for "<=>", "constinit", "consteval"
2022-01-17 16:52:45 +01:00
Stephan Seitz
3ee34749bc
locals(cpp): add support for concepts
2022-01-16 22:19:34 +01:00
Stephan Seitz
db01c82b08
highlights(cpp): add support for concepts
...
Requires https://github.com/tree-sitter/tree-sitter-cpp/pull/138
2022-01-16 22:19:34 +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
Dundar Göc
6a4fdb317d
chore: fix typos
2021-11-02 23:47:48 +01:00
Stephan Seitz
b6dcb81939
highlights(cpp): highlight literal_suffix as @operator
2021-10-20 09:16:07 +02:00
John Drouhard
e643eb5dbd
cpp: highlight template method identifier as a method
2021-09-27 00:09:17 +02:00
John Drouhard
536179c8e2
cpp: fix locals.scm from breaking change in tree-sitter-cpp
2021-09-26 11:20:09 +02:00