Commit graph

33 commits

Author SHA1 Message Date
Andrey Sidorov
c3ab6a5903
make sass to be highlighted in vue files (#6526) 2024-04-29 13:39:02 +09:00
Christian Clason
ada920f2a4
feat(vue): switch to new parser (#6233)
* feat(vue): switch to new parser

---------

Co-authored-by: Phạm Huy Hoàng <hoangtun0810@gmail.com>
2024-03-02 16:54:16 +01:00
Phạm Huy Hoàng
62b0bb4f24 feat(format): extra newline after modeline 2024-02-29 23:05:30 +09:00
Phạm Huy Hoàng
77e298e4de chore: format queries 2024-01-21 23:55:02 +09: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
80f66cdef1
injections(vue): inject typescript instead of js (#5577)
Interpolations (`{{valid js code}}`) and directive attributes
(`<element :directive="valid js code"`) can also be typescript code,
hence we can inject typescript instead of javascript here and still
be ok with highlights (bar some syntax differences between ts and js)
2023-11-06 11:04:13 +09:00
Pham Huy Hoang
bfb4601f48
refactor: remove include-children from queries (#5226)
These `include-children` were to alleviate an issue with empty range language tree, which has been fixed for Neovim nightly/Neovim 0.9.2
2023-09-12 08:36:50 +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
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
Lucario387
c7b9f68d03
feat(vue): add tsx/jsx injection queries (#4550)
* feat(vue): add tsx/jsx injection queries

- add a test

- style: format vue/injections.scm
2023-03-24 14:38:19 +00:00
Pham Huy Hoang
94f9a56973 indents(vue): Update dedent logic for <template> 2023-03-06 18:11:46 -05:00
Pham Huy Hoang
5ac39d10cc indents(vue): fix indents on new line after <template> 2023-03-06 02:32:45 -05:00
Lucario387
6f4b9b190b refactor(vue, html): Update injections
Update html_tags injections so that html/vue/svelte parsers can use
it without having a script/style tag being captured twice

Signed-off-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2023-01-03 12:05:10 +01:00
Lucario387
f5d517f4a7 Fix(vue): Invalid match queries 2022-12-25 17:43:25 +01:00
Lucario387
8abb563ca9 Fix(vue): Invalid match queries 2022-12-25 17:43:25 +01:00
Lucario387
4547a3687c injections(vue): Update injection queries 2022-12-25 14:58:33 +01:00
Lucario387
eaeedfb804 Fix vue injection queries 2022-12-22 17:43:44 +01:00
Michael Chris Lopez
1f8ef8fe52 highlights(vue): improve vue highlights
- remove template_name and element and make more specific targeting
2022-01-12 12:10:07 +01:00
Stephan Seitz
675ecbb0bd Fix pug injection 2021-11-30 23:40:49 +01:00
Stefan Wienert
dec2ba27a8 Feat: Added Pug parser with inital queries 2021-11-30 23:40:49 +01:00
Cyril Mizzi
94fa0d3189 fix(vue.indents): add support for template_element 2021-11-11 21:00:33 -05:00
Cyril Mizzi
8d6c2b0044 fix: define indents.scm for html_tags and inherits html and vue from this file 2021-11-11 21:00:33 -05:00
Cyril Mizzi
ce866ecc2f feat(vue): add indents.scm file
There's no indentation file for Vue. This implementation is based on the HTML indentation file with a minor support for the `template_element` tag. As JS is bind with the JS Tree-sitter, the indentation is already fine.
2021-11-11 21:00:33 -05:00
Joakker
c699cc2e47 Use #any-of? instead of #match? where posible 2021-06-25 00:22:48 +02:00
elianiva
5d2faa0466 refactor: make html-like languages inherit from single query 2021-05-17 23:38:14 +02:00
Santos Gallegos
67f0857015 Revert "Comment: use @combined to create just one tree per buffer (#1252)"
This reverts commit 4a7a713c52.
2021-05-07 16:51:57 +02:00
Santos Gallegos
4a7a713c52
Comment: use @combined to create just one tree per buffer (#1252)
* Comment: use `@combined` to create just one tree per buffer

There is no need to create a tree per line/block for comments.
Should fix https://github.com/nvim-treesitter/nvim-treesitter/issues/1251

* Add injections for scss

* Fix jsonc

* Combine jsdoc
2021-04-28 07:19:07 -05:00
Artur Tagisow
e8e8c0f0f2 Highlight v-bind using javascript 2021-04-22 21:24:12 +02:00
elianiva
ffbf8f19a4 feat: add scss injection for svelte/vue 2021-04-08 22:50:41 +02:00
Santos Gallegos
e4083fc8e1
Add comment parser to highlight comment tags (#893)
Closes #236
2021-03-12 11:21:46 -05:00
Hugo Osvaldo Barrera
4847f5a5a7 Add support for folding Vue files 2021-02-17 14:43:32 +01:00
Hugo Osvaldo Barrera
ff7ec08a1e Add support for Vue files
I haven't included parsing the `style` tag, since the only applicable
queries we have are CSS (which actually works fine for SCSS too).
2021-02-17 14:43:32 +01:00