jay-babu/mason-null-ls.nvim

Add a function to querry the supported lsp features

DoeringChristian opened this issue · 8 comments

Hi,
I'm using your plugin to install null-ls sources.
I have the problem that I don't know if a source supports formatting, code_action etc.
Since null-ls has some builtin lsp sources I already requested a method in this issue to test if a builtin source exists.
I think it would be useful to have a method in your plugin with which one could query what lsp features the source supports.
Thanks for considering this feature request.

Hello,

To be clear, you would to somehow query for eslint and then get a list of types supported like formatting, completion, etc.?

I am not against it, but I do see this: https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/_meta. Basically go through each of these and return a list of where the source exists?

Thats exactly why I opened the other issue. I think that it would be useful to query what features the source supports in some cases. It could be that the source supports more features than null-ls.

I don't really understand the last comment too well about the source supporting more than null_ls, but it seems you want a function like null_ls.register_all(eslint). This seems like it should belong in null_ls. Thoughts? Trying to get to the root use case of what you want to do with the source's metadata

Well it could be that a source supports formatting but null-ls has no builtin for that. It would be more of a nice to have. I agree that this or a similar method should be in null-ls.

Jose seems to have referenced this. https://github.com/jose-elias-alvarez/null-ls.nvim/blob/24463756e80ce381f530c02debe781f3c7ba7599/lua/null-ls/builtins/init.lua#L15

Seems easy to add this as a method parameter to the function setup_handler

#26

this should resolve it. Can you test and see if it works correctly for you?

Thank you very much. I tested it and it is working.