|
|
|
|
|
by paxys
817 days ago
|
|
That's because the LSP makes no assumptions about stuff like (1) what the language server is, (2) how it is launched and managed, (3) how the editor communicates with it, etc. It only defines the format of the communication, nothing else. In the simplest form the entire language extension in VS Code can be ~15 lines of code that forks the server process and talks with it over stdio. But in complex cases you can: - Write the entire language server in the extension itself. - Have your code hosted on a different machine or Docker container. - Run the editor in a browser and get language support though a service worker or a TCP connection to a remote server. LSP supports all of this seamlessly because it is agnostic about the transport layer. |
|
(even this association could be done with a local DB similar to mime types if we wanted to simplify)