Commit graph

10 commits

Author SHA1 Message Date
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
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
0de42dd7fb feat: add parser list 2020-04-20 22:33:13 +02:00
Thomas Vigouroux
d25549917d perf: don't compute locals on buffer updates
Instead we lazily evaluate them on request.
This allow two things :
    * better performances
    * being sure the locas are up to date
2020-04-19 20:16:03 +02:00
Thomas Vigouroux
b2b6e51a7c feat: add locals to setup procedure 2020-04-19 17:28:59 +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