Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Extract LSP protocol to a shard? #157

Closed
asterite opened this issue Jul 12, 2019 · 2 comments
Closed

Extract LSP protocol to a shard? #157

asterite opened this issue Jul 12, 2019 · 2 comments

Comments

@asterite
Copy link

asterite commented Jul 12, 2019

Hi!

I'd like to try my hands on building an LSP server implementation using the knowledge I have about the compiler. I thought about contributing to this project but for me it might be easier to start from scratch because of some ideas I have (I plan on reusing the top-level semantic pass of the compiler, which doesn't seem to be used here).

To do that it seems the first step for me is to define all the boilerplate for the language server protocol. And that seems to be here! But it's embedded in scry's source code...

Do you think there's a chance the protocol can be extracted to its own shard? Then we don't have to repeat the protocol in every attempt at a language server. I see there's https://github.com/crystal-lang-tools/lsp but it seems undocumented and with many TODOs so I'm not confident about it.

I'm also thinking maybe the shard could have a way to easily use it so all you have do to is do something like LSP.start(listener) and listener would be some class where you have to implement some methods, one for each message/notification you can get from the language server client. I think that would also simplify the source code of scry.

What do you think? And also let me know how can I help accomplishing that.

@asterite
Copy link
Author

I also found this: https://github.com/jemc/mare/tree/master/lib/lsp , so it seems LSP is already repeated in several places... it would be great to unify all of that!

@dnamsons
Copy link
Contributor

dnamsons commented Sep 1, 2019

Hey @asterite

There was already a similar issue on this(#111), so I just went ahead and made a PR for this

The LSP shard you mentioned was made for the very purpose of extracting the LSP protocol code from Scry(as far as i understand from the aforementioned issue)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants