Language Server Protocol
github.com
github.com
The first thing that pops into my head is that for languages with interprocedural type inference, I really want my IDE to show me what types it has inferred, but this is outside the spec and not even applicable to all languages.
(I don't disagree with your general point, just curious about this specific example)
Which requires explicit UI work, which this protocol won't support.
Since I've been learning it recently, maybe some points to help understand it:
It's just the protocol piece. Currently, VSCode will stand up the language server and communicate using the protocol over stdin/stdout. Nothing to say they couldn't support http servers in the future, but currently it seems lower level that that.
They do support hovers, which you can use for seemingly anything. We currently are using them for type information and showing API docs.
I'm hoping this takes on with other editors, as once they support it, then they'll get the stronger language support the servers provide, which can do hovers, on-the-fly error checking, code navigation, and more. It's not perfect, but as a baseline set of features, it's a pretty good starting set.
I am the developer of HiveMind (crudzilla.com), I have been dragging my feet about plunging into static code analysis so this type of solution is definitely intriguing.
This actually sounds an awful lot like what Grok was trying to do. Any relation in the development?
I'm thinking as part of a remote learning class. I'm pretty comfortable that it wouldn't violate any student privacy rules.
In theory, yes the protocol can be used across the internet, but that would raise plenty of issues (security being a huge one). This is designed so that any program, like an IDE, can get code analysis and more without having to build special handling for each of them.
> So, Apple can or cannot set up an internet service for Swift?
Again, in theory they could. But why would they do that? Just run the server locally and get all the information there.
> If I think I have a better version can I point my editor towards that?
Yes. You simply stop the currently running language server and start the one you want to use instead.
> If I program in a couple of languages, do I need to get ahold of servers to install?
Yes. Each language would, in theory, provide its own server to do analysis. Of course, your favorite IDE would likely be more than happy to start the server for you if it's not running yet (as it's just a small process that runs in the background).
If you want to see how this works in practice just grab Visual Studio Code and start editing a Typescript file. This is already in use there.
I'm pretty sure I would be ok at part of teaching a class.
> Again, in theory they could. But why would they do that? Just run the server locally and get all the information there.
I was getting at that from the student-level. I'm pretty sure some metrics on edge problems in a remote learning class might help with the material revisions.