-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Inline Hints controller and API proposal #113285
Conversation
This reverts commit 741a568.
I think it's basically work on code side. We may going to improve
|
/cc @CyrusNajmabadi Thanks for starting this! This is quite an effort and you have come very far already 👏. I didn't do a full review yet (and likely won't before early January) but a few quick notes:
|
more popular related issue: #16221 |
for reference the Roslyn/C# |
Thanks for the review. I'll do them soon. |
I think that's OK for now.
Thank you. |
LMK how i can be of assistance? I implemented this for VB and C# in Roslyn, and we'd obviously want the same computation to be portable over to whatever is created for VSCode/LSP. |
@CyrusNajmabadi To take some review I guess. |
src/vs/vscode.d.ts
Outdated
/** | ||
* The name of the parameter. | ||
*/ | ||
name: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: in roslyn we support classified text in our 'hints', not just plain text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also support the user hovering over these hints to get additional information (for example, what quick-info would show for teh entity in the hint).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: roslyn supports two modes for inline-hints (and allows hte languages to specify different behavior depending on the mode). The first mode is that the user can request the hints always be shown. THe second is that the hints are shown only when a certain keybinding is held down (in our case alt-f1). Depending on which mode the user activates, we show different hints. For example, say the user has the code:
With the mode on to just always show hte hints, we'll display that as:
In this manner, the inline-hint only augments the text, but never affects your ability to interact with anything. However, if the user holds down
Here, we actually overwrite a portion of teh user's text (the |
src/vs/editor/contrib/signatureArgumentsLabel/signatureArgumentsLabel.ts
Outdated
Show resolved
Hide resolved
I don't think that's a good idea to implement the overwrite mode now.... |
…self contained if at all)
…ecorations, and much 💄
I have started in depth reviewing and also pushed a bunch of commits. Sorry, but I also removed some thing that got added in last days, namely:
I have also pushed a few cosmetic changes so that it is easier for me to work with these changes in the future. I will spend some more time on this branch and then I'll be ready to merge the current state. |
Thank you very much. I'll read the changes too. |
Cool. It's much simple and clear. Are there anything else can/need I do? |
I have tried to assign hover message into decoaration options. And there's no tooltip show. PS. It's based my debug experience. So please let me know if there is any incorrect. |
Yeah, that is correct. It works if you give a non empty range but my point is that it's an editor limitation and should be treated as such. E.g the editor should simply support such decorations with hover. I know it is tricky because ::before/after nodes don't really show up as event targets. So, some tricks are needed. I'll make sure to talk to the right folks here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still some follow-up work:
- overlay mode
- testing
I am planning on tackling that after merging
Merged. This means we have proposed API for this and a first variant of the UI (inbetween rendering). Thanks @Kingwl for this great contribution |
I'm also happy to add more test cases or doc too! |
This PR will
fixes #113276
enables #16221