79 Commits

Author SHA1 Message Date
Christian Clason
5cb05e1b0f fix(filetype): don't register c-sharp
Language names can only contain hyphens, and dashes are normalized by
Nvim itself now.
2026-03-07 11:15:38 +01:00
Christian Clason
9d47b2558b feat(json): add support for jsonc files 2025-12-06 18:10:39 +01:00
altermo
7f8dd2e48b fix(filetypes): correct glimmer_* mappings (#8110) 2025-09-10 07:29:48 +00:00
Igor
12be0e9f24 fix(ini): register dosini and confini filetypes 2025-07-26 17:32:28 +02:00
Christian Clason
1181cd9a25 feat(verilog)!: rename to systemverilog
Grammar name was changed to coincide with repository name
2025-06-24 10:07:36 +02:00
Luis Calle
2317241896 fix: register powershell language for ps1 filetype (#7965)
* chore: sort languages

* fix: register `powershell` language for `ps1` filetype
2025-06-23 18:15:08 +00:00
Christian Clason
ff770d718b fix(install): don't print operation summary by default
Problem: People complain about noisy `install()`.

Solution: Gate operation summary behind `summary` install option
(default false, set to true for interactive `:TS*` commands).
2025-05-29 20:08:10 +02:00
Christian Clason
ce903fde5d feat(api): expose list of available and installed languages 2025-05-29 12:11:56 +02:00
Christian Clason
0860b9b107 fix(config): check both installed parsers and queries
Problem: Can't uninstall custom parsers without queries since
`installed_parsers` only iterates over installed queries (to include
query-only languages, and to avoid string manipulation).

Solution: Iterate over both queries and parsers to collect list of
installed languages (optionally only queries or only parsers).
2025-05-29 11:52:58 +02:00
Christian Clason
53d7118483 refactor(lua): fix some luals warnings 2025-05-12 18:43:40 +02:00
Christian Clason
cbfe8a20c7 feat(html): use gsub for mimetype lookup 2025-05-12 18:43:40 +02:00
Christian Clason
214cfcf851 feat!: use tree-sitter build 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
Lewis Russell
0bb981c876 fix: do not use vim.iter (#6469) 2025-05-12 18:43:40 +02:00
Gregory Anders
be5f9b0eaa fix: update add_predicate and add_directive calls for upstream (#6106)
Update custom predicates and directives to handle multiple nodes per
capture ID per changes upstream.
2025-05-12 18:43:40 +02:00
Christian Clason
f13420ccff fix: remove upstreamed directives
`#inject-lang!` and `#trim!`; fix `set-lang-from-mimetype`
2025-05-12 18:43:40 +02:00
Christian Clason
5a70048116 feat: drop TSInstallInfo in favor of better checkhealth
also fixes the hole in install.compilers
2025-05-12 18:43:40 +02:00
Christian Clason
9c0a99819c ci: remove update-lockfile shell script 2025-05-12 18:43:40 +02:00
Lewis Russell
cde679e435 refactor: rewrite installation using jobs and async
Replace sync variants with callback support
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
Christian Clason
42ab95d5e1 feat!: remove obsolete TS* highlight groups 2022-10-16 15:50:55 +02:00
John Drouhard
635c450939 feat(highlight): re-apply default highlights on colorscheme changes
If the plugin is loaded after a colorscheme is set that defines any of
these highlight groups, the default won't be applied. Subsequent
"highlight clear" commands (common when switching colorschemes) will
then clear any of those highlights, but these defaults never have
another opportunity to be initialized.

Effectively, if you load neovim with a colorscheme that has definitions
for some of these highlight groups, then load treesitter, then switch
colorschemes, many of these default links will be absent resulting in
colors that do not appear the same as if that colorscheme had been
used at startup.

Hooking the ColorScheme event with an autocmd that just reapplies these
defaults gives every colorscheme switch the opportunity to get the
defaults for non-explicitly-defined groups.
2022-07-30 20:13:24 +02:00
Christian Clason
07eb437bb1 refactor!: update to Neovim 0.7 APIs
* set highlight groups via nvim_set_hl
* define autocommands via nvim_create_autocmd
* port plugin/nvim-treesitter.vim to Lua
* port healthcheck to Lua
2022-04-30 16:08:01 +02: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
Sean Baildon
2b785889a4 create TSTagAttribute highlight group (#1575)
references #1572
2021-07-14 14:33:36 +00:00
Santos Gallegos
647268183f Highlights: define string.special (#1551)
* Highlights: define string.special

This was in our CONTRIBUTING.md file,
but wasn't defined.

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1405

* Use string.escape
2021-07-11 15:59:53 -05:00
antonk52
90f15d9bf7 feat(keywords) merge return and yield into keyword.return group 2021-07-04 21:49:17 +02:00
antonk52
bd9095e969 feat(keywords) add keyword.return & keyword.yield 2021-07-04 21:49:17 +02:00
kmarius
8adb2e0352 fix typo: Enviroment -> Environment 2021-06-22 07:27:00 +02:00
Santos Gallegos
054c2a5747 Link TSComment to Comment
Fix https://github.com/nvim-treesitter/nvim-treesitter/issues/1246
2021-04-24 19:12:58 +02:00
Stephan Seitz
e1997ebbca Add LaTeX maintainers 2021-03-30 19:26:37 +02:00
Stephan Seitz
712cc78a1e Add text.reference and text.environment 2021-03-30 19:26:37 +02:00
Stephan Seitz
0556edf5f3 latex: add TSMath that behaves like vimtex math highlighting 2021-03-30 19:26:37 +02:00
Stephan Seitz
1375cc5c1f fix(checkhealth): display error messages of failed queries 2021-03-23 21:25:37 +01:00
Santos Gallegos
e4083fc8e1 Add comment parser to highlight comment tags (#893)
Closes #236
2021-03-12 11:21:46 -05:00
Dennis B
aca33c0aca [highlights] Add TSSymbol highlight group
Addresses issue #892

Ruby and Dart literal symbols will now be highlighted by the new
TSSymbol highlight group, which itself will, by default, link to the Vim
Identifier highlight group. Vim theme authors can then set their
TSSymbol colors.

Symbol highlighting can apply to a number of languages as noted in the
following Wikipedia page: https://en.wikipedia.org/wiki/Symbol_(programming)

Not just for Ruby and Dart.
2021-03-04 06:19:40 +01:00
Santos Gallegos
b86555d9c3 HTML: improve highlights & injections 2021-02-11 07:42:19 +01:00
oberblastmeister
64ffea57f4 feat(query): add cache for get_query (#879)
* added cached to get_query

* added reload function

* fixed message

* added autocommand to reload cache on bufwrite for query file

* pass filename to autocommand v:lua fn

* removed comment

* added metatable

* fixed loop

* Update lua/nvim-treesitter/query.lua

Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>

* Update lua/nvim-treesitter/query.lua

Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>

* added do ... end to local query_cache

* made line shorter

Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
2021-01-28 19:56:55 +01:00
delphinus
958252783e Revert "Add lacked highlight link defined in highlight.lua"
This reverts commit 00f4f4d9856da0191c1d7f0d33f22b7cfcbb56c8.
2020-12-21 22:32:17 +01:00
delphinus
f74b14a7f9 Add lacked highlight link defined in highlight.lua 2020-12-21 22:32:17 +01:00
Stephan Seitz
3160a19de3 Fix #595, #583: do not set defaults for highlights that have no default highlighting 2020-10-19 23:03:16 +02:00
Akin Sowemimo
19c9465a8c Explicitly check for cterm and gui values for fg
If a user hasn't set either we default to NONE
2020-10-11 19:26:37 +02:00
Akin Sowemimo
c817b62ae4 Add a check to ensure the fg attribute exists
before setting the value
2020-10-11 19:26:37 +02:00
Akin Sowemimo
1e43c0267f Don't change the background highlights
treesitter highlighting is colouring the characters in the foreground so
there's no need to touch the highlighting of the background
2020-10-11 19:26:37 +02:00
Akin Sowemimo
d8a516cb39 fix cterm fg and bg error 2020-10-11 19:26:37 +02:00
Akin Sowemimo
c89367f283 Add background and foreground colors to TSNone
This fixes the issue where colors highlighted as TSNone were not
reverting to the background and foreground color.
2020-10-11 19:26:37 +02:00
Stephan Seitz
45397ebbd9 fix(highlights): Add TSNamespace highlight
Start adding highlights for
     - C++
     - Rust (including other scoped_identifier/scoped_type_identifier fixes)
     - JS (only namespace_import)

Addresses #516
2020-10-10 15:31:51 +02:00
Stephan Seitz
93f9708a3c Dart highlights: Reset highlight in interpolation 2020-10-05 06:37:31 +02:00
Steven Sojka
82a8b859c6 chore(modules): remove refactor module 2020-09-25 10:30:35 -05:00