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

feat: add ignore_methods to ignore setup of null-ls source method types #93

Closed
wants to merge 1 commit into from

Conversation

mehalter
Copy link
Contributor

@mehalter mehalter commented Feb 7, 2024

A lot more people nowadays are starting to use more tools like conform or nvim-lint and things which replace certain functionality in null-ls but not all of it. It might be a good idea to add the ability to ignore types by default. Like if I'm using conform and still want to rely on mason-null-ls for diagnostics and code actions, I could add to the setup like ignore_methods = { "formatting" } since that's handled by conform. Or if I use both conform and nvim-lint but want to use null-ls for code actions, adding ignore_methods = { "formatting", "diagnostics" } which won't add those types to the handlers when they are called.

Update: originally called ignore_types, ignore_methods aligns better with the terminology used here and in null-ls/none-ls.

@mehalter mehalter changed the title feat: add ignore_types to ignore setup of null-ls source types feat: add ignore_methods to ignore setup of null-ls source method types Feb 7, 2024
local types = _.filter_map(function(method)
if vim.tbl_contains(ignored_methods, method) then
Copy link
Owner

@jay-babu jay-babu Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking why not just allow line 54 to be overridden with allowed_methods. Also that's interesting, people can't just replace null-ls completely. You need it somewhat still

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it just becomes more verbose to list off allowed methods. It's more typical you just want to ignore them. I'm good either way !

Definitely when building extra lazy specs such as in LazyVim extras and AstroCommunity it makes it easier to be additive when it's ignore because you can add those in rather than hope that the opts currently have the full allowed_methods populated and then to remove a method. If that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example of it making sense for it to be ignore_methods if you are interested: https://github.com/AstroNvim/astrocommunity/pull/756/files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened another PR as a different approach/option for tackling this type of thing. Let me know what you think!

@mehalter
Copy link
Contributor Author

mehalter commented Feb 8, 2024

It sounds like the other PR is more in the right direction we want to move, so I'll go ahead and close this for now

@mehalter mehalter closed this Feb 8, 2024
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

Successfully merging this pull request may close these issues.

2 participants