-
-
Notifications
You must be signed in to change notification settings - Fork 431
Better tooltips. #1504
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
Better tooltips. #1504
Conversation
fixes arduino#1503 Signed-off-by: dankeboy36 <[email protected]>
Nice, but I would fix having 2 identical pieces of information when holding Command. I would combine the last and penultimate lines since they report the same information |
@Edivad99, if you are referring to this:
Then you misunderstood the feature. In the monaco editor, if you press Ctrl/⌘ while hovering over a symbol in the editor (see From the VS Code docs:
I do not think we will spend time removing an available feature, but I am positive there is a preference to disable it if required. Here is an void setup() {
sum(1, 2);
}
void loop() {}
/**
* This is an example doc.
*
* @param left your number
* @param right another number
* @returns the sum of the args
*/
int sum(int left, int right) {
int i = 0;
// some comment
int j = i;
return left + right;
} In action: peek.mp4Here is another example. It's coming from peek_definition_other_example.mp4For completeness, people are complaining about too slow and fast popups. It's possible to adjust it via the advanced settings. To disable the popup, add the following to the {
"editor.hover.enabled": false
} If you want to tune the popup delay, add this to the settings file: {
"editor.hover.delay": 300
} The default value is In action: hover_settings.mp4 |
I don't want to delete the feature, but it can be set that when I press command the penultimate rectangle disappears and only the last one remains visible so you don't have 2 lines showing the method signature |
If you want to tune how your editor works locally, you might find the corresponding settings here to achieve it. Let us know how it went. Or maybe you can even open a PR with your proposed default settings. |
To save any interested parties from confusion, I'll add that this setting is not working correctly: #571 |
Thanks so much for your pull request and also for pointing out this error in the CLA text @dankeboy36! @alranel can you make the suggested correction to the CLA text? |
I'm unable to do it - the CLA is owned by the GitHub ArduinoBot user. Who has access to it? This is the gist to edit: |
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.
Works for me but I do not know why we need this additional styling. Maybe it's a Theia problem. If others are also OK, we can merge the PR.
@AlbyIanna, could you please also take a look? Thank you!
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.
This fixes the problem of the incorrect spacing of the horizontal rules in the editor hover:
Using this test code (written as pure C++ so it can be compared to the rendering in VS Code):
// Doc comment for foo with `inline code` markup
int foo(int bar);
int main() {
foo(42);
return 0;
}
int foo(int bar) {}
This is how the plain hover looks using the latest build from the main
branch:
The return type and signature lines are unpleasantly close to the horizontal rule.
This is how the plain hover looks using the build from this PR:
The spacing after the horizontal rules is nice looking.
I did notice one small regression:
This is how the Ctrl+hover looks using the latest build from the main
branch:
In the case of the definition section that is added at the bottom of the hover, the spacing after the horizontal rule is already correct.
This is how the Ctrl+hover looks using the build from this PR:
Now the spacing after the horizontal rule in the definition section is a little larger than expected.
I think the significant improvement in formatting outweighs the minor regression, especially since Ctrl+hover is probably rarely used by the Arduino IDE users (I didn't know about it before now), so I think the PR is beneficial overall, but if it is easy to fix that regression then I think it would be good to do.
Signed-off-by: dankeboy36 <[email protected]>
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.
I tested it and it works for me. Thank you @dankeboy36 !
If @per1234 is good with the changes too, I would merge this.
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.
It looks great. Thanks @dankeboy36!
Better tooltips.
tooltipfix.mp4
Motivation
Change description
Other information
Reviewer checklist