Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wait 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.


It'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.


The 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.


The user experience is entirely determined by the technical design. The difference between emacs or vim and the editor built into say Visual Studio is enormous, and if a developer is prevented from using the former (if that's what they're comfortable with) alongside the language analysis capabilities of the latter, that has a huge impact on the user's experience.

It's true that if you own both the editor and the language analysis tools you can more rapidly add new capabilities, but many facilities that were historically the domain of IDEs, such as autocomplete, are very easy to standardise an interface for, and this has been done. Supporting such interfaces doesn't prevent you from also supporting nonstandard/internal interfaces for more cutting-edge capabilities. The argument made by Jetbrains is similar to the one you've made and it's entirely false. They could easily support LSP and it would have no impact on their ability to innovate. They refuse to do so for purely business reasons (as is their right).

Editing instead of replying as the depth limit is reached (bad form, perhaps, but gmueckl's reply is in the form of a question and I'd like to respond): The necessary UI capabilities for the features you describe already exist in emacs. Multiple alternative implementations of them, actually (lsp-mode vs eglot). It's the editor's job to provide the UI and the LSP server's job to provide the backend. The interface between them is easy to standardise and it has been done (yes, even for the features you mention).


For example, how do you use a feature like "Navigate to derived symbols" without the required UI integration (prompt for which derived symbol to go to, opening up the correct code location...)? How do you define an "Extract interface" or "Extract base class" refactoring (name of new class/interface, members to extract, abstract or not...)? There are tons of UX aspects to good code navigation and refactoring. In order to get the equivalent of the feature set of, say, Resharper into vi or emacs, you'd have to add tons of new UI stuff. And once you do that, you are back to pretty tight coupling.


The necessary UI capabilities for the features you describe already exist in emacs. Multiple alternative implementations of them, actually (lsp-mode vs eglot). It's the editor's job to provide the UI and the LSP server's job to provide the backend. The interface between them is easy to standardise and it has been done (yes, even for the features you mention).

(Seems I can reply after all so have done so, and now I appear unable to edit the GP and remove the text above from it :-/)


How does emacs display a dialog where you can select all the methods to select along with some additional UI elements for extra options?


Emacs can be described as an interactive, lisp-based environment for building textual UIs (TUIs). It's very easy to extend it with arbitrary, dynamic behaviours, including ones that need to collect information from the user.

As a trivial example, let's say for some reason I keep needing to generate the sha256 hash of a password and add it to the current file. I could add this to my .emacs:

    (defun my-insert-password-hash (password)
      (interactive "MPassword: ")
      (insert (secure-hash 'sha256 password)))

    (global-set-key (kbd "C-c p h") 'my-insert-password-hash)
Now if I hit Ctrl-C followed by p then h I will be prompted for a password in the minibuffer and the hash of the string I provide will be added where my cursor is. I didn't need to write any GUI code.

This kind of user interaction can equally easily allow the user to select from lists of dynamically determined options, including very large ones (with nice fuzzy matching menus if you use ivy, helm or similar). It's also trivial to write functions that prompt for several pieces of information, ask for different information depending on context, etc.

In the case of LSP, the server only has to provide information about what options are available and what possible responses are permitted. It's easy for emacs to dynamically provide the corresponding UI.


Ok, so you're not pointing to an implementation of the feature that I asked about. Instead, you're asking me to implement it as a special case. That's backwards.

You're effectively confirming that there needs to be feature-specific integration code for each and every navigation/refactoring/... feature in the editor. Once you have that, you again have tight coupling.


Not at all. The server allows for discovery of code actions and their parameters and the UI is displayed in response, by code that knows nothing about particular actions. It goes something like this (won't be accurate in the details, check the lsp spec [1] under Code Action Request if you want chapter and verse):

User to emacs: I want to perform a code action.

Emacs to server: The selection is this. What code actions can you perform?

Server to emacs: I can perform actions called "Extract Method", "Extract Base Class", etc.

Emacs to user: Choose an action from this list

User to emacs: I'll do "Extract method"

Emacs to server: We're going with "Extract Method", what info do you need.

Server to emacs: I need an item called "method name" which is a string and an item called "visibility", which is one of the following: "public", "private", "protected".

Emacs to user: Enter method name... Select visibility...

Emacs to server: Here are the parameter values.

Server: Here are the edits necessary to perform the code action

Emacs: Updates code.

No special per-action code is required. If you want to see an implementation have a look at lsp-mode[2].

I hope that makes it clear. I've spent more of my day explaining this than I should have now, so I'll leave it there.

[1] https://microsoft.github.io/language-server-protocol/specifi...

[2] https://emacs-lsp.github.io/lsp-mode/


Please forget "Extract Method" as an example. It's simply far too trivial. Imaging extracting a new superclass or interface from a class with 100 methods and you need to pick the set of methods to extract. You can't do that with 100 y/n choices.


>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.


DAP being the Debug Adapter Protocol described here? https://microsoft.github.io/debug-adapter-protocol/


Yep


I think the primary reason why IDEs are generally better than maximally customised editors like vim, emacs, sublime or vscode and whatnot is pretty simply put: money.

People buy IDE -> money goes to improving the IDE -> IDE gets better

People download one of 6 competing open-source plugins -> a couple of people improve it a little -> 3 years pass, the author loses interest -> someone else else reinvents the wheel, there are now 7 competing open-source plugins 3 of which are good but not maintained anymore.

Great features require time, I just don't see non-commercial work succeeding here.

Doesn't mean it's not possible to create commercial fantastic open-source standalone language tools, it's just not happening for some reason. Probably just because most businesses are still hesitant to open-source their core business?


"Commercial open-source" will always be oxymoronic to me, despite all the kumbaya naysayers. There's a basic law of nature at work here which US patent law and a fictional character ("if you're good at something, never do it for free") understood. To a programmer, opening the source essentially renders the product gratis, some custom integration work notwithstanding.


Yeah I get that, and I think that's the primary reason it's difficult to do well.

I think there _are_ ways to do it right. For instance, open-sourcing a Windows application is not necessarily problematic if 99.9% of your user base has never ever compiled something from source. Heck, my father is the kind of person who doesn't know the difference between "Windows" and "gmail". He has purchased software for his business once, it would've made no difference to him whether it was open-source or not.

Despite my believing that it's possible, I can't really think of any examples other than redhat and Qt from the top of my head...


> open-sourcing a Windows application is not necessarily problematic if > 99.9% of your user base has never ever compiled something from source.

What a fatuous remark. I publish the Coca-Cola recipe to Pepsi drinkers. I'm fairly sure the recipe will eventually get around to a home brewer who's sick of paying the Coca-Cola company for its product.


I'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.


Try a jetbrains ide? They handle pretty much any language you can think of, including fun things like lua with ERB substitutions.


Yeah, IntelliJ Ultimate with plugins gets pretty close to VSCode in terms of language support.


surely 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


For 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.


LSP is just a generalization of the implementations IDEs have had for decades.


Could 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.


I'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-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.


All 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).


Everything is doable with LSP as it is an extensible RPC essentially.

But the above things are not done in LSP generally. It doesn’t have first-class support for structural search replace. It doesn’t have support for interactive refactors which require user input.


Do 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.


Rust 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-searc...


Structural refactoring as in extract function/variable? You can find that in Rust Analyzer https://rust-analyzer.github.io/manual.html#assists-code-act...


I want to customize every last element of my editor, have native VI bindings for everything, and run in a terminal. What IDE does that?


I 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.


Sure, 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).


VSCode 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.


It'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.


Language server is a Microsoft offering


It's an open standard started and maintained by Microsoft.

I think that's a bit different from just being a "Microsoft offering".


"Hey I use an IDE, im special"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: