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

"Find uses" filters inaccessible matches too aggressively #19660

Closed
stereotype441 opened this issue Jun 25, 2014 · 7 comments
Closed

"Find uses" filters inaccessible matches too aggressively #19660

stereotype441 opened this issue Jun 25, 2014 · 7 comments
Assignees
Labels
analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-obsolete Closed as the reported issue is no longer relevant

Comments

@stereotype441
Copy link
Member

Given the following sources:

test1.dart:
  class A {
    foo() {}
  }
  f(A a) {
    a.foo();
  }

test2.dart:
  import 'test1.dart';
  class B extends A {
    @­override
    foo();
  }
  main() {
    f(new B());
  }

Selecting B.foo and using the editor's "find uses" feature produces 0 search results. This is incorrect: f calls A.foo, and this is a valid match because B.foo overrides A.foo.

If the line "import 'test2.dart';" is added to the top of test1.dart, then the search works properly. This should not be necessary to get proper search results (in fact, editor correctly shows a hint indicating that this is an unused import).

@stereotype441
Copy link
Member Author

Digging through the editor source code a little, the culprit seems to be the call to HierarchyUtils.getAccessibleMatches() from within FindReferencesAction. It filters out f as a search result because test1.dart doesn't import test2.dart. But that's irrelevant, since it's not necessary to import test2.dart in order to call B.foo()--all you need is to have access to an object of type B.

@clayberg
Copy link

Set owner to @scheglov.
Added this to the 1.6 milestone.
Removed Priority-Unassigned label.
Added Priority-Medium label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@sethladd
Copy link
Contributor

After review, we believe we can better address this issue by helping editors like sublime and webstorm provide great Dart support.


Added NotPlanned label.

@scheglov
Copy link
Contributor

This issue is still valid for the server, so should be triaged in context of the server later.


Removed Area-Editor label.
Added Area-Analyzer, Analyzer-Server, Triaged labels.

@scheglov
Copy link
Contributor

Actually it seems that in the Analysis Server we have an implementation that does not have this issue.


Attachment:
[Screen Shot 2014-09-19 at 2.00.31 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-19660/comment-7/Screen Shot 2014-09-19 at 2.00.31 PM.png) (103.72 KB)


Added AssumedStale label.

@stereotype441 stereotype441 added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-server closed-obsolete Closed as the reported issue is no longer relevant labels Sep 19, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-obsolete Closed as the reported issue is no longer relevant
Projects
None yet
Development

No branches or pull requests

5 participants