jfecher / ante

A safe, easy systems language
http://antelang.org
MIT License
1.9k stars 80 forks source link

Create a LSP server for Ante #179

Closed jfecher closed 2 months ago

jfecher commented 9 months ago

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.

ehllie commented 9 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?

jfecher commented 9 months ago

@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.

ehllie commented 9 months ago

I've noticed a couple things that would need to be done for the language server to be effective:

jfecher commented 2 months ago

I'm going to close this issue since most items are completed. I'll break out go to declaration into another issue