Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

[Feature] Install extra tools (like lua-formatter, eslint_d, prettierd) #95

Closed
lucax88x opened this issue Sep 17, 2021 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@lucax88x
Copy link

I know they're not specifically used as LSP servers but more indirectly but servers like efm or diagnostic, but it would be cool, imho, to have the possibility to install also these external tools, like:

  • prettierd
  • eslint_d
  • lua_formatter

etc.

what do you think?

@williamboman
Copy link
Owner

williamboman commented Sep 17, 2021

Hey! Yes this is something I'd like to do in the future too. However I am pretty sure I'd not want to put anything formatter-related in this plugin, but instead start a separate plugin for that purpose specifically. Much of the code in terms of installing, uninstalling, and the UI is very much reusable, so it should not take a lot of effort to make it happen. What's kinda holding me back atm is:

  1. I don't feel like I have a good idea of the full inventory of different formatters that exist (I pretty much only use Prettier, Stylua, Checkstyle, and Ktlint)
  2. I don't have that good of an idea of how such a plugin would best fit in with the existing ecosystem of formatting plugins. I use https://github.com/mhartington/formatter.nvim personally, but I know there are a ton of others. Many are also non-Lua, so that complicates things somewhat.

Might look into this soon, since you created an issue there might be a bigger demand than I anticipated :P

@ChristianChiarulli
Copy link
Contributor

I would recommend a companion for null-ls, it supports a ton of formatters and linters.

lspconfig - nvim-lsp-installer
null-ls - language-tool-installer

@williamboman
Copy link
Owner

I would recommend a companion for null-ls, it supports a ton of formatters and linters.

lspconfig - nvim-lsp-installer null-ls - language-tool-installer

I've been meaning to learn more about null-ls. Looks interesting, would definitely help by not having to ensure compatibility with all existing plugins out there.

@abalmos
Copy link

abalmos commented Oct 5, 2021

lspconfig - nvim-lsp-installer null-ls - language-tool-installer

Could keep it one plugin and ensure that null-ls is installed when any of the formatters / linters are. null-ls essentially allows you to think of those tools as language servers and seems appropriate for this plugin to me.

That said, many of these tools are often installed locally to a project as a dev dependency (e.g., eslint) and it should use that over the system / nvim-lsp-installer version. This is important for predictable CI, etc.

@briandipalma
Copy link

That said, many of these tools are often installed locally to a project as a dev dependency (e.g., eslint) and it should use that over the system / nvim-lsp-installer version. This is important for predictable CI, etc.

Yes Prettier/ESLint should try and use locally installed versions first, that's how the plugins work in VS Code.

@williamboman williamboman added the enhancement New feature or request label Oct 24, 2021
@williamboman williamboman added this to Needs triage in Issue Triaging Nov 23, 2021
@williamboman williamboman moved this from Needs triage to Low priority in Issue Triaging Nov 23, 2021
@nyngwang
Copy link

[...] to install also these external tools, like:

  • prettierd
  • eslint_d
  • lua_formatter

etc.

I propose these for python developers too:

  • mypy
  • flake8
  • autopep8

@williamboman
Copy link
Owner

Cross-posting this here: pocco81/dap-buddy.nvim#71 (comment)

@williamboman
Copy link
Owner

Cross-posting some updates on this here: pocco81/dap-buddy.nvim#71 (comment). tl;dr: it's very much a work in progress, changes are however so significant that I really think it warrants a new plugin altogether

@williamboman
Copy link
Owner

williamboman commented Jul 7, 2022

Hello all. So as I've been working on this on-and-off for the past months I've ended up with something that is so fundamentally different from nvim-lsp-installer that I felt like it warranted an entirely new plugin, so that's just what I've done.

I just made https://github.com/williamboman/mason.nvim public for alpha testing. Feel free to give it a spin if you'd like, for the time being only a small set of new packages have been added on top the nvim-lsp-installer base (PRs to add new packages are very much welcomed).

For those who currently use nvim-lsp-installer and want to switch entirely during testing (which I recommend), the minimum you need to get started is:

require("mason").setup()
require("mason-lspconfig").setup()

Note that you will have to manually clean up the old installation directory that nvim-lsp-installer used - mason installs to a new one by default.

Issue Triaging automation moved this from Backlog to Closed Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

6 participants