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

Editor: show inferred types in variable tooltip #4497

Closed
DartBot opened this issue Aug 14, 2012 · 5 comments
Closed

Editor: show inferred types in variable tooltip #4497

DartBot opened this issue Aug 14, 2012 · 5 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug
Milestone

Comments

@DartBot
Copy link

DartBot commented Aug 14, 2012

This issue was originally filed by mn...@gmail.com


What steps will reproduce the problem?

  1. Create the following code in the Editor:

  void main() {
    var x = foo();
    print(x);
  }
  
  List<String> foo() {
    return ["hello", "world"];
  }

  1. Hover the mouse over 'x' inside 'print(x)'

What is the expected output? What do you see instead?

Inside the tooltip, I expect to see "List<String> x" but I see "var x" instead.

What version of the product are you using? On what operating system?

Version 0.1.0.201208131139, Build 10597
Dart SDK version 10595
OS X 10.6.8

The Dart community seems to be establishing a cultural norm where type annotations are used at API boundaries and not used for local variables. This works great with the Editor's local type inference option. It would be helpful to have an Editor option allowing variable tooltips to show the results of type inference. This allows some of the documentation benefits of types without cluttering code with them all the time.

Related: I've occasionally seen a variable tooltip like "var foo - instance of List<String>" but haven't been able to discern when those kinds of tooltips are shown and when they're not.

@kasperl
Copy link

kasperl commented Aug 17, 2012

Added Area-Editor, Triaged labels.

@clayberg
Copy link

Added this to the Later milestone.
Removed Type-Defect label.
Added Type-Enhancement label.

@danrubel
Copy link

Set owner to @scheglov.
Removed this from the Later milestone.
Added this to the 1.1 milestone.

@scheglov
Copy link
Contributor

@scheglov
Copy link
Contributor

@DartBot DartBot added this to the 1.1 milestone Nov 25, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants