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
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
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
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
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
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
danrubel
1417eec66e
move extractDefinedVariables from analyzer cli to analyzer
...
R=brianwilkerson@google.com
Review-Url: https://codereview.chromium.org/2571583007 .
2016-12-14 13:22:41 -05:00
Konstantin Shcheglov
9b210471f9
Fix for searching top-level declarations in parts.
...
R=brianwilkerson@google.com
BUG=
Review-Url: https://codereview.chromium.org/2575683002 .
2016-12-14 07:19:27 -08:00
Konstantin Shcheglov
3a422bceb7
Implement SearchEngine.searchMemberDeclarations() for the new driver.
...
R=brianwilkerson@google.com
BUG=
Review-Url: https://codereview.chromium.org/2566393003 .
2016-12-13 14:06:15 -08:00
Konstantin Shcheglov
142473b8cb
Implement SearchEngine.searchTopLevelDeclarations() for the new driver.
...
R=brianwilkerson@google.com
BUG=
Review-Url: https://codereview.chromium.org/2572603003 .
2016-12-13 12:11:22 -08:00
Dan Rubel
5aa30397d7
update DDC and analyzer cli preprocessArgs
...
* refactor Analyzer CLI and DDC to use common preprocessArgs method
* throw clear exception if trailing @file not found or cannot be read
* update preprocessArgs method to always return new list
R=brianwilkerson@google.com , vsm@google.com
Review-Url: https://codereview.chromium.org/2572813002 .
2016-12-13 14:37:22 -05:00
Brian Wilkerson
223513c81a
Fix bug when packages file changes in new driver
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2570623002 .
2016-12-12 14:03:00 -08:00
Paul Berry
3a24020c23
Fix test of incorrect SDK path.
...
R=brianwilkerson@google.com , scheglov@google.com
Review-Url: https://codereview.chromium.org/2568253002 .
2016-12-12 11:30:57 -08:00
Paul Berry
02fe40c6f7
Simplify how patch files are specified to analyzer.
...
After discussion with kmillikin@, sigmund@, and scheglov@, we decided
that specifying the patch files in libraries.dart is more complex (and
less flexible) than we'd like. This CL changes things so that the
patch files are specified in analysis options using a simple map from
library name (e.g. "dart:core") to a list of patch file paths.
Clients are now allowed to put patch files wherever they want; they
don't need to be inside the sdk directory.
Note that we no longer include the patch configuration in
encodeCrossContextOptions. This should be ok, since we don't have any
use case in which a single instance of analyzer needs to accommodate
multiple patch configurations.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2560323002 .
2016-12-12 10:15:18 -08:00
Paul Berry
fb2dbfce21
Fix analyzer's SDK detection so that during integration tests, we use the built SDK.
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2568743003 .
2016-12-12 09:49:50 -08:00
Konstantin Shcheglov
1e59cc0b9f
Remove making added files as changed.
...
This is not done (in a way) during removing files.
We just forget everything about all files.
So, we don't need an additional complication here.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review-Url: https://codereview.chromium.org/2566913002 .
2016-12-12 08:36:40 -08:00
Brian Wilkerson
b7f1a96ae5
Change the way tasks are registered
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2566893002 .
2016-12-11 15:59:46 -08:00