Minimalistic alternative to the plugin mason-null-ls
with support for none-ls external sources.
Problem:
Solution:
none-ls-autoload.nvim
, you don't have to worry about any of that. This plugin will take care of automatically load/unload all mason packages you install/uninstall when necessary.{
"zeioth/none-ls-autoload.nvim",
event = "BufEnter",
dependencies = { "williamboman/mason.nvim", "nvimtools/none-ls.nvim" },
opts = {},
},
The none-ls
project stop supporting builtin sources when they have not been maintained for a while. Knowing that: External sources are packages you can install to use sources not oficially supported by none-ls
.
none-ls-autoload.nvim
where to find it with the option external_sources
.{
"zeioth/none-ls-autoload.nvim",
event = "BufEnter",
dependencies = {
"williamboman/mason.nvim",
"zeioth/none-ls-external-sources.nvim" -- To install a external sources library.
},
opts = {
external_sources = {
-- To specify where to find a external source.
'none-ls-external-sources.formatting.reformat_gherkin'
},
},
},
It's important to be aware a source is just a way to tell none-ls how to use a mason package. You HAVE to install the mason package to use it.
Option | Default | Description |
---|---|---|
external_sources |
{} |
If a mason package is not directly supported through a none-ls builtin source, you can specify a external source, so none-ls-autoload.nvim know how to load/unload it automatically when needed. |
methods |
{ diagnostics = true, formatting = true, code_actions = true, completion = true, hover = true } |
The type of sources we should load. This is handy in case you want to disable a certain kind of client. Or in case you want to manage a certain functionality using a different plugin. |
If you want to help me, please star this repository to increase the visibility of the project.
'<anything-you-want>.<method>.<source-name>'
, as we extract the last two fields to load it. For example 'package_name.subdirectory.formatting.reformat_gherkin'
. So if the external source you are trying to pass come from a repository not formatted that way, just fork it and fix its directory structure.