Commit graph

30 commits

Author SHA1 Message Date
Turiiya
cf7baac35a
fix(v): anchor comment highlight query
* fix(v): use `source_file` as parent node for comment highlight query

* fix: correctly recognize doc comment
2024-06-28 12:33:06 +09:00
Turiiya
53b32a6aa3 feat(v): add shebang query 2024-06-26 10:54:01 +02:00
Riley Bruins
f58cae6c22 feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
nvim-treesitter-bot[bot]
5127a84407 bot(lockfile): update beancount, liquid, ocaml, ocaml_interface, v, vento, wing 2024-03-30 11:16:35 +00:00
Phạm Huy Hoàng
722617e672 refactor(format): drop extra indentation for field 2024-03-21 15:51:26 +01:00
Jaehwang Jung
dccf31f9b1 feat(highlights)!: @keyword.storage@keyword.modifier 2024-03-16 20:51:16 +08: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
Phạm Huy Hoàng
77e298e4de chore: format queries 2024-01-21 23:55:02 +09:00
Phạm Huy Hoàng
d198a75e2c
Fixup format (#5934)
* fix(format): newline between top-level field defs

* fixup: newline between node and comment

* fixup: optimize pattern
2024-01-20 18:47:56 +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
Christian Clason
9bc1f1e640 fix(v): adapt to removed scanner.c 2023-12-15 10:24:32 +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
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
46b1ad3de2 refactor(v)!: update upstream repository 2023-07-04 11:08:07 +02:00
Amaan Qureshi
85330918f0 perf: remove match where possible 2023-04-21 18:24:17 -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
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Yochem van Rosmalen
190561df89 v(injections): inject regex for some methods in re module 2023-03-03 15:14:58 -05:00
dundargoc
4612212c72 docs: fix typos 2023-02-23 11:39:43 -08:00
lfenzo
c784720917 Split func/method definition from calls in several programming language queries 2022-08-03 12:05:30 -07:00
Stephan Seitz
4da1d0702a highlights(vlang): add attribute_declaration and specialize some keywords 2022-05-21 13:48:58 +02:00
tami5
ad77a80813 feat: highlight string_interpolation identifiers
functions call work without issues
2022-05-21 13:48:58 +02:00
tami5
d039b4d0a4 chore: add more builtin variables 2022-05-21 13:48:58 +02:00
tami5
b34aadbcb3 chore: add $else keyword 2022-05-21 13:48:58 +02:00
tami5
08092ecc06 chore(vlang): rename set! > #set! 2022-05-21 13:48:58 +02:00
Stephan Seitz
c19d14f395 parser(vlang): fix location of remote repo 2022-05-21 13:48:58 +02:00
tami5
010f364295 feat(vlang): initial support
Add support for vlang filetypes.

- [ ] Highlight `C` as builtin variable. This is FFI in vlang land,
  where C act like extern and access c functions. The vlang parser does
  some extension between C function calls and arguments but I believe
  highlighting C as builtin variable is sufficient indicator for now. I
  tried to use offset! but failed. Any suggestions?
- [ ] Set up parser url. the vlang parser is located within [vls] repo. Is
  installing from nested repo supported? `tree_sitter_v/src/parser.c`?

[vls]: https://github.com/vlang/vls/tree/master/tree_sitter_v

cc @elianiva @theHamsta
2022-05-21 13:48:58 +02:00