Commit graph

56 commits

Author SHA1 Message Date
Riley Bruins
d5a1c2b0c8 feat: standardize and document export keywords
Many export keywords are captured as `@keyword.import`. This commit
makes it so they are all captured like that, and mentions it in the
documentation.
2024-05-13 09:16:31 +02:00
Riley Bruins
f58cae6c22 feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
NullVoxPopuli
01963961b5
feat(glimmer): highlight builtin tags 2024-04-26 21:42:06 -04: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
42acc3f6e7 refactor(ecma): delimiter highlight consolidation 2024-02-17 21:47:19 -05:00
Riley Bruins
504fe10432 feat(ecma): highlight label identifiers 2024-02-16 14:04:48 -05:00
Ananda Umamil
baf4581159 feat(ecma): highlight decorator and destructuring 2024-02-10 10:02:27 +01:00
Amaan Qureshi
6da205148f chore(ecma,jsx): update parser and queries 2024-01-31 22:31:50 -05:00
Phạm Huy Hoàng
77e298e4de chore: format queries 2024-01-21 23:55:02 +09:00
ObserverOfTime
fa38f4e6f9 fix(highlights): improve member/property distinction 2024-01-19 16:58:37 +01: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
Amaan Qureshi
c543ffae1c fix(ecma): prioritize builtins 2023-11-10 19:08:12 -05:00
ShellCode33
d9e75a1736 queries/*/highlights.scm : remove @spell for strings 2023-08-07 16:39:40 +01:00
Ananda Umamil
44211e7f6e
feat(typescript): highlight decorators, default case, global declaration 2023-07-17 14:19:28 -04:00
Sergio A. Vargas
90581acf87
feat(ecma): highlight regex flags 2023-07-10 14:13:17 -04:00
ObserverOfTime
ec7db4ba3f feat(pug): improve syntax highlighting 2023-07-07 16:14:01 -04:00
Amaan Qureshi
2c59e0ff3d refactor(ecma): triple dot should be an operator 2023-06-09 01:58:28 +09:00
Ananda Umamil
bee003b880
feat(ecma): convert eligible @keyword.operators 2023-06-04 00:04:40 -04:00
Ananda Umamil
a02a06a068 highlights(typescript): : in switch statement 2023-05-18 21:34:42 -04:00
ObserverOfTime
18f9e1a47f javascript: highlight more builtins
Co-Authored-By: Sergey Berezhnoy <veged@ya.ru>
2023-04-12 13:46:06 -04:00
Amaan Qureshi
964dc882e9 Partially Revert "fix(ecma): properly capture constants in const declarations"
This partially reverts commit c553e6c560.
2023-03-10 02:38:36 -05:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Amaan Qureshi
c553e6c560 fix(ecma): properly capture constants in const declarations 2023-03-04 05:00:39 -05:00
Amaan Qureshi
33ba346e60 feat!: add @keyword.coroutine capture 2023-03-03 07:07:52 -08:00
ObserverOfTime
0e6d4b4172 highlights(ecma): limit constructor highlight 2023-02-03 14:32:28 -08: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
fa4b9941e6 highlights(ecma): fix captures
Co-Authored-By: Stephan Seitz <stephan.seitz@fau.de>
2022-11-26 13:17:51 +02:00
Raymond Ha
faf78ce12a Narrow as @include query 2022-11-25 00:34:25 +01:00
Trard
cc2268e1c7 highlights(ecma): distinguish between "default" in export and switch statements 2022-11-24 21:55:50 +01:00
Trard
bbe90e9318 removed switch from keywords 2022-11-21 10:23:28 +01:00
Munif Tanjim
63d7e456ea highlights(ecma): add pair_pattern punctuation.delimiter 2022-10-17 14:37:36 -07: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
Stephan Seitz
f66a911a95 highlights(ecma): use @method.call/function.call 2022-09-11 04:16:06 -07:00
Sergio Alejandro Vargas
fb6d60c7b9 highlights(ecma): Update queries for literals
- Add queries for value properties:
    - undefined
    - NaN
    - Infinity
- Highlight regex delimiters as brackets instead of punctuation
- Format queries for literals
2022-08-22 15:51:08 -07:00
GitHub
9dd1065ebe highlights(javascript): "?." -> optional_chain 2022-08-20 10:42:19 +02:00
Stephan Seitz
1bbc761acc highlights(ecma): highlight escape_sequence 2021-12-12 02:43:08 +01:00
numToStr
801c7f0b48 ecma: highlight private properties and methods 2021-11-25 15:42:24 +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
kiyan
3b533422df fix: remove priority in ecma template substitution hl
This PR removes the priority override for the interpolation because it
overrides every ecma based template literal, setting none with a higher
priority than ecma groups which made every template string look
`un`highlighted.
2021-10-03 11:01:30 +02:00
Santos Gallegos
8b7f70d366 Ecma: increase priority of template_substitution
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1688
2021-09-17 22:08:12 +02:00
delphinus
331b47d246 Use the color of variable 2021-09-09 23:00:05 +02:00
delphinus
398ec42d30 Set property color for destructuring assignment 2021-09-09 23:00:05 +02:00
delphinus
2156a55efa Enable to highlight shebang on JS/TS 2021-08-12 08:47:22 +02:00
antonk52
55e36f4011 place template string after braces 2021-07-07 00:15:21 +02: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
antonk52
68bf36c917 highlights(ecma): use KeywordFunction as a highlight group for function 2021-05-17 19:22:00 +02:00