mighty-gerbils / gerbil

Gerbil Scheme
https://cons.io
GNU Lesser General Public License v2.1
1.15k stars 110 forks source link

Gerbil LSP server #781

Open vyzo opened 1 year ago

vyzo commented 1 year ago

We want to implement a Gerbil server speaking the LSP protocol; this will bring first class Gerbil support to editors other than emacs, but also improve emacs integration as modern emacs has pretty good support for it.

There is funding available for this project.

chiefnoah commented 6 months ago

Some notes on work for the

MVP LSP features:

This is a non-exhaustive list of features. The requisite requests are broken out below and linked back to the spec. There may be some implicit dependencies that are missed, so refer to prior art and the LSP documentation for authoritative information.

Goto

This feature is basically the same functionality as covered by TAGS.

There are 4 different types of navigational gotos:

The LSP must declare the linkSupport capability (textDocument.declaration.linkSupport).

We can likely get away with simple a "go to symbol definition" for now, which should be implemented using the Goto definition request.

Autocomplete

textDocument/completion

The client will send a completion request with the LSP responding with appropriate suggestions.

It does not appear to be necessary, but implementing Completion Item Resolve Requst is likely a good idea as well.

Find References

Find references is simple and is implemented with the Find Reference Request

Hover documentation

This is typically used to show documentation and signatures. The output is arbitrary "helpful" text. MVP is to show the signature, but with the @doc macro, documentation should be resolved and returned as well.

One thing to note, I believe #815 is a requirement for getting this working, I'm not sure where that stands.

metaleap commented 3 months ago

Currently iterating on the LSP as (temporarily) a standalone program, continued from @belmarca's gxlsp.ss, to then be brought back in to the lsp branch after a couple real actual feature impl's.

Since src/tools has plenty other programs, the bulk of this will probably go in std/ide/lsp as #1226 hinted at. Because I imagine building code under std/ might be somewhat slow, I went for the above standalone program for now to iterate on functionality and scaffold / stub things out near-fully.