Evergreen-lxl / Evergreen.lxl

🌳 Treesitter support for Lite XL.
MIT License
36 stars 7 forks source link

Switch to using plugin managers for installation of deps #61

Open xcb-xwii opened 6 months ago

xcb-xwii commented 6 months ago

The current installation system is alright, as no updates to deps have been pushed yet.

Looking ahead, it's obviously quite improbable that we will never have to push updates to parsers and tree-sitter bindings. Since LPM is coming along quite well, and @TorchedSammy has their own thing going on for plugin management, maybe we should just use plugins managers to manage the deps (instead of re-inventing the wheel when we inevitably have to solve this).

Then another problem is that due to how LPM works, updates to queries will lag behind quite a bit since they have to wait till a new release.

Anw brief outline of how we might do this:

  1. Add lua-tree-sitter to the lxl plugins repo (work is being done at https://github.com/xcb-xwii/lite-xl-tree-sitter)
  2. Make a plugin repo containing separate entries for pre-built binaries and ones that need compilation (keep evergreen-builds around for those who do not update)
  3. Probably move queries out of evergreen repo and into the parser repo so they can be updated separately too. Of course this would mean no language's queries are supported by default, but honestly if you're going to manually config a parser, you can acquire a query by yourself.

So basically:

Additional benefit is that this is more in line with how pragtical does things, so instead of having jgm doing his own thing to manage parsers and having to coordinate with us, we can directly provide for pragtical.

Of course the main problem here is that now we have a hard dep on some sort of plugin manager, which some people may not be willing to use. Hence I'm hesitant on doing any of this.

I guess we could just extend the current system so it handles updates to the ts dep, and then add an option to update all parsers or something so it's less painful to update each parser one by one.

xcb-xwii commented 6 months ago

@takase1121 thoughts maybe?

TorchedSammy commented 6 months ago

I don't mind a reliance on some plugin manager, as LPM is bundled with Lite XL (or will be? is that still the case?), and people who want to use Miq will already have it.

Probably move queries out of evergreen repo and into the parser repo so they can be updated separately too. Of course this would mean no language's queries are supported by default, but honestly if you're going to manually config a parser, you can acquire a query by yourself.

This is not really an issue considering parsers already have to be downloaded. Queries can also be downloaded in that step.

Separate pre-compiled and source pkgs for parsers, maybe like evergreen--bin and evergreen-

I don't think this is a needed separation.

I think using manifests and plugin managers for evergreen dependencies is a good idea. It actually doesn't add any requirement to evergreen for a plugin manager, as you can manually download everything if you wished, currently and if this change was done.

evergreen-builds already serves as a host for the parsers, setting up a manifest there shouldn't be too hard.

TorchedSammy commented 6 months ago

Also, what about #54?

xcb-xwii commented 6 months ago

I want to add #54's features, but they will have to wait. Like there really are a lot of things that need to be cleared up before making those changes, like the confusion between Language and Parser, which was caused by the API of ltreesitter (it cached both parsers and languages, which is problematic since parsers are stateful).

I think I would wait till after #61 is merged and a PR for the installation stuff is accepted. In fact I think the ideas from #54 should be included together with the PR for this issue, since both would require some changes to how we manage languages and parsers.

takase1121 commented 6 months ago

I don't think I can provide useful feedback since I haven't touched this repo for quite some time:

Add lua-tree-sitter to the lxl plugins repo (work is being done at https://github.com/xcb-xwii/lite-xl-tree-sitter)

This can be added as a library, so all language parsers can use it.

Make a plugin repo containing separate entries for pre-built binaries and ones that need compilation (keep evergreen-builds around for those who do not update)

I think this will only confuse people. The repo can contain the source and the compiled binaries, but I don't think separate packages are needed.

Probably move queries out of evergreen repo and into the parser repo so they can be updated separately too. Of course this would mean no language's queries are supported by default, but honestly if you're going to manually config a parser, you can acquire a query by yourself.

I think this is good. It doesn't necessarily mean that it doesn't come with language queries by default - you can always make lpm install some language parsers (I'm not sure if there is a way to do --install-optional).

For the other points I'm still quite confused (it has been a long time) since I haven't been involved in Lite XL (for quite some time). I don't see any "hard" dependencies on any plugin managers here; if required the plugin can keep it's current downloader and adopt plugin managers as an alternative (or a default if lpm is installed). There will be issues, but that should work to an extent.