Show HN: Create a full language server in Go with 3.17 spec support
github.com
github.com
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 ..)
Language servers are cool!
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?
If its a straight error, then the error response is returned and we're all happy!
If the handler panics, the server crashes, so that's something I'm off to fix now!
Thanks!!!!
- Makefile: https://github.com/owenrumney/make-ls
- Goreleaser: https://github.com/owenrumney/goreleaser-ls
Another time I used one to make the hosts in my SSH configuration file clickable to either open a terminal with a session or just to display cpu/memory statistics.
Lots of neat editor-independent interactions can be enabled using language servers.
I've now started a Makefile lsp since you've inspired me to think about the painful scenarios that LSP can solve if I think a bit wider.
Cheers for that!!
Thankfully, I finally had a reason to build an LSP (infracost LSP), so it motivated this and I'm really pleased with it
// DiagnosticSeverity indicates the severity of a diagnostic.
type DiagnosticSeverity int
Hmmm :robot:In https://go.dev/doc/comment it seems to be a convention, but there are a couple of examples there where the don't follow it.
If you add one, at least make the effort to provide some useful information. For example which is more severe: higher or lower numbers.