Once you get past that, JSON-over-TCP is just another kind of asynchronous RPC mechanism, one that has the advantage that you can build it in just about any language with out-of-the-box tools. Trying to make a plugin system or a COM or CORBA or OLE based system really cuts out the ability to build language servers in most languages, because you have to be able to build the code in just the right way.
I can almost guarantee you that a synchronous API would yield a much more complicated design just because many operations can not be expected to reliably work within a few milliseconds.
You want to rename something across multiple files? Well now you add file system overhead and blow straight past reliable frame timings. Good luck waiting for that operation to finish. Of course you could make the API beginRename, and queryRename, or whatever you fancy to see if the operation was successful, but now you're back to what you wanted to avoid: an asynchronous API. Do mind that the example is actually one of the better cases, as many things you might want to do with a codebase are actually more expensive. You will feel the hiccups from waiting in the UI thread and you will loathe the program for it.
Would you write your editor that way if it didn't use LSP but was specific to one language? If not, but you would write it that way with a language plugin, why? You still have to write a good product. You can't blame the plugin API for everything you get wrong.
In no way does this mean LSP is a perfect solution, but anything synchronous would be a step backwards.
Parallel to that, IBM had SOM on OS/2, which was even better allowing for metaclasses and proper class inheritance, it was the key mechanism between Smalltalk and C++ on OS/2, where Smalltalk enjoyed a role similar to .NET on Windows nowadays.
OLE naturally still exists when using Office natively on Windows, other vendors seem to have forgotten about it.
COM's role on Windows has grown since Vista, and the Windows team redid many of the Longhorn ideas originally implemented in .NET into COM/C++, with WinRT being an evolution of COM.
Interesting to complain about one and then ignore exactly the same boilerplate for the other.
Leaving aside the fact that Microsoft's tooling for COM has already had multiple reboots between VB OCX, MFC, .NET Framework RCW/CCW, .NET ComWrappers, ATL, WRL, WIL, WinRT, each one with its share of astronomy.
No one uses the bare bones vtbl and nothing else.
Everything uses the bare bones vtbl. That's how there can be so many things, they're all using the bare bones vtbl. Obviously there's application specific stuff as well because a bare bones vtbl is not useful by itself but that's like saying if TCP is so good why is there HTTP?
The point being that beyond the plain vtbl, SOM was much better designed than COM, in the sense of overall architecture for application development.
A synchronous function can also have obsolete indexing information if it races with the code updates.
But running the LSP itself is slow. It's not instant, and you can't run it in a blocking way for each keypress.
> func doLspStuff() { sleep(60000); }
Now sprinkle them after each keypress. Do you see the issue now?
So the LSP crashes and/or goes into a runaway memory consumption loop. And your main application dies with it.
Or what if you want, you know, to be able to use the same LSP from TWO different applications at the same time?
Never mind issues with other managed runtimes not expecting to deal with something else in their address space.
LSP is a function call protocol. So that is already done?