Commit Graph

203 Commits

Author SHA1 Message Date
kiyan42
71ba2afc70 add TSNone 2020-09-15 00:19:04 +02:00
Santos Gallegos
50991e370b Folds: rename query files to folds.scm to be consistent
We use plural names for all query files except folds.
2020-09-14 18:26:30 +02:00
Santos Gallegos
31e6d1e647 TextObjects: refactor wrong func names
Reading the code, these functions should be named differently

a755017dd5/lua/nvim-treesitter/query.lua (L203-L203)
2020-09-12 10:51:06 +02:00
Stephan Seitz
d180dca74d Yield meaningful error messages in iter_cmd{,_sync} when cmd.err == nil 2020-09-11 18:01:33 +02:00
Santos Gallegos
20b822314d Allow to call setup on already loaded modules. 2020-09-11 08:45:50 +02:00
Santos Gallegos
facdb691d9 Improve startuptime
- Don't load everything at startup
- Don't define an autocomand for each module and for each supported lang
  (this creates nxm autocomand!)
2020-09-10 22:58:59 +02:00
Markus Koller
fd6d09fd1f Find package path based on the Lua source file
This is more robust compared to the previous method where we walked
up the tree and matched on the directory name, which also required
that the repository was cloned in a directory named `nvim-treesitter`.
2020-09-10 15:11:04 +02:00
Santos Gallegos
9ec7e56fda Ocaml: fix parser
Paths were changed https://github.com/tree-sitter/tree-sitter-ocaml/pull/41
2020-09-10 09:15:18 +02:00
Stephan Seitz
3c1399b94e Fix #418: iterator function should always return an iterator
Even if it's an empty iterator.
2020-09-08 22:02:11 +02:00
Stephan Seitz
dc077b5fb0 feat(parsers): add filetype PKGBUILD 2020-09-08 20:34:58 +02:00
Santos Gallegos
7508b93287 Import treesitter.install only when needed 2020-09-08 19:37:32 +02:00
Santos Gallegos
77c2730a62 Improve startup performance 2020-09-08 19:37:32 +02:00
Santos Gallegos
95a7d24180 Queries: merge query_extensions into base_language_map
These two are doing the same currently.
2020-09-08 19:16:54 +02:00
kyazdani42
8d6c40ce24 fix using highlight query extension for every query type 2020-09-07 21:57:56 +02:00
Santos Gallegos
9c456edb3a Incremental selection: fix skipping some nodes
The range from ts nodes are a little different than
neovim's nodes. They start at 0 and the end is exclusive.
For example, a nvim range (1, 3, 2, 4) is the equivalent to the ts
range (0, 2, 1, 4).

Since we may hit parent nodes that have the same range as its child,
we skip those till we find one that actually changes the selection
(since this is the relevant part for the user).

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/232
2020-09-07 18:24:55 +02:00
Santos Gallegos
a5360d02e4 Fold: respect max_fold_level from 'foldnestmax' 2020-09-07 18:24:21 +02:00
Santos Gallegos
97c1e60bd4 Text objects: check for query files first
The first function is faster and more common.
2020-09-06 15:51:10 +02:00
Rasmus Michelsen
50de57711b Fixed table insertion 2020-09-06 13:42:24 +02:00
Rasmus Michelsen
07c0e837ab Fixed win32 check hopefully 2020-09-06 13:42:24 +02:00
Rasmus Michelsen
d9a7b80c7b Added changes 2020-09-06 13:42:24 +02:00
Rasmus Michelsen
f0f162d041 A few fixes 2020-09-06 13:42:24 +02:00
Rasmus Michelsen
38d34ad493 Local variable fix 2020-09-06 13:42:24 +02:00
Rasmus Michelsen
4f1a464027 Support TSInstall on Winddows with Clang 2020-09-06 13:42:24 +02:00
Santos Gallegos
7a1f6b1586 Completion: use custom instead of customlist
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/396
2020-09-05 19:29:46 +02:00
kiyan42
9e22864d03 fix ts_available_modules should be using nvim_treesitter#available_modules 2020-09-05 17:05:08 +02:00
Santos Gallegos
1ba18329c7 Refactor: move completion functions to autoload 2020-09-04 21:20:30 +02:00
Thomas Vigouroux
355d86fe6b preds: declare set! predicate 2020-09-03 18:19:18 +02:00
Stephan Seitz
38df2d252f Add warning about required Neovim version 2020-09-03 15:33:18 +02:00
TravonteD
439b58d92c add scanner file for fennel parser 2020-09-02 06:59:42 +02:00
Thomas Vigouroux
419388d887 health: add fold queries to check health 2020-09-01 21:51:17 +02:00
Thomas Vigouroux
03621e758c docs(fold): document and comment 2020-09-01 21:51:17 +02:00
Thomas Vigouroux
36d2c7d746 fix(fold): fix #350
Also correctly handle things like :

if (foo) {
}
if (bar) {
}
2020-09-01 21:51:17 +02:00
Thomas Vigouroux
545e5c479a fix(fold): revamp fold
fix(fold): typo

fix(fold): remove debug and add queries

fix(fold): fallback to local scopes for folds
2020-09-01 21:51:17 +02:00
evakuator
92c18c8efa use xmap in detach 2020-09-01 20:50:31 +02:00
evakuator
c5d5e48e0f use xmap instead of vmap in textobjects 2020-09-01 20:50:31 +02:00
Stephan Seitz
bc36521967 feat(refactor.navigation): allow a fallback_function for goto_definition
`fallback_function` is called when nvim-treesitter can not resolve the
variable under the cursor.
2020-08-31 22:16:27 +02:00
Stephan Seitz
6352cdc943 Fix(modules): simplify configs.setup
This prevents a really weird bug were the following function call (after
loading the activated modules) could activate `highlight_current_scope`

```lua
 require "nvim-treesitter.configs".setup(
     {
         highlight = {
             enable = false, -- false will disable the whole extension
             disable = {"html", "lua"} -- list of language that will be disabled
         },
         refactor = {
             highlight_current_scope = {
                 enable = false,
                 inverse_highlighting = true,
                 disable = {"python", "markdown"}
             },
             highlight_definitions = {
                 enable = true,
                 disable = {"markdown"}
             },
         },
         ensure_installed = "all",
         disable = {"markdown"}, -- list of language that will be disabled
     }
 )
```
2020-08-31 21:34:57 +02:00
Stephan Seitz
23b4542218 fix(highlight_current_scope): Ensure that detach is a inverse of attach 2020-08-31 21:34:57 +02:00
Stephan Seitz
08f1a8561f Avoid enabling disabled modules (even if they were disabled immediately)
This might be safer for the case that attach/detach are not inverse to
each other. Disabled modules shouldn't ever be activated.
2020-08-31 21:34:57 +02:00
Stephan Seitz
5948aba886 feat(refactor.navigation): add navigation.goto_{next,previous}_usage 2020-08-31 18:56:41 +02:00
Oleg Matrokhin
ac13baadb6 remove second check 2020-08-30 23:48:11 +02:00
Oleg Matrokhin
cf9df71341 fix get_package_path function for paths with trailing slash 2020-08-30 23:48:11 +02:00
Stephan Seitz
ce7efd34c6 Add Windows support (mingw) 2020-08-27 22:20:30 +02:00
Thomas Vigouroux
34160bb6f2 fix(health): only check installed parsers
This is to avoid awfully long checkhealths. And not installed parsers
can be infered from the fact that they are not listed.
2020-08-27 21:39:11 +02:00
Stephan Seitz
7c9ffe9e19 Fix #292: Add parser links to README.md 2020-08-25 14:58:28 +02:00
Steven Sojka
5d97cc5e09 fix(locals): add nil guard for definition id creation 2020-08-25 14:35:08 +02:00
Steven Sojka
3b2cb65d4c Merge pull request #330 from steelsojka/fix-do-not-reattach
fix(modules): do not reattach if already attached
2020-08-22 09:10:28 -05:00
Steven Sojka
3fe8bbcf9c fix(modules): do not reattach if already attached 2020-08-22 06:07:21 -05:00
Steven Sojka
53fda90be0 fix(smart_rename): fix usages call 2020-08-21 23:23:46 +02:00
Steven Sojka
b796f0725d Merge pull request #305 from theHamsta/textobjects-submodules
Textobjects submodules
2020-08-17 11:39:22 -05:00