Skip to content

Hover over types could be more useful #1035

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

Open
vsmenon opened this issue Jun 9, 2020 · 4 comments
Open

Hover over types could be more useful #1035

vsmenon opened this issue Jun 9, 2020 · 4 comments

Comments

@vsmenon
Copy link
Member

vsmenon commented Jun 9, 2020

Right now, if I hover on Future, I see the following:

Screen Shot 2020-06-09 at 12 06 51 PM

I see similar hovering on anything that is a type. At a minimum, shouldn't see the getObject error. It'd be nice to show any relevant info (e.g., where it's defined, links) if possible.

FYI - @annagrin

@vsmenon
Copy link
Member Author

vsmenon commented Jun 9, 2020

Alternatively, is there a way to suppress and trigger whatever the editor would do statically?

E.g., when I'm stopped at a breakpoint in VSCode and I hover over a symbol in the same file, I get eval - i.e., the above when I hover on Future. If I move to a different file (or I'm not at a breakpint), I get the static doc for a class symbol instead - e.g., the dartdoc for Future.

@DanTup

@DanTup
Copy link
Contributor

DanTup commented Jun 11, 2020

Alternatively, is there a way to suppress and trigger whatever the editor would do statically?

Unfortunately not - this came up at microsoft/vscode#48747 (comment) and although we can make it trigger the static hover provider, it won't render the results(!).

I still think it's a good idea though, so since there's no existing issue about it, I've opened microsoft/vscode#99856 to see if it could be considered. If it was implemented as an option, then maybe having it automatically fall back to that if the debug provide returns nothing (or a specific type of a result) would be even better.

What you're seeing for now, is the debugger evaluating the expression under the cursor (Future<CardSet>) which returns a Type. We then call the VM Service's getObject on that type but in this case it returns an error.

We could add special handling for types if there's something better to do, but we should ensure the real VM and web proxy behave roughly the same, so that what we do makes sense in both cases.

@devoncarew
Copy link
Member

devoncarew commented Jun 12, 2020

...which returns a Type. We then call the VM Service's getObject on that type but in this case it returns an error

It sounds like this issue is about improving package:dwds's support for the vm_service Type object.

@vsmenon
Copy link
Member Author

vsmenon commented Jun 12, 2020

Good point about consistency. Here's the same on the VM / MacOS:

Screen Shot 2020-06-12 at 5 59 02 AM

No error, though it'd be nice to show static info here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants