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

Independent Decoration render support #101085

Closed
IWANABETHATGUY opened this issue Jun 26, 2020 · 9 comments
Closed

Independent Decoration render support #101085

IWANABETHATGUY opened this issue Jun 26, 2020 · 9 comments
Assignees

Comments

@IWANABETHATGUY
Copy link

The current decoration must be attached to a renderable token,
we use rust-analyzer as a example,

image

it's inline hint or inline parameter, as you can see, when you move your cursor to the ),
you actually select the :Error ), though the :Error is a decoration.
using this hack method to implement the inline hint like intellij has some drawback

  1. When you move your cursor next to a token with an inline hint, your cursor gets very thick including the decorator, which is very inconvenient when you edit your code!
    image
    server has a type: TcpListener, if i want to change the variable name , you will see the width of your cursor changes from 12px to 100px.(we assume the width). it's really weird.
  2. As a inline hint common implemation method, it's not so pretty.

Feature Request

Is it possible to add an option to have the decoration rendered separately from the original token, whether or not the rendering still relies on certain conditions of the original token.
If this new feature is available, plugin developers can implement the same inline hint as intellij。

@IWANABETHATGUY
Copy link
Author

related issue
#16221
#63144
related extension
rust-analyzer
vscode-js-annotations

@IWANABETHATGUY
Copy link
Author

test
here is the intellij inline parameter hint, it's decoration is rendered separate from parameter

@alexdima alexdima added api editor feature-request Request for new features or functionality labels Jun 28, 2020
@alexdima alexdima removed their assignment Jun 28, 2020
@Veetaha
Copy link

Veetaha commented Jun 29, 2020

@ulugbekna
Copy link
Contributor

This would generally be useful for all languages where types can be inferred from C++ to Scala to OCaml.

@Kingwl
Copy link
Contributor

Kingwl commented Feb 8, 2021

Hey folks.
I'm very interesting and happy to working on this one. It could improve the user experience of inline Hints very much.

There are many ways to do this one as far as I know:

  • Core move operation
  • Decoration & element layout
  • Hack the highlight/selection for decoration
  • etc.

But I'm not sure which one is better. Would you give some suggestions ? That would be very helpful to me.
Thanks!

/cc: @jrieken

@alexdima alexdima added inlay-hints and removed feature-request Request for new features or functionality api editor labels Oct 15, 2021
@alexdima alexdima removed this from the Backlog milestone Oct 15, 2021
@alexdima
Copy link
Member

@hediet @jrieken I think this issue might be resolved with the new implementation for inlay-hints.

@jrieken
Copy link
Member

jrieken commented Oct 15, 2021

Yeah, closing as dupe of #16221. We do have a good implementation and API on its way

@jrieken jrieken closed this as completed Oct 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants
@jrieken @hediet @alexdima @Kingwl @ulugbekna @IWANABETHATGUY @Veetaha and others