Commit graph

19 commits

Author SHA1 Message Date
Andreas Hartmann
a83032cee1 feat(make): fold define statements. 2025-02-27 09:53:09 +01:00
Riley Bruins
54becf661a feat(make): highlight more special characters 2024-08-26 09:38:30 +02:00
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
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
Phạm Huy Hoàng
5f950cdcb8 fix(format): handle list with 300 nodes 2024-01-30 22:59:27 +07:00
Riley Bruins
e0edcbb1d2 fix(make): highlight order-only prerequisite pipe 2024-01-26 19:07:19 -05: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
Riley Bruins
8f16c39f5b feat(make): highlight phony prerequisites as functions 2023-11-29 12:31:42 +02:00
Riley Bruins
fb101ed49d feat(make): give targets the function highlight 2023-11-29 12:31:42 +02: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
Tyler Miller
5ac8cf8ee5 fix(make/highlights): add define and operators 2023-06-03 23:54:28 +03:00
ObserverOfTime
e3f376ed67 highlights(make): fix captures 2022-11-26 13:17:51 +02:00
Lewis Russell
37398c7d68 feat(spell): support more languages 2022-09-26 13:47:12 +01:00
Lewis Russell
2eaf188269 fix(fold): don't include whitespace end regions
Some languages that are difficult to parse via Treesitter may
incorrectly include whitespace lines at the end of regions. This can
makes the calculated folds sub-optimal.

To recitfy, use a custom directive (trim), to calculate the range with
the trailing whitespace lines removed. Note this only works if the
region end column is 0.

Also added folds for Make.
2022-09-12 11:49:51 +01:00
Chinmay Dalal
84a7219d16 make: add substitution_reference @operator 2022-09-03 05:55:14 -07:00
Lewis Russell
c090007a88 highlights(make): add all special targets 2022-01-07 22:28:16 +01:00
Lewis Russell
567c644e53 feat(lang): add make 2021-12-14 14:59:38 +01:00