Commit graph

89 commits

Author SHA1 Message Date
nvim-treesitter-bot[bot]
69170c9314 bot(lockfile): update apex, editorconfig, elixir, ledger, markdown, markdown_inline, sflog, soql, sosl, styled, swift, xresources 2024-12-02 07:45:02 +00:00
Omar Valdez
188b1a6d01
feat(highlights): capture wildcard patterns as @character.special (#7153) 2024-09-20 08:15:01 +02:00
Omar Valdez
d13f0183ba
feat(highlights): capture wildcard imports as @character.special 2024-08-01 10:24:40 +02:00
Brayden Zee
b1f3f02027
fix(java): compact constructor highlights (#6531) 2024-05-02 14:27:26 -07:00
Riley Bruins
9a47a523e3 feat: import statement folds for common languages 2024-05-01 10:00:01 +02:00
Riley Bruins
f58cae6c22 feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
Guilherme Soares
c16f66cca0
feat(java): add when operator (#6420) 2024-04-09 12:25:02 -07: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
Ilia Ilinykh
1cda98132a
feat(java): inject printf in String.formatted (#6045)
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html#formatted(java.lang.Object...)
2024-02-02 20:00:03 +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
ObserverOfTime
17fae3f4a3 feat(injections): add printf format strings 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
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
Amaan Qureshi
a4f4fcdd3e feat: add Doxygen 2023-08-26 04:58:36 -04:00
Pham Huy Hoang
4613314b1f feat(java): add highlights to string interpolation 2023-08-18 03:10:30 -04: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
homedirectory
39b9f45a64 java highlights: annotation type declaration and AT interface keyword 2023-06-21 10:46:53 +02:00
Pham Huy Hoang
1281601cb4
feat: add indents for annotation defs (#4828)
- Add indent for `@interface` and `@Annotation(...)`
- Add notes for indent queries
2023-06-04 13:28:41 +09:00
Gregg Jansen van Vüren
39cf5cbcfd
feat(java): add more foldable nodes 2023-05-11 15:27:43 -04: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
Pham Huy Hoang
2083a34dc6
feat(java): add basic folding (#4701) 2023-04-24 15:32:41 +09: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
Daniel Woznicki
7947a2ccf1
fix: Java indent for multiple line arguments (#4449)
* fix Java indent for multiple line arguments, fixes #4448, add an additional test for methods with arguments on multiple lines

* Satisfy StyLua check

---------

Co-authored-by: Daniel Woznicki <danwoz@nettoolkit.com>
2023-03-06 18:10:31 -05:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Amaan Qureshi
f8595b13bf feat(java): some instances of definition.var should be definition.parameter 2023-02-23 15:41:26 -08: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
Daniel Woznicki
e1f8a8a6f8 Fixed incorrect Java indentation for method chaining 2022-04-04 06:58:26 +02:00
Daniel Woznicki
3d6f2637a2 Made block comment indent @auto so that new lines line up nicely with existing comment block
Previous indentation:
    /**
    *
    */

    New indentation:
    /**
     *
     */
2022-03-01 21:12:14 +01:00
Daniel Woznicki
d71da4f63e Added catchall (ERROR) @auto rule for Java to at least attempt something reasonable when the tree is in a broken state 2022-03-01 21:12:14 +01:00
Daniel Woznicki
e23f5d48be Modified Java indent rules to stop ignoring block comments because javadoc blocks were defaulting to indent 0 2022-03-01 21:12:14 +01:00
Daniel Woznicki
bf2493f5e1 Added fix for Java interfaces not being indented properly 2022-03-01 21:12:14 +01:00
Daniel Woznicki
18c558fd92 Fixed a bug where indentation was not correct for class/enum bodies that had an annotation 2022-02-25 08:03:43 +01:00
Daniel Woznicki
1b47af43ce Fixed a bug where Java enum body indentation was not correct
Added test for Java enum indentation
2022-02-25 08:03:43 +01:00
Daniel Woznicki
b425a9c813 Added fix for incorrect Java indentation after a closing "}" in a method declaration
Added tests for Java indentation, including one for issue 2571
2022-02-25 00:58:59 +01:00
captainko
b42de97339 feat(java)(highlights): add missing highlights for @type 2022-01-18 21:59:36 +01:00