This now looks in mixins (which were ignored before) and finds matches
from interfaces, reporting the interfaces separately from the superclass
and mixin chain.
Change-Id: Id5f3379261e1ec184dc347abb371693481b65680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135528
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Adds analysis error tracking and fixes the enum declaration to not produce a warning.
I'm not happy with `assertNoAnalysisErrors` and would like something more configurable and context-aware but haven't thought it fully through.
Maybe something like:
```
assertNoErrors(
except: ['unused_import'],
);
```
(And maybe a file and line number?)
Alternatively, we could add ignores to the test sources:
```
import 'a.dart'; // ignore: unused_import
```
and maybe special case the line we're completing on:
```
f(^);
```
Still mulling it all over but your thoughts are welcome!
Change-Id: I1d0c5fbd72c80dde13ae98cb76c3728ab00a12f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135440
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The code is now gathering both element and token data in several places
where it used to gather only one of the two (using a new utility method).
The metrics are now better labeled to make the output easier to read.
It's also gathering a new metric: the distance between the static type
of a target and the class in which a referenced member is declared.
Change-Id: I566c02b069749221983ec960b8a67b293052bd93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135400
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Several of the tests were testing conditions that cannot occur and hence
were either re-written or removed. There's one test that I couldn't get
working so I marked it as failing. I marked another test as failing
rather than remove it because I think we want to update the lint to
catch that case (it's failing because no lint is produced).
Change-Id: I852c3c4595b0993ce2a64cbd9da1b6c7339dd59b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This is a fairly limited initial version of the assist. In addition to
implementation comments I'm interested in knowing whether there is value
in committing it as-is or whether it should be enhanced first.
Change-Id: Ia28328e1e5a759c0cec3936b334f719927f46dcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134620
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Gotta start somewhere.
All subject to revision. (Names especially.)
This gets us an end-to-end test and a starting point for client algorithm implementations.
Note that this was designed to run outside `test/`. We should be able to move it out if so desired.
Needless to say any thoughts on any of it are welcome!
Change-Id: Iecf5c7ce854f619aa5677454091ceb68dd45827b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134542
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The actual motivator is though that test_method was failing.
I suspect that this is a linter issue, `super.toString()`, when called
from legacy library and referencing NNBD SDK, is MethodMember, and
probably linter does not handle this right. I believe that this is
not a problem we should test or fix in analysis_server, so I update
the test to verify what is implemented in the server.
R=brianwilkerson@google.com, pquitslund@google.com
Change-Id: Iffe896deb138cd8f2da15ccf67a571491b544512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134406
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Some of the tests were fairly seriously broken, so this fixes them.
Some of the tests were testing that we don't provide a fix when there is
no lint, but I don't think that it's useful to test that.
One test required no changes other than removing the marker.
Change-Id: I6d85fd98506fa20d8bf4996d30603feb8b1ff252
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134500
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Report it as a silent exception. This way it will show up in log files
and (in the future) over crash reporting (since we haven't solved the
underlying cause), but *not* to users, because it currently appears to
be harmless.
In the future we should consider a "logged-only" type of exception, once
we are confident this isn't causing secondary issues, if we don't intend
to or think we are able to solve this at a deeper level.
Change-Id: I2ee339718fbd6e7c684ccc42718fbb57742f2dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134467
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Something is weird with our ResourceProviders and Context.canonicalize.
It causes the following:
newFolder(convertPath("/p3"));
resourceProvider.getResource(convertPath("/p3")) is File; // false
resourceProvider.getResource(
context.canonicalize(convertPath("/p3"))) is File; // true
Change-Id: Iafbfb6ad1bfc912a6850faf063778879dc97fe62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134143
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This adds support so that tests of lint-based quick fix tests can use
the output of the linter rather than cons-ing up a fake lint to drive
the test. It also converts many of the existing tests to use real lints.
There were/are an amazing number of tests that were invalid and needed
to be fixed. This includes fixes for some of them, but there are still
several tests that have not been converted because they fail when run
using the output of the linter. Some of these are invalid tests, but
some might indicate bugs in the quick fix generation that should be
fixed.
Change-Id: Iea806849ea111dc8454073e8fe44fd42c5208652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134141
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>