Commit graph

13 commits

Author SHA1 Message Date
Alejandro
dd0c118596
feat(http): update queries to parser changes (#6467) 2024-04-19 09:24:29 +02:00
NTBBloodbath
c4e0f290d7 feat(http): switch to new parser version
fix(http): use `@variable.member` for fields

fix(http): keep the comment injection

fix(http): keep `method` capture as `@function.method`

docs(README.md): update HTTP parser maintainers list

feat(http): remove redundant captures

cleanup(http): remove unneedeed highlighting captures
2024-03-18 00:46:59 +02: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
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
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
ObserverOfTime
5b3dd8cff1 feat: add xml & dtd parsers 2023-08-13 10:34:57 +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
Amaan Qureshi
c44a63ffdc feat(http): update parser queries from upstream 2023-04-20 05:50:08 -04:00
Stephan Seitz
8fe8415ae8 injections(http): add comment injection 2021-11-12 21:52:50 +01:00
gegoune
bb0ef18488 refactor: inherit json 2021-11-12 21:52:50 +01:00
gegoune
599bdaf2f0 fix: address change requests 2021-11-12 21:52:50 +01:00
gegoune
a93c5b80d7 feat: add http parser
All credit goes to @NTBBloodbath.

See: https://github.com/NTBBloodbath/rest.nvim/issues/75#issuecomment-960447966

Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
2021-11-12 21:52:50 +01:00