Commit graph

107 commits

Author SHA1 Message Date
Sergey Kacheev
a072d923c7 fix: uninstall function in the install.lua
The get_ensure_installed_parsers function return a table
for the option "all" because uninstall accepts a table
2023-03-24 23:23:02 +01:00
Lewis Russell
90ead4ed58 fix: shim 0.9 deprecations 2023-03-24 16:05:38 +01:00
Amaan Qureshi
079a50f66e refactor!: remove setting the update strategy 2023-03-11 17:52:54 -05:00
Amaan Qureshi
853b1ab39a style: fill in missing code docs wherever applicable 2023-02-24 01:08:23 -08:00
Stephan Seitz
29304e16bb fix: show errors when reload after installation fails 2022-12-31 13:59:18 +01:00
Stephan Seitz
507527711f feat: allow to set keymappings to false
Fixes #3954
2022-12-15 14:55:15 +01:00
Julien Burkhard
b6beb5e7d0 feat: support when buf is not current 2022-12-04 18:35:55 +01:00
kylo252
acb65eedc5 fix(installer): ignore globally installed parsers
Problem:    `is_installed` is picking up parsers shipped by neovim v0.8
            with unknown version and compatability
Solution:   only consider a parser installed if it's available in the
            parsers_install_dir
2022-11-24 09:25:58 +01:00
Carlo Sala
80503a9910 fix(configs): ensure_installed can be a string 2022-10-31 12:51:25 +00:00
Lewis Russell
0948bf2274 feat(emmy): add emmylua annotations 2022-10-31 12:00:45 +01:00
Lewis Russell
b9bcbf8d73 fix(modules): allow non-registered langs to use modules
This change allows for languages not managed by nvim-treesitter to use
Nvim-treesitter modules like folding and indent.
2022-10-19 10:32:30 +02:00
Stephan Seitz
d011532d73 fix: warn when user uninstalls parser than is in their ensure_installed
Fixes #2777
2022-08-26 13:35:17 -07:00
Stephan Seitz
14bd391e56 chore: remove unused parameter
The argument wasn't used anywhere neither in function nor in call sites
2022-08-26 13:35:17 -07:00
Stephan Seitz
7ab2c037dd chore!: don't allow to silently use alternative install directory 2022-08-26 13:35:17 -07:00
Kiyan
91ee9e7376
fix(typo): utils.create_or_resue_writable_dir -> reuse (#3194) 2022-07-18 12:43:31 +02:00
Jonas Strittmatter
365f0eb75f
feat: add option to auto-install missing parsers (#3130) 2022-07-08 07:36:54 +00:00
Duncan McDougall
901ffe1a36
Add support for custom parser install locations #2959 (#3031) 2022-06-20 22:50:07 +02:00
Christian Clason
1f508ff394 fixup: separate augroups for modules 2022-04-30 16:08:01 +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
Stephan Seitz
21ac88b955 chore!: remove compat module for vim.ui 2022-04-18 14:17:22 +02:00
kiyan
7141393f12 fix(modules): enabling disabling per buffer and globally
When a module is disabled by default in the config, running
TSBufEnable will not enable the module because the is_enabled
function will always return false, thus the module not being enabled.
Also, disabling/enabling the buffers is flaky.

This commit adds per buffer check when the module is not disabled. It
also makes the enable and disable more indempotent.

i've also renamed TS*All to TS*.

Fixes #2754
2022-04-10 11:10:12 +02:00
kiyan
560e8fb450 refacto: expose a function to set custom capture for the higlighter
BREAKING: deprecate custom_captures from highlight config.
This allows plugin authors to extend the map. It also avoids settings
user configuration specific values during the highlighter
initialization (SOC).
Not sure how much value this brings, and might potentially break a lot
of people configurations. This is questionable.
2022-02-19 18:26:51 +01:00
kiyan
a0b7cece2c chore: expose start and stop highlighter
Decompose highlighter module in small functions to allow exporting a
start and stop functions without the syntax change.
Also fix linter issues in configs.lua
2022-02-06 15:12:34 +01:00
Stephan Seitz
387a8f38bd parsers: Add MDeiml/tree-sitter-markdown as markdown parser
Fixes #872
2021-12-14 15:00:14 +01:00
patrick96
d2174f1d29 Fix docs 2021-11-28 00:31:02 +01:00
patrick96
d24a1c63d4 Make disable accept a function
Replaces the condition setting (though it does the exact inverse)
2021-11-28 00:31:02 +01:00
patrick96
76673d61c3 Rename cond to condition 2021-11-28 00:31:02 +01:00
patrick96
e3dabec462 Add condition function to module config
The function is called with the language and bufnr, if it returns false,
the module is disabled for that buffer.

This gives the user more fine-grained control over whether a module is
started.
2021-11-12 19:55:04 +01:00
Sirisak Lueangsaksri
f6dcbe66b0 refactor: nitpicking 2021-11-08 15:04:38 +01:00
Sirisak Lueangsaksri
aaf157a6a9 feat: sync install for ensure_installed 2021-11-08 15:04:38 +01:00
Santos Gallegos
55860a76d9 Use wrapper around vim.notify with common options
Ref https://github.com/nvim-treesitter/nvim-treesitter/pull/1927#issuecomment-947064843
2021-10-22 23:46:16 +02:00
Stephan Seitz
98ada316c3 chore: use vim.ui.select for TSEditQuery if available 2021-10-03 11:17:40 +02:00
Santos Gallegos
9be9ebda0a Re-attach module when the file type is changed
Requires https://github.com/neovim/neovim/pull/14995
Closes https://github.com/nvim-treesitter/nvim-treesitter/issues/1249
2021-07-18 16:44:25 +00:00
Stephan Seitz
4571d57251
New stylua version (#1555) 2021-07-11 20:59:06 +00:00
Santos Gallegos
be8f656087
Use stylua for autoformat code (#1480) 2021-07-04 21:12:17 +00:00
Shane Hird
303121e0ec Improved passing bang to functions 2021-07-04 14:59:13 +02:00
Shane Hird
289e73b889 Fix ensure_installed function 2021-07-04 14:59:13 +02:00
Shane Hird
76ea2b8871 TSUpdate does not install if up to date 2021-07-04 14:59:13 +02:00
Thomas Vigouroux
afd5d11519 feat(incremental_selection): don't require locals 2021-04-22 18:12:03 +02:00
Stephan Seitz
3f5c3c01e6 Avoid Lua 5.3 function table.unpack 2021-04-19 23:43:53 +02:00
Santos Gallegos
2abad14069
Fix TSEditQuery with several files (#1191)
- Choice already starts with 1, there isn't need to increment 1
- The first item is the prompt as recommended in `:h inputlist()`
  (this way the choice matches when using the mouse)
2021-04-16 00:51:40 -05:00
Stephan Seitz
4df2667303 feat: Add TSEditQueryUserAfter 2021-04-14 16:23:21 +02:00
Stephan Seitz
4214646953 feat: Add TSEditQuery 2021-04-14 16:23:21 +02:00
Steven Sojka
7984975a2f
feat(install): allow ignore list when installing parsers (#1098) 2021-03-24 09:12:03 -05:00
Stephan Seitz
ff9bf6dc2b feat: Allow to configure to use syntax and tree-sitter together 2021-03-18 12:03:37 +01:00
kiyan
9d57216c0d chore: remove useless code and indent files 2021-02-27 13:36:33 +01:00
echasnovski
fdfbb5c1bf Implement TSToggleAll. 2021-02-01 19:37:39 +01:00
echasnovski
8e2807d09e Implement TSBufToggle. 2021-02-01 19:37:39 +01:00
Thomas Vigouroux
4538a876b4 Revert "added attach async" 2021-01-14 13:26:43 +01:00
Brian Shu
28f2ba475f fixed not highlighting bug 2021-01-08 16:16:33 +01:00