Commit graph

6 commits

Author SHA1 Message Date
Thomas Vigouroux
b2b6e51a7c feat: add locals to setup procedure 2020-04-19 17:28:59 +02:00
Thomas Vigouroux
b706c4e8ed feat: first version of locals
Locals will be the main interface to treesitter, through some functions:
    get_definitions(bufnr) : returns all the definitions in bufnr
    get_scopes(bufnr): returns all definitions in bufnr
    get_references(bufnr): returns all references in bufnr
2020-04-19 17:28:52 +02:00
kiyan42
2967ca5203 add parser installer 2020-04-19 15:13:38 +02:00
Thomas Vigouroux
2526baf4cc feat: add parsers module and better match iter
The `parsers` module manages parsers for us, for now only in a really
basic way.

iter_prepared_mathes iters on an enhanced versions of the matches, where
captures are directly accessible via their names to allow things like :
    ((itentifier) @def.first (identifier) @def.last)
To be handled like this in lua:
    match.def.first
    match.def.last

Also adds a `set!` predicate to allow setting data within the prepared
match (see queries/lua/locals.scm) for examples.
2020-04-19 09:45:54 +02:00
Thomas Vigouroux
5897d72b07 feat: add empty setup function
Will be used later to setup everything so that a language works properly
in each situation.
2020-04-18 19:32:51 +02:00
Thomas Vigouroux
e51b25dce2 feat: add some utils to read queries 2020-04-18 17:40:26 +02:00