Commit graph

63 commits

Author SHA1 Message Date
kiyan42
df17a48c85 refactor: parser list and lang->ft/ft->lang
- move parser list in `parsers.lua`
- most `ft` variable where changed to `lang`, `ft` is only used on
  autocmd binding, and lang is used for everything else. Functions have
  been defined to make the switch between `ft` and `lang`
2020-06-20 12:31:52 +02:00
kiyan42
ad636f4f53 fix: declare parse names as their appropriate filetype and change clone url 2020-06-19 16:12:57 +02:00
kiyan42
cf72524b2f add winnr to get_node_at_cursor 2020-06-19 14:13:23 +02:00
kiyan42
38af29a912 refacto: remove buf_state
- remove buf_state and related code
- add get_node_at_cursor()
- better incremental selection (code is localized)
2020-06-19 13:45:33 +02:00
Stephan Seitz
0671c0c6a2 Fixup: Introduce base languages for queries
Use same argument for nvim_get_runtime_file for base language
2020-06-15 12:09:51 +02:00
Stephan Seitz
df06026110 Introduce base languages for queries
Some treesitter grammars just extend another treesitter grammar.
This enables us to use the C queries also for C++.
We only need to put additional queries in the C++ files.
2020-06-15 11:51:28 +02:00
Kiyan Yazdani
6b26674ba0
Merge pull request #80 from steelsojka/feat/user-query-overrides
feat(queries): allow user query overrides
2020-06-15 11:43:42 +02:00
Stephan Seitz
45ea0df21a Add tree-sitter-regex
This might be interesting for injected highlighting
2020-06-14 13:09:38 +02:00
Steven Sojka
44108fe03e feat(queries): allow for user overrides 2020-06-14 05:58:09 -05:00
Thomas Vigouroux
fbade728fe feat: add syntax-based folding 2020-05-25 11:19:38 +02:00
Thomas Vigouroux
9afad9698e
Merge pull request #56 from theHamsta/python-locals
Add python locals.scm
2020-05-23 15:19:03 +02:00
Stephan Seitz
3b3a692e2c Remove postspaces and avoid one global 2020-05-22 17:07:28 +02:00
Stephan Seitz
f6bf56974e Introduce @include 2020-05-17 21:56:44 +02:00
Thomas Vigouroux
0ab6bbec67
install: allow installing multiple parsers at once
This allow commands like so :
  :TSInstall c rust lua python
2020-05-15 17:24:54 +02:00
kiyan42
8be2dc64a2 Expose internal api.
- add `exposed_state` to expose 'current_node' and 'cursor_pos'
for a current buffer to the user.
- add `get_buf_state` and `get_node_api` for users.
- add documentation about api functions.
- remove `node_movement` module which should be done in user side.
2020-05-15 14:19:29 +02:00
kiyan42
45dcebb15f refacto/feat: better handling of parser updates
features:
- node_movement is moving between scopes.
- add selection initialization from normal mode
- add a decremental selection

improvements:
- attach to buffer to run tree parsing on change
- run state update on CursorMoved
- the buffer state is:
```
{
  cursor_pos = { row=row, col=col },
  current_node = node_under_cursor,
  selection = {
      range = nil, -- activates when starting a selection
      nodes = {} -- filling up when starting an incremental selection
  },
  parser = parser, -- parser for current buffer
}
```
- refacto all the modules reliant on parsing the tree, update the current nodes, get the current nodes...

fixes:
- fix has_parser to look for .so libraries
- fix should select the whole file when selection root in selection
2020-05-12 16:16:48 +02:00
Thomas Vigouroux
824b063d0d fix: change locals extraction 2020-05-07 14:03:29 +02:00
Thomas Vigouroux
5dc5695413 feat: support suggested highlights 2020-05-07 14:03:29 +02:00
Thomas Vigouroux
7682a1a49f feat: provide a statusline indicator
It will show the current branch at the cursor going the tree as such.
root->node->subnode->leaf

If an argument is provided to `statusline`, then the tree will be
truncated as follows :
..->subnode->subnode
2020-05-05 20:06:45 +02:00
Stephan Seitz
d0b84dd89f Add 'nvim-treesitter/node-movement' 2020-05-03 10:51:15 +02:00
Thomas Vigouroux
39da51bbd1 modules: move textobj to incremental_selection
As suggested in #37, rename the textobj module to incremental_selection.
Also adds a utility function to get the config of a module.
2020-05-02 13:29:40 +02:00
Kiyan Yazdani
34c0b0cccb
Merge pull request #36 from theHamsta/community-parsers
Add some more community parsers
2020-05-01 23:58:39 +02:00
Stephan Seitz
56f4aef198 Add some more community parsers
The haskell one really takes long to compile
2020-05-01 23:38:17 +02:00
kiyan42
dc06f9ea81 update docs for ensure installed, move modules config in config.modules 2020-05-01 12:26:57 +02:00
Stephan Seitz
0b4cdba3e4 Avoid global handle to enable installing multiple parsers in parallel 2020-05-01 12:16:00 +02:00
Stephan Seitz
fc88339832 Add ensure_installed option to config 2020-05-01 12:16:00 +02:00
Stephan Seitz
6b2d76153f Add function 'nvim-treesitter/install'.ensure_installed 2020-05-01 10:09:48 +02:00
kiyan42
f8029cfc64 fix install by changing cc arguments position 2020-04-27 15:27:59 +02:00
Thomas Vigouroux
ce690e550d health(refactor): move checks inside health.lua 2020-04-26 15:38:32 +02:00
Thomas Vigouroux
4d4e7d8a8c health: add highlight to healthchecks 2020-04-26 09:29:52 +02:00
Thomas Vigouroux
bb709aa8d0 refactor(textobj): remove unnecessary functions 2020-04-25 21:49:19 +02:00
Thomas Vigouroux
cadb3ee1ff refactor(textobj): use configs and don't use VimL 2020-04-25 21:46:22 +02:00
Thomas Vigouroux
7c7d4e5270 textobj: little refactor 2020-04-25 21:46:22 +02:00
Thomas Vigouroux
c62685841e textobj: add incremental scope selection 2020-04-25 21:46:22 +02:00
Thomas Vigouroux
78b40f895c textobj: add incremental node selection 2020-04-25 21:46:22 +02:00
kiyan42
f489b4b0a3 fix: config is enabled also checks parser existence 2020-04-25 16:18:53 +02:00
kiyan42
62786ec7c6 feat/refacto: improve configurations
- You should now get the configs through functions
- Configs for languages are now inside a local object called parsers
- You can get the parser installation configurations with `get_parser_configs`
- A new object has been initialized inside configs to specify module config (called config).
- Provide functions to enable/disable a module on one buffer
- Provide functions to enable/disable a module on all buffers, and if filetype is
  specified, for specific filetype
- Provide function to determine if module is activated for a specified filetype
2020-04-24 22:15:21 +02:00
haorenW1025
eb0f9b9e23 fix: add -fPIC flag to compiling 2020-04-23 13:48:20 +08:00
Thomas Vigouroux
f7424d23a1 highlight: retain highlighters with the buffers 2020-04-22 22:03:23 +02:00
Thomas Vigouroux
d05728e155 feat: syntax highlighting 2020-04-22 22:02:42 +02:00
kiyan42
62ce7744db feat/refacto: add configs.lua, setup install
- configs.lua holds the `repositories` data
- install health moved to health.lua
- plugins loads _root.setup() on startup
- install and list command are available through vim
> use them with `:TSInstall lang` and `:TSInstallInfo`
2020-04-21 23:40:23 +02:00
kiyan42
0a7f83830f fix: parser install tbl_flatten > unpack
- fix parser install
- format install.lua
2020-04-21 21:05:44 +02:00
Thomas Vigouroux
fbf6efd5b1
Merge pull request #11 from kyazdani42/parser-list
feat: add parser list
2020-04-21 20:14:41 +02:00
kiyan42
b4ca1c4f78 feat: add typescript install
- add repo.location for typescript and compile at that location
- typescript and tsx must be installed separately as two different
  parsers.
2020-04-21 19:28:23 +02:00
kiyan42
a7810728d2 refacto/feat: enable csharp install, fix clone
- clone only master at depth 1 to avoid long download from huge repos.
- use ft to specify folder name to clone so csharp can be cloned and
  used properly.
2020-04-21 19:10:01 +02:00
kiyan42
7e0b69d981 fix: repositories from M.repositories since last merge. 2020-04-21 18:37:03 +02:00
kiyan42
698453e50c feat: add checkhealth 2020-04-21 13:38:16 +02:00
Thomas Vigouroux
8b01b9caee
Merge pull request #10 from vigoux/feature/node-utils
Node manipulation utilities
2020-04-20 23:37:31 +02:00
kiyan42
0de42dd7fb feat: add parser list 2020-04-20 22:33:13 +02:00
Thomas Vigouroux
30b34fa505 feat: add node manipulation utils 2020-04-20 22:22:33 +02:00