6 ms·
The LSP space is super interesting right now. Looking forward to diving deeper into/trying this!
by paranoidxprod 2y ago
The LSP space is super interesting right now. Looking forward to diving deeper into/trying this!
- meiraleal 2y agoThe specification is so huge and complex. I was interested for a while but that faded fast when I started to dig into it. Also no browser-only support made it a no-go for me. Although I have seem a few cool hacks to run it in a webworker.
- ivanjermakov 2y agoLSP server does not have to implement all of the spec to be useful. Just using document change and diagnostics allows to implement basic linter or spell checker. I can recommend a nice video series on implementing LSP from scratch: https://youtube.com/playlist?list=PLq5tGLDKHlW9XKRj5-plHdvbkT5AOdM7-&si=6r1WkhasHJJ3FkCg https://youtube.com/playlist?list=PLq5tGLDKHlW9XKRj5-plHdvbk...
- kristoff_it 2y agoYep, the LSP mentioned in the blog post (I'm the author) only implements diagnostics and autoformatting for now. With just that you can already provide a lot of utility. This is my starting point for implementing language servers in Zig: https://github.com/kristoff-it/zig-lsp-kit https://github.com/kristoff-it/zig-lsp-kit
- duped 2y agoWhat does 'browser only' support mean?
- meiraleal 2y agoVSCode needs a server, LSP runs in that server.
- duped 2y agoIt doesn't actually, the "server" can (and in many cases does) run in the JS event loop. Do you want the protocol to specify that language servers are able to run in a browser? Because that's very outside the scope of the protocol, which doesn't constrain the client or server implementations. LSP doesn't define the transport layer between them, just that they should use JSON RPC.
- meiraleal 2y ago> It doesn't actually, the "server" can (and in many cases does) run in the JS event loop. Yeah I know it is possible, just not trivial. So for me it was more complex to implement it in the browser than just create a simpler tree-sitter.
- duped 2y agoLSP and tree-sitter solve different problems and aren't interchangeable, it sounds like you were trying to pound a square peg into a round hole. LSP doesn't (nor can it) specify anything that would make your life easier to use a language server in the browser. There are editors that provide clients and language servers written in JS, though.
- kristoff_it 2y agoI just tested SuperHTML with GitHub Codespaces and it works https://twitter.com/croloris/status/1835701531200418122 https://twitter.com/croloris/status/1835701531200418122