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

Perform simple type inference in the editor #855

Closed
DartBot opened this issue Dec 14, 2011 · 4 comments
Closed

Perform simple type inference in the editor #855

DartBot opened this issue Dec 14, 2011 · 4 comments
Assignees
Labels
closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Dec 14, 2011

This issue was originally filed by [email protected]


Consider the following code:

doSomething(var x) {
  if (x is MyObject) {
    // blah blah blah
  } else {
    // other stuff
  }
}

When entering 'x.' within the 'x is MyObject' clause, it would great if method autocompletion would take the type of x to be 'MyObject' rather than giving up and saying 'No completions available.'

I don't expect global type inference at this point, but a simple local check of the enclosing scope would be a big help.

@stevemessick
Copy link
Contributor

That's a good idea. Another improvement would be to do Smalltalk-style suggestions. That is, find all methods that match the prefix that was typed and propose them as completions. It doesn't use types at all, and is more useful when you've typed something like "x.get" followed by Ctrl-Space. Paying attention to final var decls that have a well-typed RHS would also be good.


Set owner to @stevemessick.

@stevemessick
Copy link
Contributor

Added Started label.

@clayberg
Copy link

clayberg commented Jun 1, 2012

Removed Type-Defect label.
Added Type-Enhancement, Duplicate labels.
Marked as being merged into #508.

@clayberg
Copy link

clayberg commented Jun 1, 2012

Marked as being merged into #dart:502.

@DartBot DartBot added Type-Enhancement closed-duplicate Closed in favor of an existing report labels Jun 1, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue Aug 14, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

lints (https://github.com/dart-lang/lints/compare/1e0245e..54cd7a0):
  54cd7a0  2023-08-11  Parker Lougheed  Cleanup docs and links (#142)

protobuf (https://github.com/dart-lang/protobuf/compare/217c030..a852ba4):
  a852ba4  2023-08-14  Ömer Sinan Ağacan  Release protobuf-3.1.0, protoc_plugin-21.1.0 (#868)
  8505c58  2023-08-14  Ömer Sinan Ağacan  Generate constructor arguments again, add a flag to disable (#855)

test (https://github.com/dart-lang/test/compare/9b1828f..bc0a992):
  bc0a992d  2023-08-11  Nate Bosch  Remove always null observatoryUrl for browsers (#2079)

webdev (https://github.com/dart-lang/webdev/compare/f8f752c..19aad27):
  19aad27b  2023-08-11  Elliott Brooks  Reset DWDS to version 20.0.2-wip after release (#2193)
  20cc6d3d  2023-08-10  Elliott Brooks  Prepare DWDS for release to version 20.0.1 (#2192)
  9e352670  2023-08-10  Elliott Brooks  Prepare DWDS for release to version 20.0.0 (#2191)
  bc008840  2023-08-10  Bernardo Ferrari  Update `file` dependency. (#2185)
  afbd6401  2023-08-10  Elliott Brooks  Re-enable events_test with fix (#2189)
  1f1efa35  2023-08-10  Elliott Brooks  Fix Flutter crash by catching WipError on resume and mapping to RPC error (#2188)

Change-Id: I159fc1b35b60bab9909f287a9c9f85b624993fb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320640
Commit-Queue: Konstantin Shcheglov <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants