nvimtools / none-ls.nvim

null-ls.nvim reloaded / Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

We need a way to iterate external sources

Zeioth opened this issue · comments

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

for builtins we have

  • print(vim.table(require("null-ls").builtins): To list all builtins.

But we don't have a way to list all external sources. One can only access them individually like

  • print(vim.inspect(require("none-ls.formatting.reformat_gherkin")))

But the next line will fail with error, as it is not exposed.

  • print(vim.inspect(require("none-ls.formatting")))

As result we have no way to iterate all external sources.

Help

No

Implementation help

  • We should have a list somewhere where we store all non builtin sources.
  • This is a requirement so we can add external source support to mason-null-ls.
  • We could store them like none-ls.external_sources.formatting, now that we have the concept of external sources.

I just noticed none-ls.formatting is just the root directory name of none-ls-extras.nvim, so formatting would just be the directory containing all the sources.

So as long as every external source repository has the same structure, it would be technically possible to

  • Iterate the directories formatting, diagnostics, etc
  • For every item, require it and start it.

EDIT: Sadly, I've gone through the projects in https://github.com/nvimtools/none-ls-extras.nvim?tab=readme-ov-file#related-projects and each of them have a different directory structure, so this is not a reliable way to get the available external sources.

Closed as non viable.