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

No Highlighting When Jumping to Diagnostics with auto_preview off #2

Closed
fdschmidt93 opened this issue Apr 22, 2021 · 4 comments
Closed

Comments

@fdschmidt93
Copy link

Hi there!

Very cool plugin - happy to see you've borrowed from the telescope diagnostics code (as I see some of my comments in the code base) :) glad you've found it useful!

One thing I noticed when playing around with it with these settings

require("trouble").setup {
  use_lsp_diagnostic_signs = true,
  auto_preview = false,
}

unlike with auto previewing, highlighting (= tree-sitter) does not attach to the buffer when jumping to the diagnostic as can be seen in the video.

lsp_trouble-2021-04-22_20.37.35.mp4

I was able to reproduce this issue with a minimal config that only loads my nvim-treesitter config, my nvim-lsp config and LSP Trouble

From the initial looks of it, in my scenario vim.cmd "e" is skipped? I'm happy to further explore the code base and see if I can submit a PR but probably won't have time before Sunday evening.

@folke
Copy link
Owner

folke commented Apr 22, 2021

I'll add in a note that some of that code was based off Telescope :) Great project!

I know what's happening here. I'll see if I can fix it. Thank you for reporting!

@fdschmidt93
Copy link
Author

Sure thing!

No worries, all open source :)

@folke
Copy link
Owner

folke commented Apr 22, 2021

Should be fixed now. I had been struggling to get unlisted buffer opened by the LSP Diagnostics to render properly and added some weird code to tackle it.

Finally found the original problem with that: nvim_win_set_buf has no side effects, so fix was to do win.cmd "buffer ..." instead.

That triggered another issue with nested loading of the preview window and updates in the renderer.

But everything should be working as expected now. Let me know if you have any more issues!

@fdschmidt93
Copy link
Author

Works like a charm now, thanks!

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

No branches or pull requests

2 participants