Commit Graph

3398 Commits

Author SHA1 Message Date
Konstantin Shcheglov be0ce86f43 Run more analysis tests with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628083002 .
2017-01-11 13:35:46 -08:00
Brian Wilkerson 85b1e7abbe Revert "Add support for generic function type syntax, part 1"
Review-Url: https://codereview.chromium.org/2624283003 .
2017-01-11 13:30:52 -08:00
Brian Wilkerson 1cd918533d Add support for generic function type syntax, part 1
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2613383003 .
2017-01-11 13:12:10 -08:00
Konstantin Shcheglov e197fd81ba Replace same() with equals() in TypeAssertions.
R=brianwilkerson@google.com, leafp@google.com
BUG=

Review-Url: https://codereview.chromium.org/2623283002 .
2017-01-11 12:55:04 -08:00
Konstantin Shcheglov 799296e92b Extract x_Driver tests that time out on Windows bots.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2623253003 .
2017-01-11 11:49:34 -08:00
Konstantin Shcheglov 31f08c798a Don't instantiate a new InterfaceTypeImpl for a ClassElement without type parameters.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628013002 .
2017-01-11 11:15:40 -08:00
Konstantin Shcheglov dae3b69321 Fix the test on Windows.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2625143002 .
2017-01-11 09:39:22 -08:00
Konstantin Shcheglov 41f8d695b0 Fix an analysis error in tests.
TBR

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2622323002 .
2017-01-11 09:22:14 -08:00
Konstantin Shcheglov 73e7da4976 Run the most of error generating tests with the new analysis driver.
Some tests have more failures than I feel comfortable marking as failing.
I will triage them in following CLs.

StaticTypeAnalyzer2Test
StrictModeTest
StrongModeDownwardsInferenceTest
StrongModeStaticTypeAnalyzer2Test
TypePropagationTest

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628743002 .
2017-01-11 08:25:21 -08:00
Konstantin Shcheglov 65ff5b5e50 Explicitly compute analysis results for sources to check errors.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2625783002 .
2017-01-10 12:58:58 -08:00
Jennifer Messerly 42341c2abc fix regression to analysis_server tests
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2622953002 .
2017-01-10 11:02:32 -08:00
Konstantin Shcheglov 5a3afed30f Make error producing tests ansynchronous.
This is another preliminary test to run these tests with the new
analysis driver. Especially when we're going to replace the task based
analysis implementation with another one.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2624793002 .
2017-01-10 10:33:44 -08:00
Konstantin Shcheglov b5c5c1c222 Remove computeLibrarySourceErrors().
All errors are computed and validated in assertErrors().

In a 3 tests assertErrors() for the library was mved before the call
for a part to ensure library/part link establishment.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2626653002 .
2017-01-10 08:44:48 -08:00
Brian Wilkerson 59b025adfb Fix invalid cast
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2626463003 .
2017-01-09 16:56:59 -08:00
Konstantin Shcheglov 619033a633 Switch AnalysisDriver tests to using the physical SDK.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2624563003 .
2017-01-09 13:03:44 -08:00
Jennifer Messerly 816592a941 fixes #28236, generic methods should not cause warnings in Dart 1
Instantiate universal functions in subtype tests & tear-offs. Also updates the status files and one Analyzer test that covered the tear-off type.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2621433003 .
2017-01-09 12:46:20 -08:00
Konstantin Shcheglov 1aa52a7a80 Increment AnalysisDriver data version.
Now, when linter has been fixed, we need to stop using the old cached
resolution errors.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2618423002 .
2017-01-09 12:21:38 -08:00
Konstantin Shcheglov 5a9c5ac1ec Issue 28068. Implement diagnostics domain for the new analysis driver.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28068

Review-Url: https://codereview.chromium.org/2625493002 .
2017-01-09 12:07:15 -08:00
Brian Wilkerson d1fcb1e986 Add visitors that throw by default
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2623453003 .
2017-01-09 10:08:53 -08:00
Leaf Petersen 1ed1e1cb62 Make call methods definite.
Makes objects with call methods be treated as definite functions.
Fixes https://github.com/dart-lang/sdk/issues/28087 .

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2594873002 .
2017-01-09 04:01:57 -08:00
Leaf Petersen 83fc4b6b46 Put a TypeProvider on the TypeSystem implementations.
Adding a TypeProvider instance to TypeSystem to avoid needing to
thread it through the various APIs, and to avoid having to change
the API every time a method which previously did not need to
access the TypeSystem suddenly does.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2590883004 .
2017-01-09 02:40:10 -08:00
Konstantin Shcheglov 0377beb128 Update 'Add final field formal parameters' Quick Fix to support the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2618923003 .
2017-01-06 14:34:49 -08:00
Konstantin Shcheglov 05963058d2 Implement search for LibraryElement in its parts.
It's not the most efficient implementation though.
Probably does not matter, search for libraries should be very rare.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2619013003 .
2017-01-06 12:11:41 -08:00
Konstantin Shcheglov 429379045b Run rename-import tests with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2617213002 .
2017-01-06 11:35:29 -08:00
Paul Berry d061d39342 Reject patches that change parameter names/types or return types.
R=kmillikin@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2616993002 .
2017-01-06 09:01:26 -08:00
Konstantin Shcheglov e870bc9872 Fix for summarizing triple slash documentation comments.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2615013003 .
2017-01-05 12:30:44 -08:00
Konstantin Shcheglov d8c426bb85 Fix for resynthesizing libraries with invalid part URIs.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2615903003 .
2017-01-05 12:26:47 -08:00
Konstantin Shcheglov e6634d67f4 Issue 28149. Don't include non-Dart file into FileState.
So, these non-Dart files are not include into 'knownFiles', and we
don't attempt to request CompilationUnitElement(s) for them in search.

R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28149

Review-Url: https://codereview.chromium.org/2613683005 .
2017-01-05 10:55:35 -08:00
Jennifer Messerly 95d5bf471c fix analyzer failing resolve loop variable nodes
for example: `var item; for (item in list) { ... }`

this happens anytime ResolutionCopier is used on these, because it drops the staticElement reference for `item` in the above example.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2612983002 .
2017-01-05 10:47:43 -08:00
Dan Rubel 55ef6e193c support --options flag and other analysis options flags in DDC
This updates DDC options processing to support:
* --options /path/to/analysis/options/file.yaml
* --enable-strict-call-checks
* --supermixin
* --no-implicit-casts
* --no-implicit-dynamic

As well as general refactoring and cleanup of DDC options processing

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2598593003 .
2017-01-04 18:15:21 -05:00
Konstantin Shcheglov 305d0dff89 Set ContentCache for created AnalysisContext(s) to control its view of the world.
This should help to avoid inconsistency exceptions during Quick Fixes,
when we attempt to match element models created for a source with overlay,
and AST that AnalysisContext created for the content without overlay.

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

Review-Url: https://codereview.chromium.org/2617433003 .
2017-01-04 12:55:46 -08:00
Konstantin Shcheglov 9619a9f157 Add ContentCache.getExists() and use it in AnalysisContextImpl.exists().
This allows us to avoid direct Source IO and be able to make analysis
in an AnalysisContext hermetic.

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

Review-Url: https://codereview.chromium.org/2610063004 .
2017-01-04 12:31:46 -08:00
Bob Nystrom da16354b1b Use the function name as the location for a missing return error.
Previously, it was using the entire function node, including it's body,
which makes for a gratuitously large amount of red squiggles. :)

This uses the function's name instead. As a side effect, the error now
appears a little later for a getter:

  get foo => ...
      ^^^

Where before it was:

  get foo => ...
  ^^^^^^^^^^^^^^

I tried putting the span on "get" instead in this case because that's
closer to where the return type should go, but I think the name looks a
little better because that's the name mentioned in the error message
too.

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2609993002 .
2017-01-04 10:18:12 -08:00
Konstantin Shcheglov 606bdb519f Cache results for priority files in AnalysisDriver.
Remove corresponding caching from Analysis Server.

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

Review-Url: https://codereview.chromium.org/2611523005 .
2017-01-03 17:04:58 -08:00
Paul Berry 2805019038 Fix warnings in pkg/analyzer caused by be6a822daf
Dart's type promotion rules aren't sophisticated enough to understand
that (a is num && b is num) || (a is String && b is String) means that
it is safe to evaluate (a + b), so we have to split it into two
separate cases.

TBR=mfairhurst@google.com,scheglov@google.com

Review-Url: https://codereview.chromium.org/2605583002 .
2016-12-25 08:00:46 -08:00
Mike Fairhurst be6a822daf Support + concatenation in constant expressions with strings
BUG=
R=paulberry@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2586363004 .
2016-12-23 11:26:19 -08:00
Dan Rubel 0863ac0b2c cmdline flags override analysis options in file
Update command line arguments processing so that any analysis options
flags specified on the command line (e.g. --supermixin) take precedence
over corresponding flags in the analysis_options.yaml file.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2598523003 .
2016-12-22 20:36:01 -05:00
Dan Rubel 13bd1ad0bf DDC/AnalyzerCLI common cmdline option processing
Refactor DDC and Analyzer CLI command line option processing
to use common createContextBuilderOptions method
and ContextBuilderOptions to hold common options.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2584293003 .
2016-12-19 16:24:20 -05:00
Konstantin Shcheglov eaca15cd4d Fix analysis.getNavigation with the new analysis driver.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28125

Review-Url: https://codereview.chromium.org/2582753003 .
2016-12-16 10:52:47 -08:00
Konstantin Shcheglov 16f4045d4f Do nothing if the changed file is not known to the driver.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2579223003 .
2016-12-16 09:17:02 -08:00
Konstantin Shcheglov 7e15a96b1b Use AnalysisOptions.signature as a way to check compatibility.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2577943003 .
2016-12-15 13:01:06 -08:00
Brian Wilkerson cfcfe7a5cf Add access to FutureOr in TypeProviders (and add implementation in mock sdks)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2581803002 .
2016-12-15 12:55:54 -08:00
danrubel a105d89e2b refactor DDC and Analyzer CLI parser option declaration
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2580933002 .
2016-12-15 14:10:09 -05:00
danrubel e321439470 cleanup Analyzer CLI and DDC arg parsing
This removes the need to split arguments on '='
before calling the extractDefinedVariables method.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2581723002 .
2016-12-15 12:16:20 -05:00
Konstantin Shcheglov 0340727095 If there is a changed file, hasFilesToAnalyze is true.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2579763003 .
2016-12-15 09:13:47 -08:00
Konstantin Shcheglov 4a5d09d376 Another hermetic test for a case found in instrumentation logs.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2575353002 .
2016-12-15 09:11:25 -08:00
danrubel 5b84611856 refactor DDC to support --ignore-unrecognized-flags
* add --ignore-unrecognized-flags to DDC
* refactor Analyzer CLI to use same filterUnknownArguments functionality
* remove now unused CommandLineParser and associated tests

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

Review-Url: https://codereview.chromium.org/2578113002 .
2016-12-15 10:46:09 -05:00
Konstantin Shcheglov 3fe9a331c8 Workaround for accessing part sources while resolving a library.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/28110

Review-Url: https://codereview.chromium.org/2571373002 .
2016-12-14 14:08:23 -08:00
danrubel 2c62510f5f move CommandLineParser into analyzer for reuse by DDC
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2578733002 .
2016-12-14 16:31:45 -05:00
Konstantin Shcheglov 871f478c63 Fix for resynthesizing invalid @functionName() annotations.
It should not cause an exception and resolution failure.

R=paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/28099

Review-Url: https://codereview.chromium.org/2565173008 .
2016-12-14 10:45:21 -08:00