Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on startup #1

Open
dxu opened this issue Nov 6, 2023 · 2 comments
Open

Error on startup #1

dxu opened this issue Nov 6, 2023 · 2 comments

Comments

@dxu
Copy link

dxu commented Nov 6, 2023

I'm receiving an error on startup:

Error executing vim.schedule lua callback: ...vim/lazy/mason-nvim-lint/lua/mason-nvim-lint/install.lua:46: attempt to index a nil value
stack traceback:
        ...vim/lazy/mason-nvim-lint/lua/mason-nvim-lint/install.lua:46: in function 'try_install'
        ...mason-nvim-lint/lua/mason-nvim-lint/ensure_installed.lua:6: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

I've just set it up like this:


require("mason-nvim-lint").setup({
   ensure_installed = {
   	"selene",
   	"shellcheck",
   	"gdlint",
   	"eslint_d",
   	"jsonlint",
   	"djlint",
   	"stylelint",
   	"vale",
   	"yamllint",
   	"mypy",
   	"ruff",
   },
   automatic_installation = true,
})

@dxu
Copy link
Author

dxu commented Nov 6, 2023

It looks like gdlint is the issue - when i change it to gdtoolkit it works fine. Briefly glancing through the code, it seems like the mapping is only being applied for the auto_install and not the main install.lua file?

@rshkarin
Copy link
Owner

rshkarin commented Nov 6, 2023

The automatic_installation setting ensures that all linters specified in the config of nvim-lint are installed, so you need just specify linters in the nvim-lint. However, when the linter you need is not available in the nvim-lint, then you can specify all required linters in the ensure_installed in the mason's registry format, and then they will be installed from the registry. You fixed the error by providing the linter name in the mason's registry format as it should be.

rshkarin pushed a commit that referenced this issue Apr 2, 2024
Added trivy and typstfmt mappings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants