-
Notifications
You must be signed in to change notification settings - Fork 15
Add diagnostic_enable_location_list to enable/disable loclist #26
base: master
Are you sure you want to change the base?
Conversation
Hmm a problem is right now I'm using location list as a driver for the |
You are right, I didn't think about that. I'm not sure what the right implementation for this would be then. I could remove those commands when the location list is disabled, but If the user has a mapping to those commands things would break. Maybe those commands can be no-ops when location is disabled?
Are you referring to |
Yeah, if we want both neomake's linting and lsp diagnostic work at the same time without any conflict, one way is not using location list at all and implement our own kind of jumping, which I think would be too much work..Another approach is maybe use quickfix window instead? So the option would be let g:diagnostic_list = 'location' " or 'quickfix' |
I honestly can't see a case where having the diagnostic information in the quickfix list would be useful. I think loclist is the perfect place for it. At least for my use case, I would not benefit from having the diagnostic information in quickfix because that's where I keep my build log or run log. I'm not that familiar with NeoVim's LSP API, but looking through the documentation, I found this:
Would this be useful to get the appropriate loclist item? As far as I understand, your implementation for jumping to the next one is similar to |
Yes, exactly. I think the |
This makes sense. In if vim.api.nvim_get_var('diagnostic_enable_location_list') == 1 then
vim.lsp.util.set_loclist(vim.lsp.util.locations_to_items(local_result.diagnostics))
end So, even when If you approve this approach, I can work on it. It'd be good to stretch my lua muscles. |
Yes, just don't use the |
Just a heads up, I don't think I'll be able to work on this any time soon. Work schedule is a bit hectic. |
I use Neomake for linting as well and I found this option to be useful. But maybe instead of replacing the loclist, I can append to it. But I'm not sure how well that would work.
I think this is a useful addition, but let me know If it's not inline with how you see your plugin moving forward.