3 ms·
Moreover, it's not just stupid, it also does not actually solve _anything_. A synchronous function can also have obsolete indexing information if it races with
by cyberax 7d ago
Moreover, it's not just stupid, it also does not actually solve _anything_.
A synchronous function can also have obsolete indexing information if it races with the code updates.
- mitxela 7d agoBut it doesn't have to, because you call AboutToUpdateCode and the LSP doesn't return until it's safe, and then you update code and call DoneUpdatingCode.
- cyberax 7d agoYes, it does because the physical code update is asynchronous. Or you'd have to do a roundtrip for every little edit, resulting in unusably slow experience.
- mitxela 7d agoI don't know what you're talking about. What is "physical code"? A function call roundtrip costs nothing, that's the reason we are saying it should be function calls.
- cyberax 6d agoTCP roundtrip overhead over localhost costs approximately nothing. But running the LSP itself is slow. It's not instant, and you can't run it in a blocking way for each keypress.
- mitxela 6d agoA function call costs nanoseconds. You can sprinkle them literally everywhere. A JSON-formatted TCP round trip to localhost costs, I'd guess conservatively, at least ten microseconds, 1000x slower.
- cyberax 6d agoOK. Here's my simple implementation of an LSP: > func doLspStuff() { sleep(60000); } Now sprinkle them after each keypress. Do you see the issue now?