fix(trouble): compatibility with Trouble v3 #286
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank for trouble, which offers us more customization options! Now, Trouble v3 provides an
events
configuration. Therefore, I believe the additional autocmd settings here are unnecessary.todo-comments.nvim/lua/trouble/sources/todo.lua
Line 21 in d58b376
To provide more explanation about "unnecessary":
Firstly, the provider parameter no longer works and should be changed to mode = 'todo'. Otherwise, due to filter failure, the autocmd set in todocomment will incorrectly refresh sources that shouldn't be processed.
https://github.com/folke/trouble.nvim/blob/e32c194558ebeb433ccfd580a34c66770bc102bd/lua/trouble/api.lua#L107
https://github.com/folke/trouble.nvim/blob/e32c194558ebeb433ccfd580a34c66770bc102bd/lua/trouble/api.lua#L16-L27
https://github.com/folke/trouble.nvim/blob/e32c194558ebeb433ccfd580a34c66770bc102bd/lua/trouble/view/init.lua#L106-L108
Secondly, as explained above, the configuration within
events
already provides theBufferWritePost
event.In conclusion, we need to choose the correct version to handle the compatibility issues with the older versions, and I will continue to follow up on this.
Best regards!