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

Can I get chainingHints? #177

Closed
oblitum opened this issue Mar 30, 2020 · 10 comments · Fixed by #220
Closed

Can I get chainingHints? #177

oblitum opened this issue Mar 30, 2020 · 10 comments · Fixed by #220
Assignees

Comments

@oblitum
Copy link

oblitum commented Mar 30, 2020

Can I get chainingHints like these?

I think it would need virtualText, but I'm not sure whether it depends on global codeLens.enable or not. fwiw, I don't wish to have global codelens, just the inlayHints.

@fannheyward fannheyward self-assigned this Mar 30, 2020
@TimoFreiberg
Copy link
Contributor

Any progress on this? Is there something I could help with?
I'd hope that all kinds of inlayHints would be supported (chaining hints, type hints and argument name hints, see attached picture)
inlayHints

@oblitum
Copy link
Author

oblitum commented Apr 25, 2020

@TimoFreiberg See :h nvim_buf_set_virtual_text(), inlayHints that would go in the middle of normal text (type and argument name hints) are not possible with NeoVim's virtual text, only those that go after normal text (chaining hints).

@TimoFreiberg
Copy link
Contributor

Oh that's a shame! It looks there's a WIP PR to improve that, though 🤔 neovim/neovim#9496

@fannheyward
Copy link
Owner

fannheyward commented Apr 29, 2020

@oblitum @TimoFreiberg can you test #220 ?

@oblitum
Copy link
Author

oblitum commented Apr 29, 2020

@fannheyward I'm testing it from dev branch and it's working nicely.

@oblitum
Copy link
Author

oblitum commented Apr 29, 2020

@TimoFreiberg really thx for looking up that NeoVim issue, I'll give a bump there, showcasing this usecase (once it's merged), since that pull seems stale for an year.

@TimoFreiberg
Copy link
Contributor

TimoFreiberg commented Apr 29, 2020

Awesome!

image

The colortheme looks wrong though, but it looks like that's a Coc bug - the highlight settings for virtual text are not set by default, I'm going to create a PR.
I created neoclide/coc.nvim#1829, I think there was something missing.

@oblitum
Copy link
Author

oblitum commented Apr 29, 2020

@TimoFreiberg you just need to have :h CocHintVirtualText properly set, I think it's fine as now. By default it links to CocHintSign, as all other CocXXXSign highlightings, so you have to have either set.

@fannheyward I think PR just needs a doc about the additional CocRustChainingHint highlight.

@oblitum
Copy link
Author

oblitum commented Apr 29, 2020

I created neoclide/coc.nvim#1829, I think there was something missing.

ah, ok.

fannheyward added a commit that referenced this issue Apr 30, 2020
* feat(rust-analyzer-api): update

* feat(ctx): inlay hints

* feat(ctx): inlay hints works

* feat(ctx): chaining hints works

close #177

* fix(cmds): SSR param changed

* chore(doc): docs for CocRustChainingHint
@fannheyward
Copy link
Owner

Released v0.6.0

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 a pull request may close this issue.

3 participants