Commit graph

56 commits

Author SHA1 Message Date
Noah
03f650705c
Update Clojure highlights to be metadata aware (#6213) 2024-03-19 22:10:41 +01:00
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02:00
Phạm Huy Hoàng
d198a75e2c
Fixup format (#5934)
* fix(format): newline between top-level field defs

* fixup: newline between node and comment

* fixup: optimize pattern
2024-01-20 18:47:56 +09: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
Noah
e942c720ac
fix(clojure): fix field highlighting (#5319) 2023-08-27 10:25:43 +03:00
ObserverOfTime
05fe2c38a3 refactor: replace some match & vim-match usages 2023-08-23 16:57:18 +03: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
Noah
7be9ebd06a
feat(clojure): add update-keys & update-vals 2023-06-09 16:07:45 -04:00
Noah
ab3fb2a285
refactor: update Clojure queries
Instead of relying on regex for matching (which matches custom symbols),
explicitly list each of the variations in `@variable.builtin, `@conditional`,
`@function.macro`.

Add `@variable.builtin` for the builtin repl variables `*1`, `*2`, `*3`, and
`*e`, which are occasionally used in tests and comments.

Move `ex-info`, `ex-cause`, `ex-data`, and `ex-message` to `@functions.builtin`.

Add missing `clojure.core` functions to `@functions.builtin` at the bottom to
minimize diff. Includes functions from 1.12-alpha2 release as well.
2023-05-26 18:15:22 -04:00
Amaan Qureshi
85330918f0 perf: remove match where possible 2023-04-21 18:24:17 -04:00
kawas44
c07c1c5b98 feat(spell): support lisp like languages
Add spell to commonlisp, scheme, racket, clojure and fennel.
2023-03-29 17:48:30 -04:00
Amaan Qureshi
33ba346e60 feat!: add @keyword.coroutine capture 2023-03-03 07:07:52 -08:00
dundargoc
4612212c72 docs: fix typos 2023-02-23 11:39:43 -08:00
Stephan Seitz
b2e0472a55 highlights(clojure): use @function.call 2022-09-11 04:16:06 -07:00
Stephan Seitz
e7fe083fbc highlights(clojure): out-comment TODO query 2022-09-11 04:16:06 -07:00
Oliver Marshall
78c8c9a255
Change to using an explicit list of "def-likes" for clojure (#3202) 2022-07-20 10:42:30 +00: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
Dundar Göc
6a4fdb317d chore: fix typos 2021-11-02 23:47:48 +01:00
Stephan Seitz
9e147d2356 highlights(clojure): fix highlighting of #_
Fix https://github.com/sogaiu/tree-sitter-clojure/issues/14
2021-07-25 18:06:50 +02:00
Oliver Marshall
17cf76de8a Don't capture quotes as comments 2021-07-19 16:24:01 +00:00
Oliver Marshall
036e88b94a Remove last @a 2021-07-19 16:24:01 +00:00
Oliver Marshall
e0ecd61046 Remove docstring highlights 2021-07-19 16:24:01 +00:00
Oliver Marshall
2bba92dfb0 Use ignored capture groups 2021-07-19 16:24:01 +00:00
Oliver Marshall
de5641a246 Improve some comments 2021-07-19 16:24:01 +00:00
Oliver Marshall
39d0b9b61b Improve highlights for types 2021-07-19 16:24:01 +00:00
Oliver Marshall
dd75916ef9 Remove constant highlighting 2021-07-19 16:24:01 +00:00
Oliver Marshall
9d1fe26b4d Add forgotten annon function highlight 2021-07-19 16:24:01 +00:00
Oliver Marshall
89a3dffd8d Add header comment 2021-07-19 16:24:01 +00:00
Oliver Marshall
78190687be Add some todos 2021-07-19 16:24:01 +00:00
Oliver Marshall
2403f3a8de Add context based highlighting for def, defn & ns 2021-07-19 16:24:01 +00:00
Oliver Marshall
1099809d70 Revamp the symbol highlighting 2021-07-19 16:24:01 +00:00
Oliver Marshall
54e4a59fa7 Move meta punctuation 2021-07-19 16:24:01 +00:00
Oliver Marshall
e5ba6de3a3 Simplify 2021-07-19 16:24:01 +00:00
Oliver Marshall
4390cbffd5 Add some comments & TODOs 2021-07-19 16:24:01 +00:00
Oliver Marshall
336206e380 First pass at def-likes 2021-07-19 16:24:01 +00:00
Oliver Marshall
91e0fc6719 Match % variables 2021-07-19 16:24:01 +00:00
Oliver Marshall
8219dbbdbe Add more operators 2021-07-19 16:24:01 +00:00
Oliver Marshall
a9863864a8 Add some TODOs 2021-07-19 16:24:01 +00:00
Oliver Marshall
e26009b7f4 Highlight splicing operators 2021-07-19 16:24:01 +00:00
Oliver Marshall
2c67ca51a5 All the other stuff, includes:
- Changing huge 'match's to 'any-of's
- Roughly organising the queries into sections
- Add some TODOs for more improvements
- Comment out def-like and call queries as they overlap too much
- Change the captures to use better (imo) groups
- Make with-.* and when-.* always highlight like a builtin
2021-07-19 16:24:01 +00:00
Oliver Marshall
5885256549 Reorganise slightly 2021-07-19 16:24:01 +00:00
Joakker
c699cc2e47 Use #any-of? instead of #match? where posible 2021-06-25 00:22:48 +02:00
Stephan Seitz
048317174c Clojure: Add folds.scm 2021-05-17 20:45:31 +02:00
Stephan Seitz
021196fd6c Clojure/Lisp: Add char_lit to highlights 2021-05-17 20:45:31 +02:00
Stephan Seitz
007aa7ff21 Use @symbol in clojure in commonlisp 2021-05-17 20:45:31 +02:00
Stephan Seitz
64f13eace5 Extend CL highlights 2021-05-17 20:45:31 +02:00
Stephan Seitz
e197736061 Add support for Common Lisp 2021-05-17 20:45:31 +02:00