Commit Graph

19 Commits

Author SHA1 Message Date
Brian Wilkerson 1560f19844 Fixes to make analyzer preview-dart-2 safe, part 1 of many
Change-Id: I8f88168a1fab61b3d0d808b5d9e09e6391325302
Reviewed-on: https://dart-review.googlesource.com/46953
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-19 13:15:46 +00:00
Konstantin Shcheglov bf25080cc1 Replace typed_mock with mockito in analyzer.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2991913002 .
2017-07-27 16:15:17 -07:00
Brian Slesinsky ef48584f1f Fix package URI calculation when in third_party but not third_party/dart
In this case we should use a dotted package name, similar to other
packages outside third_party.

Previously, restoreAbsolute() didn't return a package URI at all,
which would result in a relative path being suggested for a
missing import.

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2771323002 .
2017-03-24 16:59:41 -07:00
Paul Berry c6ad6fa114 When analyzing a Bazel/Blaze workspace in which no build has been run, assume Bazel.
Previously we were returning `null`, causing all package resolution to fail.

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2506753002 .
2016-11-16 09:52:35 -08:00
Paul Berry 7336101b28 Change BazelWorkspace so that it checks the main source directory before READONLY.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2502103003 .
2016-11-15 15:21:47 -08:00
Konstantin Shcheglov 4511504171 Implement BazelPackageUriResolver.restoreAbsolute().
It is mostly tested with the same tests as for resolveAbsolute().

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2403733002 .
2016-10-10 08:16:00 -07:00
Konstantin Shcheglov 78051dc47d Add more tests for BazelPackageUriResolver.resolveAbsolute().
Create separate set of resources in each test in order to simplify the
tests.

Fix the case when files are generated for third_party/dart/XXX.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2403723002 .
2016-10-09 14:40:18 -07:00
Konstantin Shcheglov 51f617c0d3 Automatically identify the workspace suffix for READONLY.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2406603002 .
2016-10-07 14:24:10 -07:00
Konstantin Shcheglov 5e5f3cfa60 Automatically detect 'blaze' or 'bazel' symlink prefix.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2401993002 .
2016-10-07 13:08:13 -07:00
Konstantin Shcheglov 84b1a98173 Replace BazelWorkspace factory with the static 'find' method.
This is a breaking change:

1. The factory constructor was removed.
2. The method find() may return null.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2402713002 .
2016-10-07 10:15:32 -07:00
Konstantin Shcheglov f63b3d3e7b Add BazelPackageUriResolver with resolveAbsolute().
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2393963004 .
2016-10-07 09:19:53 -07:00
Paul Berry f9c819057b Fix null reference issues in bazel.dart.
There were two issues:

- We were trying to use `parent` before null checking it.

- In the event that no workspace root could be found, we were returning
  `null` from the BazelWorkspace factory constructor.  This CL changes
  the behavior so that we return a BazelWorkspace that has no special
  bin or genfiles behaviors.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2394213002 .
2016-10-06 14:21:17 -07:00
Konstantin Shcheglov 5455fd0118 Remove 'initializeTestEnvironment' from 'analyzer'.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2399913002 .
2016-10-06 10:18:54 -07:00
Konstantin Shcheglov 175dad4f15 Switch 'analyzer' to 'package:test' and test_reflective_loader ^0.1.0.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2391423003 .
2016-10-06 08:46:35 -07:00
Konstantin Shcheglov 8a3d8eee67 Add BazelWorkspace and move BazelFileUriResolver to it.
R=brianwilkerson@google.com, jwren@google.com
BUG=

Review URL: https://codereview.chromium.org/2393813003 .
2016-10-05 18:08:07 -07:00
Brian Wilkerson a52e53a3b2 Fix BazelFileUriResolver tests
R=jwren@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2392133002 .
2016-10-04 14:17:18 -07:00
Konstantin Shcheglov cc6beaf56d Pull in test_reflective_loader 0.0.4 and switch analyzer to it.
There are following changes:

1. DEPS to pull in test_reflective_loader 0.0.4
2. Rename runReflectiveTests() to defineReflectiveTests().
3. Remove analyzer's pkg/analyzer/test/reflective_tests.dart
4. Replace reflective_tests.dart imports with package:test_reflective_loader/test_reflective_loader.dart imports.
5. Sort/format and organize imports in the files with imports changes.
6. Fix for a couple of bugs in analysis_server exposed by the new loader.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2298913003 .
2016-08-31 13:46:39 -07:00
Jaime Wren 279b2e39f6 Fix C&P error, rename ResourceUriResolverTest to BazelFileUriResolverTest
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2082813002 .
2016-06-20 14:39:02 -07:00
Jaime Wren b7aff9c72f Initial Bazel file resolver support.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2079873002 .
2016-06-17 14:20:55 -07:00