-
Notifications
You must be signed in to change notification settings - Fork 791
Add a method to find builtins with server name. #1190
Comments
Sorry, I'm not sure I understand the request. Don't the source names from mason-null-ls match the source names here? |
They do but when indexing the builtin tables to lookup weather that source does exist and the source does not it generates a warning here. |
Right, so if the names match, then what is the issue? At what point do you access a built-in that doesn't exist? The existing warning is important to prevent issues caused by typos, and I'd be hesitant to add a method for such a specific use case. |
The problem is that I don't know if the source supports formatting, code_actions etc. I would need to test if the source is in builtin.formatting, builtin.code_action etc. |
I see. This is something we could add here, but I think a better solution might be to have mason-null-ls pass more information than just the source's name to user-defined handlers. As you've seen, the name alone is not enough context to properly handle the source, especially since sources like ESLint have the same name but 3 different methods. |
That makes sense I think having both would be useful nonetheless. If for example the source supports something that has not yet been implemented in null-ls' bultins one could check if the "feature" exists there. |
I think there's some confusion about terminology here because I'm not sure what you mean by "source" (maybe Mason has its own definition?). If I understand correctly, you want to know if a given command (e.g.
Edit: I originally wrote an example of an approach we could use, but the issue with that approach is that the name of null-ls source doesn't always match the name of the command. Honestly I think your best solution is to copy this logic instead of indexing the |
Issues
Feature description
Hi,
I am using Mason to install null-ls servers with the plugin mason-null-ls.nvim.
This plugin gives me a string with the name of the installed server. I would like to automatically enable all builtins for that server. When testing if there exists a formatter, code_action etc using:
I get a warning if the server does not support formatting.
Is there a way to test if this builtin does exist?
If not could this be implemented?
Thanks for your Help.
Help
Yes, but I don't know how to start. I would need guidance
Implementation help
No response
The text was updated successfully, but these errors were encountered: