Commit graph

52 commits

Author SHA1 Message Date
Riley Bruins
73b68cb943 feat(query): highlights for dot-prefixed predicates 2025-02-02 17:53:25 +01:00
Riley Bruins
ca0e04ac31 feat(query): highlights for missing nodes 2025-02-02 17:48:21 +01:00
Omar Valdez
188b1a6d01
feat(highlights): capture wildcard patterns as @character.special (#7153) 2024-09-20 08:15:01 +02:00
Riley Bruins
749df30887 feat(query): highlight supertype "/" delimiters 2024-08-31 18:42:53 -04:00
Riley Bruins
09bad640e4 fix(query): proper indentation after quantifiers 2024-08-02 22:45:14 +09:00
Riley Bruins
7cec6219c4 fix(query): properly apply predicate injections
I think these have been broken since the query parser update. Basically
the inner node for the string content was preventing injections because
include-children was not set.
2024-07-27 17:17:26 +02:00
Omar Valdez
886b496763 feat(query): Highlight key in set! directive 2024-07-27 13:29:09 +02:00
Amaan Qureshi
488e39a8f1 feat(query): adapt to upstream changes 2024-05-26 00:24:03 +02:00
Riley Bruins
707b0dcf76 feat(query): pattern injections for new predicates 2024-05-09 11:11:40 +02:00
Kai Moschcau
ead283734b feat(latex, query, tablegen, thrift): disable spelling in shebangs 2024-05-01 15:01:48 +02:00
Phạm Huy Hoàng
722617e672 refactor(format): drop extra indentation for field 2024-03-21 15:51:26 +01:00
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02:00
Riley Bruins
455f6586ba
feat(query): indents that reflect the formatter (#6154)
* feat(query): indents that reflect the formatter

Indentation queries that reflect the query formatter. Only applicable if `lispoptions=expr:1`
2024-02-21 18:47:09 +09:00
Pham Huy Hoang
57a8acf0c4 chore: query formatting 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
15de22a2e1 feat: query formatting script
Usage:
- nvim -l scripts/format-queries.lua /path/to/file.scm
- nvim -l scripts/format-queries.lua /path/to/dir

fixup: add `format-ignore` directive to query/highlights.scm
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
Riley Bruins
92572c0dfd feat: more @string.regex highlights 2023-12-23 22:26:02 +01:00
Azad
198015cca1
fix(query): stricter match for extends directive (#5604) 2023-11-02 19:02:41 +09:00
Jaehwang Jung
812c2dd8fe feat(query): use @function.call for predicate 2023-10-03 17:54:10 +02:00
ObserverOfTime
05fe2c38a3 refactor: replace some match & vim-match usages 2023-08-23 16:57:18 +03:00
Pham Huy Hoang
39f07cd375 injections(query): add gsub pattern (#4897) 2023-08-12 17:34:15 +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
741260618d highlights(query): prefer lua-match 2023-05-21 19:22:05 +02:00
Emilia Simmons
58da7fe93e allow no spaces for extend/inherit comments 2023-05-18 20:01:00 -04:00
Emilia Simmons
0058058386 add multiple ; for highlighting 2023-05-18 20:01:00 -04:00
Emilia Simmons
865483f8d1 fix(query): allow multiline modeline (inherits/extends) 2023-05-18 20:01:00 -04:00
Pham Huy Hoang
ca8a981db3
fix(query): add missing dedent for "]" (#4739) 2023-05-01 03:04:27 +00: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
4beba61dde feat(query): differentiate lua-match strings by using luap injections and fix offset matches 2023-03-04 11:32:25 -05:00
ObserverOfTime
9b43ab819c highlights: use @preproc where appropriate 2022-10-15 08:49:01 -07:00
Lewis Russell
37398c7d68 feat(spell): support more languages 2022-09-26 13:47:12 +01:00
Santos Gallegos
b99f46c735 Query: update highlights
ref https://github.com/nvim-treesitter/tree-sitter-query/pull/17
2021-12-24 03:46:53 +01:00
Santos Gallegos
8d6c804f3f
Query: update locals (#1692) 2021-08-14 00:26:31 -05:00
Santos Gallegos
ef85abba7f Query: highlight numbers 2021-08-14 01:32:11 +02:00
Santos Gallegos
2a0097828d
Query: update highlight queries (#1553)
This is to match https://github.com/nvim-treesitter/tree-sitter-query/pull/15
2021-07-13 14:09:12 +00:00
Gregory Anders
dbbedfec88
query: Only highlight predicate name (#1461)
Only highlight the name of the predicate using TSFunction rather than
the entire predicate block.
2021-07-01 20:43:09 +00: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
Santos Gallegos
2a946ddc7e
Query: update highlights (#1175) 2021-04-10 15:18:44 -05:00
Stephan Seitz
cb14ffa103 highlights(query): Add modeline query after bugfix 2021-03-16 18:52:43 +01:00
Stephan Seitz
a2f524887c Remove some broken 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
Brian Shu
d162a83d82 removed duplicate 2021-03-01 23:35:25 +01:00
Brian Shu
8b4d267677 changed toml and query 2021-03-01 23:35:25 +01:00
Santos Gallegos
2ad1f76b7d Query: highlight modeline
Matches the first comment and the beginning from the pattern
52397aaa0d/runtime/lua/vim/treesitter/query.lua (L25)
2021-02-12 08:02:00 +01:00
Santos Gallegos
7d7566f4e4 Query: add folds 2021-02-11 07:07:16 +01:00
Santos Gallegos
51d70c9f0c Query: add regex injections 2021-02-07 15:30:15 +01:00
Santos Gallegos
3dbbc2dc7d Query: add string.escape
Needs https://github.com/nvim-treesitter/tree-sitter-query/pull/5
2021-01-04 09:29:10 -05:00
Santos Gallegos
fa5aa080dc Query: update highlights
More color!
2020-09-04 21:21:48 +02:00