Christian Clason
18bb653917
feat(locals)!: remove locals module
...
Problem: `locals.lua` was neither used nor tested, and providing it goes
against the goal of nvim-treesitter not being a required dependency for
other plugins.
Solution: Remove the module and document that the queries are provided
as-is for limited backward compatibility only.
2025-05-12 18:43:41 +02:00
Christian Clason
037ac775e1
feat: add .tsqueryrc.json
2025-05-12 18:43:40 +02:00
Christian Clason
a9f34d5a76
feat(parsers): rework tiers
...
* stable: updates follow semver releases (todo)
* unstable: updates follow HEAD (default)
* unmaintained: no automatic updates
* unsupported: no updates, cannot be installed
2025-05-12 18:43:40 +02:00
Christian Clason
c17de56890
feat!: track parser revision in Lua
...
Problem: Tracking parser revision in lockfile and allowing override
through the parsers module complicates the code. In addition, only
revision changes are handled robustly, not changes to other installation
info.
Solution: Track parser revision in the parsers module directly. Reload
parser table on every install or update call. Support modifying parser
table in a `User TSUpdate` autocommand.
2025-05-12 18:43:40 +02:00
Christian Clason
5a38df5627
feat(install)!: generate from json instead of requiring node
...
Problem: Many parsers require node/npm to evaluate the `grammar.js`
before being able to generate a parser from it.
Solution: Generate from `grammar.json` instead, which is fully resolved.
Drops `node` and `npm` as (optional) requirements for nvim-treesitter.
Note that this requires parsers to commit the generated json iff the
grammar requires evaluation (which is currently the case for all tracked
languages).
2025-05-12 18:43:40 +02:00
Christian Clason
a8f5641ab3
feat(install)!: remove support for C++ scanners
2025-05-12 18:43:40 +02:00
Phạm Huy Hoàng
429e6f446b
doc: better clarification of highlights/injections
2025-05-12 18:43:40 +02:00
Christian Clason
178c6a84c1
docs: update CONTRIBUTING.md
2025-05-12 18:43:40 +02:00
Christian Clason
692b051b09
feat!: drop modules, general refactor and cleanup
2025-05-12 18:43:40 +02:00
Omar Valdez
51bba660a8
refactor(queries): Remove quotes from properties in set! directive
2024-07-28 11:43:41 +02:00
Riley Bruins
d5a1c2b0c8
feat: standardize and document export keywords
...
Many export keywords are captured as `@keyword.import`. This commit
makes it so they are all captured like that, and mentions it in the
documentation.
2024-05-13 09:16:31 +02:00
Riley Bruins
f58cae6c22
feat: more @keyword.type captures
2024-05-01 09:59:50 +02:00
Jaehwang Jung
8f5513a1f2
feat(rust,lalrpop): @attribute for lifetimes
...
`@keyword` is only for language-defined keywords.
2024-03-16 20:51:16 +08:00
Jaehwang Jung
5d75359a9a
feat(highlights)!: remove non-keyword @type.qualifier
...
* blueprint: Don't specially highlight template_name_qualifier. This is
similar to inheritance base class. Other languages don't highlight
them specially.
* eds: `@type` for all `*Type` keys
* chatito: `@attribute` for variation
2024-03-16 20:51:16 +08:00
Jaehwang Jung
dccf31f9b1
feat(highlights)!: @keyword.storage → @keyword.modifier
2024-03-16 20:51:16 +08:00
Jaehwang Jung
998b230a77
feat(highlights)!: keyword @type.qualifier → @keyword.modifier
2024-03-16 20:51:16 +08:00
Christian Clason
3d08cdd741
fix(comment): remove duplicate 'FIXME'
2024-03-03 16:03:26 +01:00
Christian Clason
99ddf57353
feat(highlights)!: enforce documented captures ( #6232 )
...
Problem: Allowing undocumented "secret" (sub)captures makes it harder
to write comprehensive colorschemes and catch inconsistent captures.
Solution: Only allow captures listed in CONTRIBUTING.md. Add useful
(cross-language) subcaptures and drop language-specific or too niche
ones.
Follow-up: Adding further `*.builtin` captures and changing queries to
use them.
Language-specific subcaptures should instead be added in user config or
a custom language plugin.
2024-03-03 11:00:11 +01:00
Christian Clason
6806d7a783
docs(contributing): typos and examples
2024-01-21 12:04:42 +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
Christian Clason
76b85583e1
docs: update CONTRIBUTING.md with 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
aMOPel
6e4a770799
docs: improve description of @type.definition capture
...
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-10-20 15:59:56 -04: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
Lewis Russell
d9be302f74
fix(spell): do not spell check certain types of strings ( #5203 )
...
- Document that only certain kinds of strings are spell checked, and
reasons why they may not.
- Remove spell checking for bash strings.
2023-08-07 13:42:24 +01:00
Christian Clason
a034c7aa25
fix(highlights): lower priority for codeblocks with injections ( #4905 )
2023-06-05 14:09:44 +02:00
Chris Kipp
9711139326
docs: add a small note about local queries
...
This just adds a small note in the CONTRIBUTING section about local
queries and how they differ from those listed upstream.
2023-04-03 01:54:02 -07: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
Amaan Qureshi
3a82b58745
docs: add @comment.documentation
2023-03-05 17:15:32 -05:00
Amaan Qureshi
51030378eb
docs: add @string.documentation
2023-03-05 17:15:32 -05:00
Amaan Qureshi
1bf4be0441
docs: add @keyword.coroutine
2023-03-03 07:07:52 -08:00
Bulgantamir Gankhuyag
c90fa75784
Update CONTRIBUTING.md
...
Fixed link of the supported languages.
2023-02-18 00:16:30 -08:00
Kiyoon Kim
80e41f22ce
prettier formatting yml and md
2023-02-16 01:48:37 -08:00
ObserverOfTime
341bbae864
docs: fix comment alignment
2023-01-21 14:37:07 +02:00
Chris Kipp
5e9c6b6ba0
docs: swap life-time around
...
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-01-15 11:58:02 +02:00
Chris Kipp
c4c543ed1d
docs: clarify @storageclass in CONTRIBUTING docs
...
This is just a tiny change that was in reference to
https://github.com/nvim-treesitter/nvim-treesitter/pull/4153#discussion_r1070276800 .
The basis is that `@storageclass` should only be used unless it's
actually affecting storage in memory. There are further conversations
about this in the following places:
- https://github.com/nvim-treesitter/nvim-treesitter/pull/3648#issuecomment-1279923861
- https://github.com/nvim-treesitter/nvim-treesitter/pull/3648#issuecomment-1291624844
2023-01-15 11:58:02 +02:00
Christian Clason
7e4a7c4508
markdown: add strikethrough and blockquote captures
2023-01-14 11:52:25 +01:00
Stephan Seitz
afe4e94f1a
docs: remove remaining references to Zulip
2023-01-11 21:17:08 +01:00
Stephan Seitz
d6a2ecb8b7
highlights: create subscoping for ternary operator
...
After https://github.com/nvim-treesitter/nvim-treesitter/issues/470 ,
we decided to use `@conditional` for ternary operator instead of
operator despite `@conditional` is documented for keywords only.
A sub-scoping can make it easier for people to highlight this operator
group differently.
Also unify the usage of `@conditional...` across languages.
2022-12-02 21:42:11 +01:00
ObserverOfTime
7d7feb859a
docs: fix contributing guidelines
2022-11-26 13:17:51 +02:00
Christian Clason
37071a2e97
docs: add @nospell to contributing.md
...
supported as of Neovim v0.8.1
2022-11-19 16:31:38 +01:00
Trard
00b42ac6d4
rust: use @type.qualifier and @storageclass
2022-11-06 18:10:42 +01:00
gbprod
1e4b23c266
feat(diff): add diff parser
...
This commit introduce diff parser.
2022-10-19 16:22:58 -07:00
ObserverOfTime
17aef2898b
docs: document all the captures in CONTRIBUTING.md
2022-10-17 12:12:34 +02:00
Cameron
312a9ba483
Update CONTRIBUTING.md
...
Add `@variable.globle` to available variable captures.
2022-09-10 11:07:45 -07:00
Lewis Russell
2a63ea5665
feat(spell): upstream spell queries from spellsitter
2022-09-06 12:44:19 +01:00
lfenzo
460d24a12d
Updated CONTRIBUING.md
2022-08-03 12:05:30 -07:00
Gregory Anders
e2b2d2357b
Add capture groups for remaining builtin highlight groups
...
Some builtin highlight groups (see `:h group-name`) do not yet have
associated capture groups, so add them.
2022-03-30 22:14:23 +02:00
sogaiu
9c2def8fa1
Zulip link was missing protocol portion?
2022-03-30 16:02:38 +02:00