Commit graph

30 commits

Author SHA1 Message Date
Riley Bruins
f58cae6c22 feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
Jaehwang Jung
998b230a77 feat(highlights)!: keyword @type.qualifier@keyword.modifier 2024-03-16 20:51:16 +08: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
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
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
Alvaro Muñoz
d335c39bff update tests 2023-01-31 12:23:13 +01:00
Alvaro Muñoz
1c41d6f825 fix(ql): Add moduleMember to indent file 2023-01-31 12:23:13 +01:00
ObserverOfTime
a1f21606d9 highlights(ql): use more specific groups 2022-11-26 13:17:51 +02:00
Alvaro Muñoz
57638f8249 feat(ql): add folding queries 2022-11-05 11:18:52 +01:00
Stephan Seitz
0c807bf1fd highlights(ql): follow upstream refactor of qualModuleExpr
13155b740d
2022-08-15 14:53:57 -07: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
Alvaro Muñoz
eefa5662e6 replace @class with @type 2021-04-23 21:18:55 +02:00
Alvaro Muñoz
3472947027 Add Codeql indents.scm 2021-04-23 21:18:55 +02:00
Stephan Seitz
6cd211f647 Mark several invalid 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
Alvaro Muñoz
16fcbd1824 More improvements 2020-11-12 08:11:06 +01:00
Alvaro Muñoz
6716ba9479 QL: support modules 2020-11-12 08:11:06 +01:00
Alvaro Muñoz
b4ec3ae3f5 improce type highlighting 2020-11-11 16:39:22 +01:00
Alvaro Muñoz
6900e5f704 minor improvments for QL 2020-11-07 01:11:37 +01:00
Alvaro Muñoz
5debe93133 make query-checker happy 2020-10-01 06:26:59 +02:00
Alvaro Muñoz
9e09ce6c8e change module to namespace 2020-10-01 06:26:59 +02:00
Alvaro Muñoz
a5dccb0ac7 CodeQL locals.scm queries 2020-10-01 06:26:59 +02:00
Alvaro Muñoz
61ea08f8d3 fine tune keyword highlights 2020-09-30 17:06:58 +02:00
Alvaro Muñoz
c29865a7b3 remove locals.scm 2020-09-30 17:06:58 +02:00
Alvaro Muñoz
90c53d3d1e remove non-used captures 2020-09-30 17:06:58 +02:00
Alvaro Muñoz
3dc2e9331e initial support for CodeQL 2020-09-30 17:06:58 +02:00