News for hackers. Stuff that matters.
Re:The First HTML LSP That Reports Syntax Errors by meiraleal on Monday September 16, 2024 @11:22AM (#41556988)
VSCode needs a server, LSP runs in that server.
Re:The First HTML LSP That Reports Syntax Errors by duped on Monday September 16, 2024 @11:33AM (#41557097)
It 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.

Re:The First HTML LSP That Reports Syntax Errors by meiraleal on Monday September 16, 2024 @12:25PM (#41557741)
> 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.

Re:The First HTML LSP That Reports Syntax Errors by duped on Monday September 16, 2024 @01:35PM (#41558451)
LSP 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.