Commit graph

54 commits

Author SHA1 Message Date
Kai Moschcau
60c2b084c2 feat(awk,cmake,python,r,starlark): deactivate spelling in shebangs 2024-05-01 15:01:48 +02:00
Jaehwang Jung
dccf31f9b1 feat(highlights)!: @keyword.storage@keyword.modifier 2024-03-16 20:51:16 +08:00
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02:00
Phạm Huy Hoàng
77e298e4de chore: format queries 2024-01-21 23:55:02 +09:00
ObserverOfTime
2f38c36294 fix(highlights): improve consistency 2024-01-19 16:58:37 +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
Beartama
4c3912dfa8
indents(cmake): dedent brackets, else, endwhile
* feat(cmake): dedent for all closing brackets

* feat(cmake): indent an argument according to its previous peer

* fix(cmake); fix typo, add dedent `endwhile`
2023-06-29 20:26:23 +09:00
Uy Ha
e7f2b1276b fix(cmake): end indentation after normal_command node 2023-06-28 18:35:25 +02:00
Uy Ha
e68ad094cd feat(cmake): update cmake parser, adapt highlight.scm, and add indents.scm 2023-06-28 18:35:25 +02:00
Amaan Qureshi
85330918f0 perf: remove match where possible 2023-04-21 18:24:17 -04:00
Matthias Vogelgesang
350e7e5e31 highlights(cmake): match digits and @ in unquoted arguments 2023-03-11 13:36:12 -05:00
Uy Ha
e2a9fc8e5c use lua-match where possible 2023-02-27 20:23:53 -05:00
Uy Ha
04b87c7b6e move the catch uppercase query to the top to make it overridable, add back the more useful queries 2023-02-27 14:52:26 -08:00
Uy Ha
28475d5676 add highlighting for elseif 2023-02-27 14:52:26 -08:00
Uy Ha
a5a6590f15 only match unquoted arguments 2023-02-27 14:52:26 -08:00
Uy Ha
cf718048ca simplify cmake highlight queries 2023-02-27 14:52:26 -08:00
Uy Ha
69388e84c3 add queries project and cmake_minimum_required 2022-12-13 21:17:48 +01:00
Uy Ha
3ac093e702 remove redundant parentheses 2022-12-13 21:17:48 +01:00
Uy Ha
320804c4f1 bind ENV and CACHE as @storageclass 2022-12-13 21:17:48 +01:00
Uy Ha
9508e2188f add OUTPUT_VARIABLE query for list TRANSFORM 2022-12-13 21:17:48 +01:00
Uy Ha
322d723c89 rearrange queries, include all builtin commands in one query 2022-12-13 21:17:48 +01:00
Uy Ha
380287745e add highlight for list command 2022-12-13 21:17:48 +01:00
Uy Ha
15ee2cb240 add highlight for unset command 2022-12-13 21:17:48 +01:00
Uy Ha
d1f8e102e5 add queries for block, return, break, continue, and include 2022-12-13 21:17:48 +01:00
Uy Ha
134d5bee6e feat(cmake): add block_def to fold 2022-12-13 21:17:48 +01: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
ShootingStarDragons
bf8e987519 feat(cmake): add escape to highlight
add escape word like "\n", "\;" to highlight

Log: escape sequence highlight for cmake
2022-08-27 01:36:15 -07:00
Uy Ha
c999f9aa13 Rename captures 2022-02-05 00:28:48 +01:00
Uy Ha
2dcfefa9da Improve set queries 2022-02-05 00:28:48 +01:00
Uy Ha
d6c7996412 [cmake] add highlights for add_custom_target and add_custom_command 2021-09-10 21:11:38 +02:00
Uy Ha
25956f4274
[cmake] Add highlighting for boolean values (#1801)
Co-authored-by: Stephan Seitz <stephan.seitz@fau.de>
2021-09-10 11:42:23 -05:00
Uy Ha
e31bba5d97 [cmake] add highlights for if command constant 2021-09-10 17:01:54 +02:00
Uy Ha
16f4833b57 [cmake]: Add highlighting for set command 2021-09-09 22:57:22 +02:00
Uy Ha
a267604b8f Highlight function and macro declarations 2021-09-08 23:02:00 +02:00
Uy Ha
895706d081 Bind variable as @variable instead of variable_ref 2021-09-08 02:16:49 +02:00
Uy Ha
6fdbc7055d Bind function and macro commands as @keyword.function 2021-09-08 02:16:49 +02:00
Uy Ha
39526996ba Bind variable_ref as @variable instead of @none 2021-09-08 02:16:49 +02:00
Uy Ha
2815b6a033 [cmake] Add support for generator expression 2021-07-06 20:13:28 +02:00
Uy Ha
fbbfa3bda0 Move macro to @function.macro capture 2021-07-02 08:37:02 +02:00
Uy Ha
a8a7200241 Change captures:
- Disable highlight for `variable_ref`
- Capture `ENV` and `CACHE` as `@symbol`
- Capture '$', '{', '}', '(', ')' as punctuation
2021-07-02 08:37:02 +02:00
Uy Ha
c214c7c563 Remove query for specific keywords for now 2021-07-02 08:37:02 +02:00
Uy Ha
e121e52b2d Add comment parsing and highlight whole bracket argument 2021-07-02 08:37:02 +02:00
Uy Ha
6a2ce27949 Fix wrong name:
- `fold.scm` -> `folds.scm`
2021-07-02 08:37:02 +02:00
Uy Ha
b090c94a7a Capture variable_ref instead of variable for @variable 2021-07-02 08:37:02 +02:00
Uy Ha
d1a5d827ae Change @parameter capture to @string 2021-07-02 08:37:02 +02:00
Uy Ha
0a2828a04c Move keywords to their appropriate capture:
- Unary and binary operator to `@keyword.operator`
- Boolean constants to `@boolean`
2021-07-02 08:37:02 +02:00
Uy Ha
4ab1647f20 Highlight only command name instead of the whole call 2021-07-02 08:37:02 +02:00