Commit graph

49 commits

Author SHA1 Message Date
Omar Valdez
188b1a6d01
feat(highlights): capture wildcard patterns as @character.special (#7153) 2024-09-20 08:15:01 +02:00
Omar Valdez
51bba660a8 refactor(queries): Remove quotes from properties in set! directive 2024-07-28 11:43:41 +02:00
Christian Clason
a80fe081b4 feat(predicates)!: rename has-type to kind-eq to align with Helix
No point in having a different name for the same predicate.
2024-06-02 12:07:58 +02:00
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
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02:00
ObserverOfTime
fa38f4e6f9 fix(highlights): improve member/property distinction 2024-01-19 16:58:37 +01:00
ObserverOfTime
2f38c36294 fix(highlights): improve consistency 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
57a8acf0c4 chore: query formatting 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
edee83272e refactor: manual pre-cleanup
Moving comments, adding `format-ignore` to lines that will be better
with it
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
Pham Huy Hoang
107e61afb7 refactor: Remove all (ERROR) @error captures
As discussed in PR#5421, capturing `@error` is inconsistent, requiring
deep nesting (or priority) in order to correctly have red backgrounds to
it.

Some queries has this capture, some don't. For consistency purposes,
removing all of them is more preferable.

For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)`
to your custom queries.
2023-10-25 18:18:50 +02:00
Jaehwang Jung
9e52d8fda3 feat(ocaml): use @function.call where appropriate 2023-10-03 17:54:10 +02:00
Jaehwang Jung
9567185621 feat: @spell on comments 2023-09-12 17:34:58 +02: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
Pieter Goetschalckx
a6063b22c9
highlights(ocaml): update operators (#4878)
* Update ocaml highlights

* Don't capture operator twice
2023-06-01 10:28:00 +09:00
Pham Huy Hoang
b4d2640eab
feat: add indents for ocaml and ocaml interface (#4725) 2023-05-01 20:42:21 +09:00
Amaan Qureshi
85330918f0 perf: remove match where possible 2023-04-21 18:24:17 -04:00
ObserverOfTime
8d598de022 highlights(ocaml): use more specific groups 2022-11-26 13:17:51 +02:00
Robin Björklin
3ad2aa578a fix(ocaml): change query order for Variables
By moving the Variables query higher it gives the @variable capture
group a lower precedence when highlighting.
This makes it possible to distinguish between @function and @variable.
2022-10-25 12:19:50 +02:00
Pau Ruiz Safont
09efcdb049 highlights(ocaml): highlight units as such
Units were shadowed by the punctuation highlights in all situations.
Restrict the context where parentheses are highlighted as punctuation so
() can be highlighted as constants.

Signed-off-by: Pau Ruiz Safont <unduthegun@gmail.com>
2022-05-06 10:31:12 +02:00
Dawid Zych
d6a0a26b85 OCaml string format specifiers
For format specifiers use @string.special instead of
@punctuation.special.
2021-12-02 16:56:58 +01:00
silenc3r
acf0c0f6a1 OCaml use @constant.builtin for built in constants 2021-12-01 19:38:36 +01:00
Sergio Alejandro Vargas
820b4a9c21 Use @keyword.function consistently 2021-07-06 00:53:40 +02:00
Joakker
c699cc2e47 Use #any-of? instead of #match? where posible 2021-06-25 00:22:48 +02:00
Pau Ruiz Safont
048682a3ae highlights(ocaml): add hash and sign operators 2021-05-11 23:24:10 +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
f455980b69 Re-add OCaml query that lead to crash before tree-sitter fix
Ref: https://github.com/tree-sitter/tree-sitter/issues/968#issuecomment-792932744
2021-03-16 18:52:43 +01:00
Stephan Seitz
080b6476fe Fix ocaml queries 2021-03-16 18:52:43 +01:00
Santos Gallegos
e4083fc8e1
Add comment parser to highlight comment tags (#893)
Closes #236
2021-03-12 11:21:46 -05:00
Pau Ruiz Safont
0df1803056 highlights(ocaml): change order or captures
This because the later captures have more priority in neovim, not less
like in upstream.

This fixes highlighting highlighting for let* and +, for example.
2021-02-28 22:32:07 +01:00
Pau Ruiz Safont
633b42b2a2 highlights(ocaml): add unit and pretty_printing_indication 2021-02-28 22:32:07 +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
Pau Ruiz Safont
f7126fe54b fix(ocaml): highlight characters as such 2020-10-04 14:33:29 +02:00
Pieter Goetschalckx
718fc1be3e Add OCaml folds 2020-09-21 08:54:30 +02:00
Pieter Goetschalckx
a8c8de13ae Improve OCaml locals 2020-09-21 08:54:30 +02:00
Pieter Goetschalckx
60e097a14a Improve OCaml highlights 2020-09-21 08:54:30 +02:00
Pau Ruiz Safont
9447909d11 ocaml: follow upstream for highlights 2020-09-19 13:35:12 +02:00
Pau Ruiz Safont
465ed37494 ocaml: follow upstream for highlights 2020-09-19 13:35:12 +02:00
Pau Ruiz Safont
b4d7ea7e66 fix ocaml highlights
Function matching was wrongly parenthesized, parameter detection was too
eager and it was wrongly matching all + and - as delimiters
2020-09-12 23:11:05 +02:00
Pau Ruiz Safont
7be8e6ca5c maintenance(ocaml): adapt queries to nvim-treesitter 2020-09-11 12:10:31 +02:00
Pau Ruiz Safont
ddc200768e feat(queries): pull ocaml queries from upstream 2020-09-11 12:10:31 +02:00
Pau Ruiz Safont
4db39e27c9 fix: ocaml highlight
The string.special group was removed from highlight.lua, replace its
uses by the string group.
2020-09-06 20:52:56 +02:00
Pieter Goetschalckx
9ef264a733 Fix filename 2020-09-05 10:02:42 +02:00
Pau Ruiz Safont
3fe5a067b3 feat(highlights): add ocaml 2020-08-24 10:16:38 +02:00