Closed luispinto23 closed 2 months ago
I haven't used inlay hints much at all, but I have just had a look at the API and I think this should be possible.
I should be able to hook the inlay hints and inject the same amount of space into the string.
I will have a play with a PoC later
Thanks for the report, I imagine there are going to be a few cases like this with different configs!
This would be cool! Great idea now that 0.10 is released.
I have an experimental implementation of this in #38
@luispinto23 would you be able to give it some testing?
I have an experimental implementation of this in #38
@luispinto23 would you be able to give it some testing?
I'd love to help, but I'm off for the weekend with no PC. I can do it probably by Sunday night or Monday morning.
Thanks @luispinto23 that would be great
It seems to work for me, but I don't use inlay hints regularly so it won't get tested much more.
The PR needs actually tests before it can be merged. And Mac CI hasn't been updated to 0.10 yet. So a merge will be pending that anyways
I think I am using the correct version here, please correct me if I am wrong:
It's working correctly when no inlay hints are present:
But when I move to somewhere with inlays it's breaking:
Error 11:26:21 PM msg_show.lua_error Error detected while processing CursorMoved Autocommands for "*": 11:26:21 PM msg_show Error executing lua callback: ...re/nvim/lazy/precognition.nvim/lua/precognition/init.lua:159: attempt to index field 'location' (a nil value) stack traceback: ...re/nvim/lazy/precognition.nvim/lua/precognition/init.lua:159: in function 'build_virt_line' ...re/nvim/lazy/precognition.nvim/lua/precognition/init.lua:263: in function 'display_marks' ...re/nvim/lazy/precognition.nvim/lua/precognition/init.lua:291: in function <...re/nvim/lazy/precognition.nvim/lua/precognition/init.lua:279>
I am not used to debug this kind of things, so please let me know if I can be of any help and I'll try to provide any more info.
Hi @luispinto23
Change the commit line to
branch = "inlay_hints",
Then open :Lazy
and update
You will need to remove that line and reupdate when the change is merged
I think it should work fine, I have done more on this tonight and it seems to be working well
Thank you to let me know how to point to the right code.
It's working fine!
Is there somewhere we can donate to buy you a beer or a coffee?
Thank you to let me know how to point to the right code.
It's working fine!
Is there somewhere we can donate to buy you a beer or a coffee?
Brilliant
I will try and get the testing strategy fleshed out I think I will need to mock an lsp so will look into this
Thanks for your assistance @luispinto23
I have my GitHub sponsors set up if you wanted to, but it's really not necessary
I tested this out as well today and lgtm.
First of all, thank you for this amazing plugin.
I am having a small problem though, I have lsp inlay hints active and this messes up with the plugin. Is there anyway to make it work with inlay hints?
example: