7 ms·
I am in love with language servers, the quality of life improvement is just unreal.
by grenoire 5y ago
I am in love with language servers, the quality of life improvement is just unreal.
- 5e92cb50239222b 5y agoWait until you try a fully featured "real" IDE. The features language servers provide are only some of the many things that IDE users have had for literally decades.
- grenoire 5y agoI'm old enough to have used IDEs, the issue is that my job involves dealing with multiple different languages and markup files. In turn, a general purpose editor with language servers just suits my workflow better.
- smw 5y agoTry a jetbrains ide? They handle pretty much any language you can think of, including fun things like lua with ERB substitutions.
- square_usual 5y agoYeah, IntelliJ Ultimate with plugins gets pretty close to VSCode in terms of language support.
- riffraff 5y agosurely any decent IDE will handle that nicely? I used to work with Eclipse and it supported everything* through plugins just nicely. * ..that I was using at the time: java, xml, python, html, jsp, javascript
- Lio 5y agoCould you provide some concrete examples? I ask because modern editors can do most things people often regard as IDE only but there is still the odd gem that’s worth hearing about.
- sa46 5y agoI'm not familiar with state of the art for language servers but here's common IntelliJ refactors I use across Go and TypeScript (and Java a while ago): - Add a parameter to a method signature and fill it in with a default value. - Reorder method parameters. - Extract a block of code to a method that infers the correct input and output types. The most advanced refactoring I've done with IntelliJ is structural replace for Java which can do something like: for every private method matching the name "*DoThing" defined on a class that extends Foo, insert a log line at the beginning of the method: https://www.jetbrains.com/help/idea/structural-search-and-replace.html https://www.jetbrains.com/help/idea/structural-search-and-re... I make heavy use of the "integrated" aspect of IntelliJ. One of the nicer benefits is that SQL strings are type-checked against a database schema.
- bestouff 5y agoAll of these are doable with LSP. I'm a big fan of the "LSP rename" action which will rename a particular semantic item (e.g. a method) across files, or the refactoring actions (e.g. change an "if let" into a "match" in Rust).
- jen20 5y agoDo you have an example of a language server capable of structural refactoring of the type mentioned in the GP? The “semantic rename” is table stakes from ~20 years ago in IntelliJ and ReSharper, and even Eclipse.
- unrealhoang 5y agoStructural refactoring as in extract function/variable? You can find that in Rust Analyzer https://rust-analyzer.github.io/manual.html#assists-code-actions https://rust-analyzer.github.io/manual.html#assists-code-act...
- Measter 5y agoRust Analyzer can do structural search and replace [0], though I've never used it nor IntelliJ's so I can't compare how capable both features are. [0] https://rust-analyzer.github.io/manual.html#structural-search-and-replace https://rust-analyzer.github.io/manual.html#structural-searc...
- aidos 5y agoSure, but a lot of us don’t like that extra overhead. LSP is great in that it’s a tool you can tap into to use in a workflow that’s best for you. More of a library than an application (not technically, but in terms of how you use it).
- omnicognate 5y agoIt's kind of hilarious that programmers, who learn again and again the value of decoupling and cohesion, fell so hard for the idea of an Integrated Development Environment. There's nothing about syntactic/semantic code analysis, to pick one example, that requires it to be packaged along with a particular text editor in a single big blob. Ironically, the most successful IDEs today, the Jetbrains ones, are demonstrations of this. They are built out of reusable components that are combined to produce a wide range of IDEs for different languages. LSP and DAP aren't perfect, but they're a huge step in the right direction. There's no reason people shouldn't be able to use the editor of their choice along with common tooling for different languages. The fact that IDEs had (for a while) better autocomplete, for example, than emacs wasn't because of some inherent advantage an IDE has over an editor. It's because the people that wrote the language analysis tools behind that autocomplete facility deliberately chose to package them in such a way that they could only be used with one blessed editor. It's great to see the fight back against that, and especially so to see Microsoft (of all people) embracing it with LSP, Roslyn, etc.
- gmueckl 5y agoThe technical design isn't the user experience. IDEs are an integrated user experience. It literally doesn't matter to the user how nicely decoupled everything is or isn't under the hood if the end results are indistinguishable. One point in favor of tight integration and against LSPs is that editing programs isn't like editing unstructured text at all and shouldn't be presented as such. There are tons of ways in which the IDE UX can be enhanced using syntactic and semantic knowledge of programs. Having a limited and standardized interface between the UI and a module providing semantic information will just hamper such innovation.
- spinningslate 5y ago>Having a limited and standardized interface between the UI and a module providing semantic information will just hamper such innovation. Maybe. That can certainly be a downside of standardisation in general. However, it doesn't necessarily follow in all cases, and this is, I think, one where it doesn't. The features LSP provides are stable - and have been standard across most editors/IDEs for quite some time. Implementing them once for N editors, rather than N times, is just far more approachable (and appealing) for language tooling developers. It doesn't stop those developers (or anyone else) adding features beyond the LSP standard. But that means doing it in an editor-specific way. Which is no worse than where we were before anyway.
- mickeyp 5y agoIt's hard for an open source community to build features that compete with a commercial offering like that of Microsoft (or Borland in the 90s.) And the reason for that is mostly down to fragmentation: the vim guys are doing their thing; the Emacs theirs, etc. Now focus that energy into a singular project like a Language Server and the payout is likely to be many orders of magnitude greater.
- rowanG077 5y agoI have not ever had a good experience with an IDE. They are always bloated messes that try to force you into their shitty project structure.
- tapia 5y agoFor me, there is no IDE feature that can compete with the experience of editing in vim/neovim. When I use any other editor I just feel like I have a hand tied. The development of LSP and tree-sitter just makes the whole experience even better.
- nick_ 5y agoLSP is just a generalization of the implementations IDEs have had for decades.
- IshKebab 5y agoVSCode is a "real" IDE. > The features language servers provide are only some of the many things that IDE users have had for literally decades. Yes of course, because that's what they were explicitly designed to do. The novel thing about language servers isn't that they enable code intelligence features like auto-complete and variable renaming. It's that they do so over a standard protocol that any editor or IDE (or website or CI system or ...) can use.
- Epitom3 5y ago"Hey I use an IDE, im special"