Commit graph

75 commits

Author SHA1 Message Date
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
Pham Huy Hoang
107e61afb7 refactor: Remove all (ERROR) @error captures
As discussed in PR#5421, capturing `@error` is inconsistent, requiring
deep nesting (or priority) in order to correctly have red backgrounds to
it.

Some queries has this capture, some don't. For consistency purposes,
removing all of them is more preferable.

For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)`
to your custom queries.
2023-10-25 18:18:50 +02:00
Carlos Afonso
981b13b886 refactor: improve readability 2023-10-15 14:34:32 -04:00
Carlos Afonso
bf87a16712 fix(php): fix indentation for in between braces 2023-10-15 14:34:32 -04:00
nsfisis
ad02fbcdfc
fix(php): highlight never as @type.builtin (#5522) 2023-10-14 21:04:06 +09:00
Christian Clason
800b2f388b fixup: php injections 2023-08-12 17:45:44 +02:00
ObserverOfTime
d8e625df2d fix(php): heredocs injections & highlights 2023-08-12 17:34:15 +02:00
CalebW
246f4cc20c Add PHP heredoc and nowdoc injections (#4866) 2023-08-12 17:34:15 +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
ShellCode33
d9e75a1736 queries/*/highlights.scm : remove @spell for strings 2023-08-07 16:39:40 +01:00
Christian Clason
e58bbe83f9 lint(locals): use #set! to keep query linter happy 2023-06-22 08:39:17 +02:00
Pham Huy Hoang
f7e8b7420c fix(php_inject): add missing @combined to text 2023-04-14 13:23:37 -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
Ananda Umamil
4e26fec074 highlights(php): use lua-match?
Co-authored-by: Stephan Seitz <stephan.seitz@fau.de>
2023-02-12 01:23:19 -08:00
Ananda Umamil
0c6835ce5e highlights(php): remove typedef capture from as 2023-02-12 01:23:19 -08:00
Ananda Umamil
620b947218 highlights(php): fix @constant queries 2023-02-12 01:23:19 -08:00
Ananda Umamil
f83f05798a highlights(php): fix queries related to namespaces 2023-02-12 01:23:19 -08:00
Ananda Umamil
cf21f81274 highlights(php): instanceof operand 2023-01-28 11:32:57 +01:00
Ananda Umamil
a422d8508d Use @parameter capture 2023-01-28 01:45:54 +01:00
Ananda Umamil
2ed316ccf4 Apply the suggestion from @Lucario387
Co-authored-by: Lucario387 <hoangtun0810@gmail.com>
2023-01-28 01:45:54 +01:00
Ananda Umamil
fc596733ff highlights(php): declare directives and : 2023-01-28 01:45:54 +01:00
gbprod
fbc2ce9d65
feat(php): improve indents for match and switch (#3953) 2022-12-09 22:07:05 +01:00
gbprod
56cabb6435 fix(php): add missing php fold query 2022-12-06 10:58:45 +01:00
ObserverOfTime
0f866c15b4 highlights(php): use more specific groups 2022-11-26 13:17:51 +02:00
Nikita Sklyarov
795508b773 improve php variables and $this highlights 2022-11-25 18:22:25 +01:00
gbprod
287ffdccc1
Add regex injections for php (#3592) 2022-10-28 12:22:16 +00:00
gbprod
82767f3f33 feat(php): add queries for bash injections
This commit allows to inject bash syntax into relevant function arguments
and shell expression.
2022-10-12 22:38:03 +02:00
gbprod
3cb46f0c81 feat(php): improve php folds 2022-10-12 22:36:57 +02:00
gbprod
3096e637c8 fix(php): add indent for enums 2022-10-10 23:01:22 +02:00
gbprod
84e23bd979 Fix php indent for short array declaration 2022-10-06 08:55:11 -04:00
Laytan Laats
4303c1af69 highlights(php): add spell 2022-09-26 23:23:21 +01:00
lfenzo
c784720917 Split func/method definition from calls in several programming language queries 2022-08-03 12:05:30 -07:00
Matty Patatty
36ee4890c4
highlights(php): highlight more string types and escapes (#3226) 2022-07-27 07:48:01 +00:00
shirasaka
e4df4228b7 highlights(php): highlight readonly keyword 2022-06-04 17:53:59 +02:00
przepompownia
1cec3899f5 indents(php): @auto on comment and ERROR
Currently with
```vim
setlocal autoindent
setlocal smartindent
```
in `after/indent/php.vim` it allows correct indentation
inside PHP docblocks.
2022-05-15 14:52:43 +02:00
nsfisis
4d53ee5c05 highlights(php): improve highlight for attributes 2022-05-13 18:46:32 +02:00
Wilman Barrios
fd92e70c69 highlights(php): argument name as parameter 2022-03-17 21:09:15 +01:00
Wilman Barrios
689a078f91 highlights(php): add namespace aliasing name as type 2022-02-26 16:05:22 +01:00
Wilman Barrios
6d44cc06f4 highlights(php): highlight use declaration name as type 2022-02-19 20:00:31 +01:00
Wilman Barrios
c0783485e8 highlights(php): highlight traits names as type 2022-02-19 18:26:05 +01:00
Stephan Seitz
3fbf280e34 indents(php): don't use aligned_indent for php
Fixes #2497
2022-02-13 12:19:54 +01:00
Stephan Seitz
992926ab99 indents(php): add another test 2022-02-05 18:54:55 +01:00
Stephan Seitz
ae4c982f94 indents(php): align with C indentation
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2357
2022-01-24 22:33:41 +01:00
Michael Härtl
d7c4ae886d parsers: add phpdoc parser (experimental) 2022-01-20 15:37:44 +01:00
Michael Härtl
983c46d55c fix(php) match magic and single letter constants 2022-01-19 19:17:01 +01:00
Michael Härtl
723d91e821 highlights(php): detect constructor calls on instantiation 2022-01-17 21:38:40 +01:00
Infectos
1da55c27cc fix(php): change query for @constructor group 2022-01-16 12:02:24 +01:00
Michael Härtl
749f72d351 highlights(php): fix and add missing highlights 2022-01-15 12:32:03 +01:00