Commit graph

180 commits

Author SHA1 Message Date
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
kiyan42
20e448882e some refacto, doc fixes and jsx queries
- compute query language extensions *after* default ones
(jsx after javascript)
- remove outdated ts_utils functions from docs
- add better regex detection to javascript
- javascriptreact to use javascript queries
- add javascript.jsx to javascript queries
- write jsx.scm hl file
2020-08-17 17:48:33 +02:00
Stephan Seitz
5216811459 chore(textobjects): split up into submodules 2020-08-17 17:46:40 +02:00
Stephan Seitz
32271b26ef Textobjects: set jump before going to adjacent_textobject 2020-08-17 17:45:46 +02:00
Stephan Seitz
f3ed370643 Textobject goto: treat end differently that start 2020-08-17 17:45:46 +02:00
Stephan Seitz
be2cfc1bca Textobjects: Allow nested textobjects on goto_adjacent 2020-08-17 17:45:46 +02:00
Stephan Seitz
f6681c230f chore(textobject): use query.find_best_match to find next/previous textobject 2020-08-17 17:44:40 +02:00
Stephan Seitz
e629efafd8 Textobjects: provide mappings for all swap/goto functions 2020-08-17 17:44:40 +02:00
Stephan Seitz
1642e37499 Textobjects: Add goto_adjacent 2020-08-17 17:44:40 +02:00
Stephan Seitz
5cfa03f2bd Textobjects: add swap feature 2020-08-17 17:44:40 +02:00
TravonteD
72905524c2 Add fennel support 2020-08-16 20:40:33 -04:00
Steven Sojka
4a747aa30c
Merge pull request #296 from steelsojka/feat-is-predicate
feat(highlights): add is predicate
2020-08-16 11:27:15 -05:00
Steven Sojka
5462027beb
Merge pull request #295 from steelsojka/feature/set-scopes-for-definitions
feat(defintions): allow setting of scope
2020-08-16 11:26:44 -05:00
Steven Sojka
7f7219b379 feat(definitions): allow setting of scope 2020-08-16 09:10:09 -05:00
Steven Sojka
579c9936d6 feat(highlights): add is predicate 2020-08-16 09:04:07 -05:00
Rafał Camlet
83210fa412 fix: check 'after' against third directory 2020-08-15 22:03:33 +02:00
Steven Sojka
994baf4539
Merge pull request #291 from vigoux/post-upstream-work
fix: refactor after upstream refactor
2020-08-15 08:22:14 -05:00
Thomas Vigouroux
26c8d1eac0 feat: intuitive runtime queries
Starting now, runtime queries will be sourced in this order :

- Queries that are not in any `after` folder, will serve as a base, with
each occurence overwriting the others (that is, .config/nvim/queries has
the highest priority)
- Queries within the `after` directory will be sourced one after the
other.

The rationale is that this reminds all the `.vim` files (ftplugin) for
example, and this allows both to experiment and to override queries
easily.
2020-08-14 16:42:53 +02:00
Thomas Vigouroux
98b7515014 fix: refactor after upstream refactor 2020-08-14 15:00:13 +02:00
Steven Sojka
282e33ad9c fix(definitions): optimize and fix definition highlighting 2020-08-13 07:43:09 -05:00
Thomas Vigouroux
ba3167a1a4 perf: cache parser file list for performance 2020-08-11 20:21:22 +02:00
Laxman Sooriyathas
0478fe8a48 pass full module path in recurse accumulator to enable/disable sub modules 2020-08-11 14:12:56 +02:00
Steven Sojka
4f2689c501
fix(locals): fix find definition implementation (#274)
Co-authored-by: Thomas Vigouroux <39092278+vigoux@users.noreply.github.com>
2020-08-11 09:53:05 +02:00
Steven Sojka
4982d05ec7 fix(queries): don't load queries on startup 2020-08-11 09:50:30 +02:00