The strip! directive is implemented in the tree-sitter tags crate in
the main tree-sitter repo
(de53b82e2c/tags/src/lib.rs (L167)).
It is used specifically for tag extraction to shrink the range of a node
(or better the text of a node).
For our textobjects queries the strip! directive might be use full since
it allows us to strip aways whitespaces and leading/trailing characters.
- add sync method for installing using `system`
- remove `descriptions` in command configs
- use install(lang) in ensure_installed and make it compatible
- 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`
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.
- 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.
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
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