Open jb-perrier opened 2 years ago
C3 used to have an AST printer, but such a format was more informative than intended for LSPs. It's also the concern that the AST is sometimes rewriting things from the concrete tree and as such might not correctly match the LSP output. But a starting point should probably be trying to create a LSP-format AST printing function.
The error can then be taken from the --test output. Create a --lsp mode similar to --test
--lsp
totally make sense to me. Are we talking about a binary format or smth like json ?
We can maybe use an option to output human readable JSON or a BSON if it's read by a third party program.
In case these formats are too heavy to parse we can write a specific binary format.
After some reflexion, we should probably not use lsp
because it means Language server protocol, it's a rpc json format that enable IDEs to query the language server about request like Go to definition, Completion, ect ..
Maybe something more simple like --ast
Atfer discord discussion, the --lsp
will take an LSP request in stdin
and respond to it, in the stdout
.
We will start by supporting very basic request.
What's the state of this?
Hi @lerno, i should have a branch somewhere with basic communication using lsp protocol. I will get back to you when i will find it !
Just found it : https://github.com/jb-perrier/c3c/tree/lsp Will put my head in it, i have more time now.
I'm looking forward to it!
Hi, any news on this? :eyes:
Hi, any news on this? 👀
Unfortunately no, i was just stuck to an issue i wasn't able to fix for some reason. I had to switch to other things.
Do you know what issue that was?
FYI there's a WIP language server implementation at https://github.com/pherrymason/c3-lsp. It was recently updated with the stdlib for 0.6.0.
Having a language server for all famous IDE is a key step for spreading C3 into the programming world.
This issue will enable us to track the needs, how it can be done and anything related to this subject.
For now,
--test
mode enable us to get error reports, in order to have auto completion and any feature AST related we need to access the AST generated in parsing part of c3c.Few solutions comes to my mind rn:
Feels free to express your ideas below.