WhoIsSethDaniel / mason-tool-installer.nvim

Install and upgrade third party tools automatically
MIT License
428 stars 15 forks source link

FR: Show reason for failing installation #7

Open glyh opened 2 years ago

glyh commented 2 years ago

As title. When I use mason itself, I can get error message for why I failed to install some package. But not for this plugin.

WhoIsSethDaniel commented 2 years ago

This seems reasonable. I wouldn't want it to be the default and I would want to be able to do a "one off" where it shows me the error(s), but I don't have to turn something on in the config to do so.

Allaman commented 2 years ago

Am I mistaken something? There is output?

I define all my tools via mason-tool-installer like this

require("mason-tool-installer").setup({

  -- a list of all tools you want to ensure are installed upon
  -- start; they should be the names Mason uses for each tool
  ensure_installed = {
    -- LSP
    "bash-language-server",
    "dockerfile-language-server",
    "typescript-language-server",
    "texlab",
    "lua-language-server",
    "pyright",
    "terraform-ls",
    "yaml-language-server",
    -- Formatter
    "black",
    "prettier",
    "stylua",
    -- Linter
    "eslint_d",
    "shellcheck",
    "vale",
    "yamllint",
  },

And when I run :MasonLog I can see the following output (for black)

..acker/start/mason.nvim/lua/mason-core/installer/init.lua:146: Installation failed for Package(name=black) error="...acker/start/mason.nvim/lua/mason-core/installer/init.lua:113: ...r/start/mason.nvim/lua/mason-core/managers/pip3/init.lua:71: Unable to create python3 venv environment.

Sure, that does not explain (at least for me) why mason cannot create a python venv but it is a first hint

WhoIsSethDaniel commented 2 years ago

Using :MasonLog is fine. You can also re-run the installation within :Mason and see any errors that occur.

I don't think it's unreasonable to want to see errors using :messages when mason-tool-installer fails to install a package. I wouldn't want it to be the default as it can be a lot of output. But allowing a user to see the complete failure on a one-off basis seems useful.