Commit graph

46 commits

Author SHA1 Message Date
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
ObserverOfTime
3065a928fc fix(java): move attributes after constants 2023-12-04 20:41:28 -05:00
Ibrahim Delice
0d5c611e3f
feat(java): highlight var as @type.builtin 2023-10-13 18:12:18 -04:00
Ibrahim Delice
b59a1fa075
fix(java): move @ to @attribute 2023-10-13 21:08:05 +00:00
Pham Huy Hoang
db7adb21e6
java(highlights): add missing import class pattern (#5483) 2023-10-06 12:22:53 +09:00
Pham Huy Hoang
4613314b1f feat(java): add highlights to string interpolation 2023-08-18 03:10:30 -04:00
homedirectory
39b9f45a64 java highlights: annotation type declaration and AT interface keyword 2023-06-21 10:46:53 +02:00
Iron-E
54741de02c
fix(java): capture type parameter brackets as @punctuation.delimiter
It is currently highlighted as `@operator`
2023-05-04 15:50:31 -04:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Amaan Qureshi
7dfaa60a85 feat(java): distinguish escape sequences, move certain keywords to more appropriate places 2023-02-23 15:41:26 -08:00
Josef Litoš
a75aded7ae highlights(java): fix '!',param,global group 2022-12-19 00:03:18 +02:00
Stephan Seitz
d6a2ecb8b7 highlights: create subscoping for ternary operator
After https://github.com/nvim-treesitter/nvim-treesitter/issues/470,
we decided to use `@conditional` for ternary operator instead of
operator despite `@conditional` is documented for keywords only.
A sub-scoping can make it easier for people to highlight this operator
group differently.

Also unify the usage of `@conditional...` across languages.
2022-12-02 21:42:11 +01:00
ObserverOfTime
d0b9afe9f6 highlights(java): use more specific groups 2022-11-26 13:17:51 +02:00
Lewis Russell
37398c7d68 feat(spell): support more languages 2022-09-26 13:47:12 +01:00
Stephan Seitz
a59e6e0ef0 highlights(java): add "non-sealed" keyword 2022-08-23 22:20:46 -07:00
anthony-S93
bc9792298c Modified queries/java/highlights.scm 2022-08-22 07:40:51 -07:00
lfenzo
c784720917 Split func/method definition from calls in several programming language queries 2022-08-03 12:05:30 -07:00
Stephan Seitz
4542402e34 highlights(java): add support for text_blocks 2022-04-16 23:23:19 +02:00
captainko
b42de97339 feat(java)(highlights): add missing highlights for @type 2022-01-18 21:59:36 +01:00
Stephan Seitz
152af07ecf highlights/injections/indents(java): comment -> line_comment,block_comment
Ref https://github.com/tree-sitter/tree-sitter-java/pull/93
2022-01-16 14:24:20 +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
antonk52
90f15d9bf7 feat(keywords) merge return and yield into keyword.return group 2021-07-04 21:49:17 +02:00
antonk52
bd9095e969 feat(keywords) add keyword.return & keyword.yield 2021-07-04 21:49:17 +02:00
Stephan Seitz
1d5f928279 highlights(java): add new keyword "yield"
https://github.com/tree-sitter/tree-sitter-java/pull/78 added support
for enhanced switch statements
2021-04-17 20:58:41 +02:00
Stephan Seitz
7e9e8f2af9 Add support for Java records
Ref: https://github.com/tree-sitter/tree-sitter-java/pull/73
2021-04-10 12:27:54 +02:00
Stephan Seitz
2331a36693
highlights(java): Highlight fields (members and member access) (#1107) 2021-03-26 13:25:28 -05:00
Stephan Seitz
eaca722783 highlights(java): Highlight spread parameters 2021-02-19 23:41:42 +01:00
Stephan Seitz
5033d3668a highlights(java): fix constant highlighting (only UPPERCASE_LETTERS) 2021-02-19 23:41:42 +01:00
Chinmay Dalal
d2b8b49ce5 Ternary 2020-11-19 12:45:10 +01:00
Stephan Seitz
7e3c4f8089 Add @keyword.operator for operators that are English words and add @exception for Java/JS 2020-09-19 07:30:49 +02:00
Stephan Seitz
bcf421b4e7 Fix #307: Use and document TSVariable/TSVariableBuiltin in all languages 2020-09-14 18:27:20 +02:00
Steven Sojka
ce43dbf54c fix(queries): use vim-match for non lua regexes 2020-08-16 18:31:56 +02:00
Chinmay Dalal
64df3e1791 [java] Add label highlight 2020-08-16 09:58:33 +02:00
Stephan Seitz
4a77ac78d0 Java highlights/locals: Add catch_formal_parameter 2020-07-27 11:08:13 +02:00
Stephan Seitz
35837b069b Java highlights: Add highlight for this 2020-07-27 11:08:13 +02:00
Stephan Seitz
61803eb523 Java highlights: Add binary integer literals 2020-07-01 13:22:46 +02:00
Stephan Seitz
2b6b1e3e61 Java highlights: Add operators ":" "?" 2020-06-30 08:32:19 +02:00
Stephan Seitz
fa7a270da1 Java highlights: Add parameter highlight for single-parameter lambdas 2020-06-30 08:32:19 +02:00
Chinmay Dalal
65b3a8e6d7 Add method reference operator 2020-06-29 19:58:39 +02:00
Chinmay Dalal
b184f1cafb
Java highlights: Capture parameters in declaration (#93)
* Capture parameters in declaration

* Refactor (new syntax)

* Fix spaces

* Fix capture (java method parameters)

* Improve java parameter capture

* Fix bracket and whitespace

* Fix java query

* Fix java query

Co-authored-by: Thomas Vigouroux <39092278+vigoux@users.noreply.github.com>

* Add capture for lambda parameters, remove redundant captures, add -> operator

* Previous commit wasn't saved properly

* Fix formatting

* Changes suggested in PR

https://github.com/nvim-treesitter/nvim-treesitter/pull/93#pullrequestreview-435630553

* Add bitwise operators

* Re-add builtin operators

* remove left shift, add ^=

* Add &= and |=

* remove @variable

* Remove duplicate

Co-authored-by: Thomas Vigouroux <39092278+vigoux@users.noreply.github.com>
2020-06-29 10:48:13 +02:00
Chinmay Dalal
3302dd3a5b
Give credits 2020-06-17 18:01:29 +05:30
Chinmay Dalal
a6c426b2bd
Fix types 2020-06-15 23:23:17 +05:30
Chinmay
d262d4101e
Add operators 2020-06-15 22:45:56 +05:30
Chinmay
042464c1c5
Fix method highlighting 2020-06-15 21:48:50 +05:30
Chinmay
d9639e1e5e
Add highlights.scm and locals.scm 2020-06-11 22:31:45 +05:30