7 ms·
Language Server Protocol
- Edmond 10y agoThis is great! Abstracting away static code analysis is very helpful for people like us building browser based dev tools. 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.
- Eridrus 10y agoI'm on the fence about this, standardization let's people pool resources to provide common functionality, but it also ossifies the interface so that doing anything not supported by the interface becomes harder than before. 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.
- hitr 10y agoWith this,a new language can have an IDE integration done easily which can cover say 95% features. Some language specific feature may be obviously left out but getting a minimum viable integration to any supported IDE is a good thing.May be when this protocol evolves,it can give extension to the protocols to cover the other 5% features(or may be it is already there)
- avita1 10y agoAre there any examples of extensible protocols like this in the wild? I'm asking because the only such protocol that seems to get mentioned on HN is XMPP (and always with groans).
- deleted 10y ago[deleted]
- Eridrus 10y agoHeh. We'll see. Writing the glue code is not what makes writing language analysis hard. This is clearly a move to make the lives of IDE writers easier, rather than those who would be writing the analysis code.
- euyyn 10y agoBut it'd make your analysis code work for multiple IDEs and editors instead of having to learn about each's peculiarities. One less thing to worry about is always good.
- deleted 10y ago[deleted]
- riffraff 10y agowouldn't inferred types fit into the "Diagnostic" interface? There are both "info" and "hint" levels which seem appropriate. (I don't disagree with your general point, just curious about this specific example)
- Eridrus 10y agoSort of; the hover interface helps, but I would prefer it if the IDE showed it as if it was written there explicitly, not just when you hover over it. Which requires explicit UI work, which this protocol won't support.
- eatonphil 10y agoDoes anyone know what tool was used to create that diagram?
- lttlrck 10y agoThe blues look like a PowerPoint theme. You might like http://blockdiag.com/en/seqdiag/index.html http://blockdiag.com/en/seqdiag/index.html
- danlindley 10y agoThere are many ways to go about, but it could be easily achieved with any diagramming or graphics application. For example, LibreOffice Draw or Microsoft Visio.
- WorldMaker 10y agoMy first guess is Visio. (Followed by Excel, PowerPoint, or Word.)
- IshKebab 10y agoNo idea, but if you want to make similar diagrams I recommend PlantUML. Default colours suck a bit but they are easy to change.
- rkangel 10y agoI very much doubt it was used in this case, but https://www.websequencediagrams.com/ https://www.websequencediagrams.com/ is great if you want to do Message Sequence Charts.
- qwertyuiop924 10y agoWell, us emacs users will finally get some decent autocomplete. So that's nice, I suppose. This actually sounds an awful lot like what Grok was trying to do. Any relation in the development?
- lann 10y agoSee Kythe (Google OSS): http://kythe.io/ http://kythe.io/
- qwertyuiop924 10y agoHeh. Neat.
- falcolas 10y agoI only glanced through the document, but I didn't see anything which could verify that the "Tool" and the "Language Server" are both referring to the same content. Is there a mechanism for handling this kind of synchronization drift?
- icholy 10y agoSee TextDocumentSyncKind and TextDocumentItem.
- protomyth 10y agoWhat happens when I don't have internet access? Do I install a second piece of software on by box?
- killercup 10y agoThe "server" in "language server" does not mean "server you access over the network" but "other process (on your machine) your editor talks to". (This is just the spec for a protocol.)
- protomyth 10y agoCan it be on across the internet? So, Apple can or cannot set up an internet service for Swift? If I think I have a better version can I point my editor towards that? If I program in a couple of languages, do I need to get ahold of servers to install?
- Arcsech 10y agoTo answer your points in order: No reason it couldn't talk across the Internet, I guess, if you're comfortable sending your source code to whoever is running the server and dealing with network latency on your autocomplete. Yes, you could easily point your editor to a different server, this protocol is basically just an API spec. And lastly, yes, you would (likely) need a different server for each of your languages - this project just provides a way to let an IDE implement one API client that can be used with each different language's tools.
- protomyth 10y ago> To answer your points in order: No reason it couldn't talk across the Internet, I guess, if you're comfortable sending your source code to whoever is running the server and dealing with network latency on your autocomplete. I'm thinking as part of a remote learning class. I'm pretty comfortable that it wouldn't violate any student privacy rules.
- Etzos 10y ago
- jntrnr 10y agoWe're considering moving the new Rust language service over to this protocol, or possibly, having it as a default protocol while supporting other protocols. 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.
- sctb 10y agoPrevious discussion: https://news.ycombinator.com/item?id=11988446 https://news.ycombinator.com/item?id=11988446