This CL fixes several minor bugs:
- In info_builder.dart, we were trying to apply SourceInformation from
the defining library to all its parts.
- In NnbdMigrationTestBase, we were trying to fully migrate each file
before processing any other files. We need to prepare each input,
then process each input, then finalize each input.
- In NodeBuilder, we were failing to send part file sources to
NullabilityGraph.migrating(). As a result, methods declared in part
files were being treated as already migrated, so they were getting
the wrong kinds of nullability nodes.
- In _ProvisionalApiTestBase, we were sometimes visiting parts before
discovering what libraries they were part of, causing inconsistent
resolution results.
I'm hoping this will be sufficient to address
https://github.com/dart-lang/sdk/issues/40670.
Change-Id: I07d693b31b6cf64bc6f72126f5ef4792b29e5029
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136521
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Since deleted code is shown in red in the preview tool (rather than
being deleted), we should only look at insertions when computing the
offsets for applying navigation links to the preview text.
Fixes a bug wherein a large block of deleted text near the top of a
file would cause a crash due to a bogus negative offset.
Change-Id: I704b2cecaf4b93eeb91f16d9bd5890ad3e3080e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136403
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@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>
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>
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>
The fix for empty_catch should not remove the catch clause if doing so
would leave the try statement invalid. It could remove the whole try
statement in such a case, but it isn't clear that that's a good solution
in general. This at least patches the issue until we can decide whether
additional work should be done.
Change-Id: I7c5190faba9fd5632c04708007bc65bb18d3db6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
* Also changes Edit Details to be an ordered list
* Also changed explanation to not include a `.` at the end;
append it in JS if needed
* Also add POST click handler to unblock the POST edit work.
Change-Id: Ifc11f8d9e0194b58cd7d81028bac19e89887c7e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133169
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>