Closed jfecher closed 2 months ago
Should that be done inside this repository as a separate workspace, or would you prefer having the language server in a separate repository completely? In terms of implementing the language server, I think using tower-lsp
and the tower-lsp-boilerplate
should offer the quickest way to get a functional language server. Are you ok with using a library like that to abstract the lower levels of the language server protocol?
@ehllie I think a separate repository might be best. I'm absolutely in favor of using any libraries for the LSP to make things easier. You can take a look at https://github.com/jfecher/ante-lsp for a possible good starting point (and place to merge things into). It uses tower-lsp and was forked from the boilerplate repo. I haven't looked at it in a while though so I doubt it's in a working state.
I've noticed a couple things that would need to be done for the language server to be effective:
unsafe impl Send for ...
lines? They are marked with a comment saying TODO: Remove
, and it's usually not the best idea to lie to the compiler 😛. Not sure how much of an issue it could be though. I'm going to close this issue since most items are completed. I'll break out go to declaration into another issue
Ante needs a Language Server Protocol server to give errors and warnings as users write their programs in LSP compatible editors.
This is obviously quite a large task so it can be broken up into as many smaller tasks as desired. Here's some examples:
To limit scope somewhat, I can help with any changes needed in the compiler. I also think the LSP's design should start as simple as possible, e.g. only updating when a file is saved to avoid worrying about partially correct programs for now. Ante's current parser is not recoverable so it will not work well on partial files.