Commit Graph

233 Commits

Author SHA1 Message Date
Thomas Vigouroux
c055899dc0 feat(queries): modeline mechanism for base langs
This implements https://github.com/neovim/neovim/pull/13059#issuecomment-704414189

This behaves like modelines and remove the use of the base_language map.
Also, this allows to fine-tune what we actually want to include per
query, which is better IMO.
2020-10-11 19:09:22 +02:00
Kristijan Husak
9ad47c65bd Use utils get_node_text to get line content and trim all whitespaces. 2020-10-11 13:35:18 +02:00
Kristijan Husak
3aa7e575e2 Remove old statusline implementation with new one. 2020-10-11 13:35:18 +02:00
Kristijan Husak
62df1143da Add implementation for improved statusline. Closes #545. 2020-10-11 13:35:18 +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
Suhas Hebbar
f5ac2b4a1a Shorten module reference shell_command_selectors to shell. 2020-10-06 19:08:42 +02:00
Suhas Hebbar
46ce4adca8 Code Refactor
- Move select_* function to shell_command_selectors.lua.
- Rename select_args to select_compiler_args.
2020-10-06 19:08:42 +02:00
Suhas Hebbar
40edefc476 Remove dependency on unzip.
Use tar instead which should be available on default Unixes and Windows
2020-10-06 19:08:42 +02:00
Corey Williamson
c2acddd651 Add teal parser 2020-10-05 12:02:59 +02:00
Stephan Seitz
9f5237b6c5 Fix: fallback git-installation (list of commands is expected) 2020-10-04 21:48:25 +02:00
Pau Ruiz Safont
f1c272676b feat: add ocamllex parser and highlights 2020-10-04 14:33:29 +02:00
Stephan Seitz
3362f45196 Remove textobjects module 2020-10-04 14:20:20 +02:00
Steven Sojka
7f325538cc Merge pull request #487 from steelsojka/remove-refactor
chore(modules): remove refactor module
2020-10-04 07:01:53 -05:00
Alvaro Muñoz
3dc2e9331e initial support for CodeQL 2020-09-30 17:06:58 +02:00
Stephan Seitz
b66b533ecd chore: dedup join_paths <-> join_path 2020-09-28 17:40:34 +02:00
Stephan Seitz
18fca90457 Add progress info to iter_cmd 2020-09-27 13:09:12 +02:00
Stephan Seitz
0a51d492a5 Add lockfile and make lockfile default install revision 2020-09-27 13:09:12 +02:00
Steven Sojka
82a8b859c6 chore(modules): remove refactor module 2020-09-25 10:30:35 -05:00
Stephan Seitz
0643fa3003 feat(parsers): add possibility to install from other branches
More and more Github repos are switching to "main" branch.
Example: `tree-sitter-wasm`
2020-09-22 21:27:24 +02:00
Stephan Seitz
8c10b1a14d fix(checkhealth): use pcall to check for syntax errors in query files 2020-09-20 10:37:06 +02:00
Stephan Seitz
e31cbdc13d feat(install): make compiler selectable
Compilers are selectable via 'nvim-treesitter.install'.compilers (list of compilers) or environment variable CC

Addresses #502
2020-09-19 20:05:22 +02:00
Stephan Seitz
8c4bc2803c fix: only concatenate cmd.err if not nil 2020-09-19 10:45:52 -05:00
Pau Ruiz Safont
2efeb80a44 feat(install): print more information when there's a failure 2020-09-19 13:35:12 +02:00
Pau Ruiz Safont
749a8a7f25 feat: add parser for ocaml interface files
The files have the mli extension. The parser grammar uses the name
ocaml_interface, but since vim the underscore has a special meaning
ocamlinterface is used as the filetype.
2020-09-19 13:35:12 +02:00
Stephan Seitz
7e3c4f8089 Add @keyword.operator for operators that are English words and add @exception for Java/JS 2020-09-19 07:30:49 +02:00
Rasmus Michelsen
2624c00b37 Ensure that updated files are replaced w/o warning 2020-09-18 22:35:45 +02:00
Akin Sowemimo
3652bed53e Re-add attribute highlight 2020-09-18 21:30:13 +02:00
TravonteD
c366a041c8 Add TSTag and TSTagDelimiter groups
These groups will be added for use with xml-like tags such as html and
jsx.
2020-09-18 17:09:43 +02:00
Florian Beeres
18adc9e176 Make :TSInstall work in Nix by adding a second module installation target (#473)
* Ignore tags file in project root

* Make :TSInstall work with Nix

This commit adds logic to determine where to install parsers, meaning
the *.so files. Until now the package path of the nvim-treesitter plugin
was used. But when installed with Nix, the plugin lands in "/nix/store",
which is read-only.

With this commit $XDG_DATA_HOME/nvim/site/parser/*.go will be used as
the parser installation path. The directory will be created if it
doesn't exist.

* Add generate_join function

The generate_join function is used to create two other functions, one
to join path segments, the other to join strings with a space for error
messages.
2020-09-18 09:44:07 +02:00
Stephan Seitz
ee9dd63ecd fix(folds): has_fold -> has_folds 2020-09-16 10:02:37 +02:00
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