Commit graph

2229 commits

Author SHA1 Message Date
Sergey Slipchenko
051193acba
fix(jsdoc): add nospell to type and tag_name 2024-01-21 16:04:34 +02:00
Veesh Goldman
5d5eba78a7 feat(perl): add more highlights 2024-01-21 10:53:32 +01:00
Christian Clason
5cc5627487 fix(comments)!: consolidate note captures
Distinguishing `hint` and `info` is too confusing; it's enough to have
`error`, `warning`, `todo`, and `note`.
2024-01-20 17:52:50 +01:00
tk-shirasaka
64b3d5e569
feat: add the php_only parser included in tree-sitter-php (#5876)
Add parser  `php_only` for PHP files without HTML embedded.
Make queries for combined parser `php` inherit from `php_only` (no extensions needed).

---------

Co-authored-by: shirasaka <tk.shirasaka@gmail>
2024-01-20 12:34:49 +00:00
Christian Clason
a8fa3047b5 fix(highlights): use markup.raw.delimiter for fences 2024-01-20 13:04:29 +01:00
Phạm Huy Hoàng
aeed349c04 feat: folds for git config files 2024-01-20 19:46:45 +09:00
Riley Bruins
88261266de
fix(markdown_inline): prioritize link URI (#5935) 2024-01-20 19:00:37 +09:00
Amaan Qureshi
1ce6000a95 fix(rust): add const_item to folds 2024-01-20 18:50:31 +09:00
Pham Huy Hoang
c41d38b70e fix(rust): Add back 1 indent for macro rules (#5834) 2024-01-20 18:50:31 +09:00
Jędrzej Boczar
6548bb64c1 feat(meson): add indents.scm 2024-01-20 10:48:56 +01: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
Riley Bruins
f5a839d1e8 fix(markdown): remove @none from code fences 2024-01-20 10:24:57 +01:00
Riley Bruins
1eb22367b9 feat(html): comment injections 2024-01-20 12:54:01 +09:00
Zeb Nicholls
4a4dbe1cb1
fix(python): add support for typed (kw)args (PEP 484) (#5875) 2024-01-19 16:21:57 +00:00
ObserverOfTime
505a0e74cb fix(css): make the highlights more sensible 2024-01-19 16:58:37 +01:00
ObserverOfTime
fa38f4e6f9 fix(highlights): improve member/property distinction 2024-01-19 16:58:37 +01:00
ObserverOfTime
2f38c36294 fix(highlights): improve consistency 2024-01-19 16:58:37 +01:00
ObserverOfTime
4cd951d703 feat(git_config): add missing injections 2024-01-19 16:58:37 +01:00
Amaan Qureshi
8c629a9327 chore(rust): tweak injections, add json macro injection 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
Pham Huy Hoang
15de22a2e1 feat: query formatting script
Usage:
- nvim -l scripts/format-queries.lua /path/to/file.scm
- nvim -l scripts/format-queries.lua /path/to/dir

fixup: add `format-ignore` directive to query/highlights.scm
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
ObserverOfTime
17fae3f4a3 feat(injections): add printf format strings 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
Bartek Łuka
295ab1da52 fix: link type in pattern matching correctly 2024-01-15 13:01:37 +01:00
Calum Smith
49f1b9a7ef highlights(html): character references (a.k.a. entities) 2024-01-05 16:58:46 +01:00
Zhuofeng Wang
e277ca9dec fix(markdown_inline): latex highlight injection (#5397)
The `injection.include-children` is needed in markdown_inline parser.
2024-01-05 10:58:35 +01:00
Riley Bruins
8ae4080c5b fix(latex): highlight text functions 2024-01-04 20:07:31 +01:00
Christian Degnbol Madsen
65ef62092e fix(julia): add missing capture of ":" in selected import
If writing a selected import, e.g. `using BSON: @load`, the colon isn't currently captured.
This change captures it as `@punctuation.delimiter`.
2024-01-02 11:43:08 +01:00
Riley Bruins
374966b25c
fixup(luau): align @string.regex to the injections (#5829) 2023-12-24 14:00:32 +09:00
Riley Bruins
cd4de5f7b1 fix: cleanup luap injection queries 2023-12-23 22:26:02 +01:00
Riley Bruins
92572c0dfd feat: more @string.regex highlights 2023-12-23 22:26:02 +01:00
Riley Bruins
1c619f5f20
feat(luap): highlights more consistent with regex (#5819) 2023-12-23 11:40:10 +02:00
Christian Degnbol Madsen
454c3a9ba8
fix(julia): pipe function highlight (#5815)
In Julia when piping into a function the function should be highlighted as a function call, and not a variable.
2023-12-22 12:24:04 +02:00
Jędrzej Boczar
d496c5e08e
fix(cpp): incorrect indent of class with opening { on new line (#5811) 2023-12-22 05:49:13 +09:00
Christian Clason
d2d3df8613
vimdoc: add note, warning, deprecated (#5817) 2023-12-21 22:29:31 +09:00
Ahnaf Rafi
c153019e11 Add @nospell annotation to label definitions and references 2023-12-21 10:55:50 +01:00
Marc Jakobi
732c8cb0b4 highlights(haskell): add fail to exception highlights 2023-12-20 13:08:06 +01:00
Marc Jakobi
96e01877b8 highlights(haskell): namespaced string quasiquote 2023-12-20 13:07:44 +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
Riley Bruins
24be1534db fix(rust): highlight inline attributes properly 2023-12-18 11:47:01 -05:00
aMOPel
edacfa2eed
fix(nim): minor improvements to queries and parser (#5784)
* fix(nim): bump parser again to include minor fix

* fix(nim): shifting around for precedence

* fix(nim): added new fields from recent parser version,
improved support for (conditional_declaration) and (variant_declaration)
2023-12-19 01:32:06 +09:00
Vincent Rischmann
000f71842b
feat(gomod): highlight the toolchain directive (#5795) 2023-12-15 21:01:31 +02:00
Christian Clason
9bc1f1e640 fix(v): adapt to removed scanner.c 2023-12-15 10:24:32 +01:00
ObserverOfTime
ab818bf5a2 fix(python): restrict typed parameter highlight
Only the name is a parameter and not the value
2023-12-14 13:05:40 -05:00
ObserverOfTime
2583eb351b fix(python): highlight variadic lambda parameters 2023-12-14 13:05:40 -05:00
r001
b6b9ca448b
indents added new language highlights added (#5777) 2023-12-10 16:16:24 +09:00
ObserverOfTime
7958ff9ec7 feat(poe_filter): add new Import statement 2023-12-09 17:18:16 +02:00
ObserverOfTime
1b5bbb54b3 fix(vim): highlight 'scriptencoding' command 2023-12-09 11:12:07 +01:00