Lsp-mode: [Poll] lsp-mode - minimal or batteries included

Created on 14 Dec 2018  路  8Comments  路  Source: emacs-lsp/lsp-mode

Given the fact that lsp-mode is no longer targeting elpa/core and there are no restriction from having melpa dependencies we may reconsider lsp-mode's dependencies. At this point, there are at least 2 packages that lsp-mode have implicit dependency - yasnippet(for expanding snippets) and markdown-mode(for rendering markup). If we go ahead and add these dependencies we will get the following benefits:

  1. Avoid issues like https://github.com/tigersoldier/company-lsp/issues/75
  2. Better out of the box experience
  3. Easier to configure for newcomers.

Drawbacks: lsp-mode will become more "heavy" although yasnippet and markdown-mode are so popular that it will be hard to find a emacs user which does not have them installed.

@alanz @MaskRay @vibhavp @tigersoldier (and not only) what do you think ?

discussion

Most helpful comment

In my view, the artificial split into lsp-ui and lsp can be undone, and the "lightweight" option can be handled by eglot.

So I am not averse to this.

All 8 comments

In my view, the artificial split into lsp-ui and lsp can be undone, and the "lightweight" option can be handled by eglot.

So I am not averse to this.

Is there a way to have both? I.e. an auto-configure function that sets everything up, but can be left out, or customized, if need be?

@tam5 enabling/disabling/customization is always on the table. In fact, now we have something like what you have described. My point is mainly about whether we should depend on the packages without alternative like yasnippet and markdown-mode. We state that we may work without them but in fact this just leads to poor user experience. Merging lsp-ui as @alanz mentioned is bigger step but we may consider it too.

@MaskRay can you share your opinion on having yasnippet and markdown-mode as a explicit dependencies?

I would rather that these are optional, with functionality that degrades gracefully (possibly with a warning/notification) _or_ with a helpful error in the event that they are not installed. Only dependencies that are truly required should be non-optional (which should typically be libraries such as dash, e.g. code that is not user-facing).

I especially would not want lsp-mode to do any configuration on my behalf either, that is any configuration beyond what is typical of a package for Emacs.

Additionally, with regards to "Easier to configure for newcomers.", I think that this is something that can be solved with better documentation. Note that this does not just mean more documentation, but also documentation that is simply clear and easy to locate and navigate.

Something I would support is merging lsp-ui into lsp-mode, as I see no proper reason for it be distributed separately. I think merging lsp-ui into lsp-mode would add a much more real benefit to new users (and users in general), due to keeping documentation, configuration, and installation of two very closely related components together.

Being the opinionated type, I dislike hard dependencies. That being said, I do have both yasnippet and markdown installed. Probably not a popular suggestion, but how about something like a lsp-easy (or something) package that has those dependencies and perhaps a well-commented default setup that can be used as a starting point? Those who prefer the turn-key solution and new users could use that, while the opinionated could skip it and/or use it for examples.

@xendk

Probably not a popular suggestion, but how about something like a lsp-easy (or something) package that has those dependencies and perhaps a well-commented default setup that can be used as a starting point?

Actually lsp-easy is planned ( although it will be named lsp-ide or lsp-layer) but for a slightly different reason - I want to create full out of the box IDE experience in the spirit of Spacemacs. The package will go a step further from what this PR is about:

  1. Hard dependencies to several other packages flycheck/company/treemacs/helm/projectile(?)/doom-modeline.
  2. Hard dependencies to the external lsp packages like ccls and lsp-java.
  3. Hard dependency to dap-mode

The overall goal is to do package-install then open a file Foo.bar and have a working environment with code intelligence, debugger and so on.

Created repo https://github.com/emacs-lsp/lsp-ide . lsp-ide will be a meta package which will allow also adding direct dependencies to more lsp related packages like company-lsp/lsp-FOO-LANGUAGE and so on.

Was this page helpful?
0 / 5 - 0 ratings