Show HN: Create a full language server in Go with 3.17 spec support (github.com)

by rumno0 18 comments 93 points
Read article View on HN

18 comments

[−] bbkane 48d ago
Started in case I ever build a language server, thanks! The interface looks very understandable, and the debug server looks really nice.

Now that I think about it, it might be really cool to add LSP to my CLI framework[0] (I already have tab completion for shells, why not make an editor plugin if it's this easy ..)

0: https://github.com/bbkane/warg

[−] pmoati 47d ago
I really like the interface-based auto-registration pattern, so elegeant!

The implementation of HoverHandler seems clever... no manual wiring. That's the kind of API design that makes Go's implicit interfaces shine.

I'm curious: How does error recovery work when a handler panics? Does the server keep the connection alive, or does it tear down?

[−] rumno0 42d ago
Just to show what it can do, some language servers built with it

- Makefile: https://github.com/owenrumney/make-ls

- Goreleaser: https://github.com/owenrumney/goreleaser-ls

[−] Myzel394 47d ago
Have you tried out https://github.com/tliron/glsp?
[−] SwiftyBug 48d ago
Very nice. Now I want to build a language server. If only I had anything to build it for.