lexical-lsp / lexical

Lexical is a next-generation elixir language server
892 stars 82 forks source link

Plugins: Completion Candidates #232

Open scohen opened 1 year ago

scohen commented 1 year ago

Examines a document and a position and offers completion candidates based on what it finds.

Runs in the remote control app.

moissela commented 9 months ago

Hi @scohen , I'm interested in contributing to and sponsoring your LS, and I would like to know more about the development status of the autocompletion's plugins and whether there is a way to contribute to their development. I've already had the chance to try out the plugin for Credo, and it works very well! In our company we make extensive use of the Ash framework, of which we are sponsors, and I would like to contribute to the development of a plugin to integrate Ash generated DSL for autocompletion through Lexical, in a similar manner as Ash integrate ElixirLS through ElixirSense. I think it would take a great traction on your project among Ash framework's users with a similar plugin, and specifically, it's the last thing holding us back from switching to Lexical from ElixirLS 😅

scohen commented 8 months ago

@moissela I haven't given much development time to plugins, so they're a bit of an unsolved problem, though the use case you're suggesting is exactly why they should exist. The issue I see right now is how to maintain some kind of version compatibility across releases of plugins, and releases of elixir. This is one of those non-fun computer science problems. Because of this, I think it might be better to start building inside of lexical, and then, when there's a foundation, expose it via plugins.

With respect to Ash, it makes extremely heavy use of macros, which I honestly don't know how to deal with right now. Lexical takes a code-reading approach for a lot of its heavy lifting, but this will fail in the face of ash-like macros, we need a new approach for that kind of thing, and it requires some thought. If you have ideas, I'd like to hear them.