Commit graph

104 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
Ananda Umamil
db03443582
fix(ecma): template string injections (#6590) 2024-05-07 10:14:15 -07:00
Jakub Donovan
cbf9090a4c
feat(ecma) fold array (#6564) 2024-05-03 15:01:37 +02:00
DimensionalDot
9d5cee38b3
feat(ecma): inject async template functions 2024-05-02 01:10:43 -04: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
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
Mark Skelton
35c1a32b26
* feat(ecma): styled injection for css and keyframes 2024-03-13 23:02:55 +09:00
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02:00
Riley Bruins
7eeb26e69c feat(ecma): folding for function arguments 2024-02-20 07:47:26 -05: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
Dennis van den Berg
2fb2100fed
feat(angular)!: switch to parser supporting v17 (#5779) 2024-01-27 12:17:25 +01: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
Christian Clason
5b90ea2aba feat(locals)!: switch to upstream captures 2024-01-19 16:58:37 +01:00
Mark Skelton
a0b815497b
feat: add tree-sitter-styled (#5735)
* Add styled parser

* Add queries

* Update highlights

* Remove unnecessary highlights

* Update injections to use the styled grammar

* Remove requires npm
2023-12-19 21:53:00 +09:00
Amaan Qureshi
c543ffae1c fix(ecma): prioritize builtins 2023-11-10 19:08:12 -05:00
Tobias S
8e9cc89955
fix(ecma_injections): limit function names to alphanumeric characters only 2023-08-31 22:41:07 +09:00
Pham Huy Hoang
294f753ed3
fix(ecma): fix no injections for innerHTML (#5258) 2023-08-16 16:58:25 +09: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
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
Amaan Qureshi
85330918f0 perf: remove match where possible 2023-04-21 18:24:17 -04:00
Amaan Qureshi
7ade4d2e77
fix(ecma): comment should be @indent.auto (#4669) 2023-04-18 08:04:04 +09:00
Amaan Qureshi
da7f886ab5 perf(ecma): remove GraphQL comment injection, use lua-match for gql template detection 2023-04-15 20:13:44 -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
0a20d1bb63 feat(ecma): use lua-match for jsdoc injections 2023-04-03 11:13:04 -04: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
Benny Powers
38f878a1cd fix: svg injection in ecma tagged literals 2023-03-19 08:20:16 -04:00
Benny Powers
f15db0b652 style: alternation in template literal query 2023-03-19 08:20:16 -04:00
Benny Powers
1ba94e9f01 fix(ecma): template literal injections
see e3ebc8ec5d (commitcomment-104824257) for explanation

This also assigns the HTML parser for SVG tagged literals, since svg uses the HTML parser
2023-03-19 08:20:16 -04:00
Peter Lamby
e3ebc8ec5d
fix(ecma): inject properly based on "call_expression"
Also add a comment what the query does.
2023-03-12 16:27:40 +00: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
Benny Powers
8d2f9903f1 feat(ecma): include outerHTML and innerHTML 2023-02-25 11:17:13 -05:00
Benny Powers
248a87ef65 feat(ecma): add innerHTML injection 2023-02-25 11:17:13 -05:00
ObserverOfTime
0e6d4b4172 highlights(ecma): limit constructor highlight 2023-02-03 14:32:28 -08:00