Commit Graph

50 Commits

Author SHA1 Message Date
Brian Wilkerson 9d7e35b417 Unmake some breaking changes made in previous CLs
Change-Id: I4c28418f8e5a3c9af7b37f44d7ebd3cd2d818c16
Reviewed-on: https://dart-review.googlesource.com/52160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 16:16:09 +00:00
Brian Wilkerson dd897d35a2 Move the task API out of the public API
Change-Id: I0fbafb4965ced89fb9a063edb773c3f1cb3a39fa
Reviewed-on: https://dart-review.googlesource.com/51242
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-16 18:18:08 +00:00
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
Brian Wilkerson f1586f3bca Remove the unused type parameter from ResultCachingPolicy
Change-Id: I858eaf7365d668bcb19ea35f6d0bbdee4b42897c
Reviewed-on: https://dart-review.googlesource.com/46160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-13 15:30:09 +00:00
Brian Wilkerson 01b024c006 Replace comment style generic method syntax with real syntax
Review-Url: https://codereview.chromium.org/2997593002 .
2017-08-08 10:34:09 -07:00
Paul Berry 4cd9b28eb6 Create pkg/front_end/src/base and begin populating with general use classes.
In the long run, pkg/front_end/src/base is intended to contain code
that is useful to many components of the front end.

In this initial implementation, it contains:
- Source and the classes it references
- ErrorCode, ErrorSeverity, and ErrorType
- SyntacticEntity

Note that AnalysisTarget is included (even though strictly speaking it
is part of the analyzer task model) because it was too hard to
disentangle from Source.

Note that Token classes remain in pkg/front_end/src/scanner for now; I
plan to reorganize them at the time the parser is moved into the front
end.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2486923007 .
2016-11-14 09:20:18 -08:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Brian Wilkerson 6c448b6938 Move exception support to its own library
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2328043002 .
2016-09-10 11:04:19 -07:00
Paul Berry 21fb12105a Fix ResynthesizerResultProvider's handling of parts.
When attempting to resynthesize a library containing parts from a
summary, ResynthesizerResultProvider needs to check whether an
analysis target comes from a summary by looking at the analysis
target's library source--this is different from AnalysisTarget.source
in the case of parts.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2093033003 .
2016-06-24 15:17:08 -07:00
Konstantin Shcheglov 979543e3a8 Issue 26629. Detect cache inconsistency in GetContentTask.
When it is detected, invalidate the outputs and throw an exception to
let Driver know that it should to recover.

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

Review URL: https://codereview.chromium.org/2050573003 .
2016-06-09 08:31:04 -07:00
Brian Wilkerson 08ce826f3b Gather and report stats on the number of times flushed results are recomputed
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2005403005 .
2016-05-26 10:58:32 -07:00
Brian Wilkerson 166f23e13f Code clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1907323002 .
2016-04-22 09:05:01 -07:00
Brian Wilkerson bf1fa31c90 Make analyzer more strong mode compliant
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1897713002 .
2016-04-16 12:28:44 -07:00
Brian Wilkerson 6dae827b70 More strong mode fixes for analyzer
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1842363004 .
2016-04-01 09:35:22 -07:00
Brian Wilkerson 5309d86424 First batch of changes to make analyzer package strong mode error free
Review URL: https://codereview.chromium.org/1808123005 .
2016-03-18 07:47:58 -07:00
Brian Wilkerson bfacd1878c Tolerate SDKs that do not include dart:async (issue 25520)
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1715563002 .
2016-02-19 07:45:54 -08:00
Brian Wilkerson a1feb55137 Replace isAppropriateFor with suitabilityFor and start using it
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1645643002 .
2016-01-27 09:26:13 -08:00
Brian Wilkerson 5a07d5c559 Add support for tasks to determine whether they are appropriate for a given target
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1633823002 .
2016-01-25 12:28:41 -08:00
Konstantin Shcheglov 2f0f398c73 Fix lints: unnecessary_brace_in_string_interp
Also fixes two cases of empty_constructor_bodies.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1521883002 .
2015-12-13 13:05:00 -08:00
Brian Wilkerson 1a5a9a7247 Clean up syntax in generic method comments
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1515533004 .
2015-12-10 10:19:15 -08:00
Brian Wilkerson 86216e5154 Consistently use implements when one interface inherits from another interface
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1481273002 .
2015-11-30 07:58:10 -08:00
Konstantin Shcheglov 5b61845221 Send any logError() information to the IDE.
I have not seen any errors sent so far after several minutes of playing with it.
Adding and removing files does not cause any errors.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1432423004 .
2015-11-12 08:16:24 -08:00
pq d12abed5d7 Last performed task diagnostics.
Adds a new block of status that reports the last 10 performed tasks.

For example:

<p>Recent Tasks</p>
GatherUsedLocalElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GatherUsedImportedElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateHintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateLintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

VerifyUnitTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryUnitErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

DartErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryErrorsReadyTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GetContentTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

GenerateOptionsErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

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

Review URL: https://codereview.chromium.org/1420783004 .
2015-10-23 10:31:26 -07:00
Konstantin Shcheglov f09778528a Use LIBRARY_SPECIFIC_UNITS instead of UNITS.
This reduces number of LibrarySpecificUnit instances from 10,000,000 to about 6,000.
Also this slightly improves the code of corresponding 'buildInputs' methods.

This saves some memory, but unfortunately does not win any performance.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1422793002 .
2015-10-23 08:31:59 -07:00
Leaf Petersen 10915a849b Library Cycle invalidation. Library cycle information on the element model was not being correctly invalidated on incremental updates to source files, since the appropriate dependencies cannot be surfaced in the task model directly. This CL adds logic to conservatively invalidate the element model information as needed.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1413273002 .
2015-10-19 17:08:07 -07:00
Brian Wilkerson 27eb09033f Clean up wording of client usage expectations
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1409353002 .
2015-10-19 07:46:49 -07:00
Brian Wilkerson 66a122a9db Stop defensively copying AST structures before resolution
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1383043002 .
2015-10-02 12:38:18 -07:00
Konstantin Shcheglov ff95a65900 Reset AnalysisDriver on priority sources changes.
It turned out that our WorkManager(s) don't have the problem we discussed.
We remove targeted results from queues only when they are VALID or ERROR.
So, reset is safe to do.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1350993002 .
2015-09-17 07:57:51 -07:00
Brian Wilkerson 24b24a3569 Reformat code to reduce churn
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1322513004 .
2015-09-09 08:19:41 -07:00
Konstantin Shcheglov 597f189eb4 Extension point for WorkManagerFactory(s).
I'm not quite happy that internal classes get into the extension point declaration.
But I guess that because of the nature of the work WorkManager(s) are doing, we have to have significant exposure to internals.

Also, onAnalysisOptionsChanged() and onSourceFactoryChanged()... these probably are better to implement as streams in InternalAnalysisContext.
Thoughts?

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

Review URL: https://codereview.chromium.org//1311773005 .
2015-08-26 09:45:19 -07:00
Brian Wilkerson db0b64475d Include more errors when computing complete list
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1171893007.
2015-06-09 13:14:17 -07:00
Brian Wilkerson 2980c8839d Improve logging performance
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1152923002
2015-05-23 09:14:31 -07:00
Paul Berry a9982b0e02 Properly handle circular references among constants in the task model.
Tasks may now override the getter "handlesDependencyCycles" to return
true to indicate that they can deal with circular dependencies.  Most
tasks will not have to do this, since outside of constant evaluation
circular dependencies among tasks should only be possible due to an
analyzer bug.

Any task that handles dependency cycles can detect that a cycle has
occurred by consulting AnalysisTask.dependencyCycle inside its
internalPerform() method.  The ComputeConstantValueTask uses this to
determine which constants are involved in the cycle.

This required modifying the TaskInputBuilder classes so that if the
current input can't be evaluated due to a circularity, they can
continue on to evaluate other inputs.  This allows the circularity to
be reported on the whole strongly connected component, rather than
just the firs cycle that was noticed (which would be
nondeterministic).

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

Review URL: https://codereview.chromium.org//1147853002
2015-05-19 12:43:28 -07:00
scheglov@google.com 2d41ec2079 Remove memento.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1132103002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45645 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 15:11:47 +00:00
brianwilkerson@google.com 9414515ba7 Remove CompositeResultDescriptor
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1136603002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45613 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 20:00:49 +00:00
scheglov@google.com a3366361de Cache flushing implementation for the task model.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1133513003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45597 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 15:50:13 +00:00
scheglov@google.com e54d46d2d8 Get memento objects from tasks, remember in cache and pass back to tasks.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1120313004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45496 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-04 17:13:31 +00:00
scheglov@google.com a707ae2282 Resolve type hierarchies for all units of the library's import closure.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1052053002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44846 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-01 22:18:32 +00:00
scheglov@google.com c37839bab1 Extract _ListTaskInputMixin and allow chaining.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1007063005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44698 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 21:23:22 +00:00
scheglov@google.com 247b3edb06 Add toMap / toMapOf / toList
Rename 'inputOf' to 'of'.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1005693007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44690 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 17:54:17 +00:00
scheglov@google.com 5c9110841e Fix hints in the analyzer package.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1026093002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44639 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-23 17:34:00 +00:00
brianwilkerson@google.com 1ff4ead0f6 Rename ContributionPoint
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1012993002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44534 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 14:52:45 +00:00
scheglov@google.com 384b8ce7f1 Compute TYPE_PROVIDER using BuildTypeProviderTask.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1009033002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44492 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-14 03:10:48 +00:00
scheglov@google.com 11f6cd218c Task: Build Directive Elements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1008433002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44436 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-12 18:27:46 +00:00
brianwilkerson@google.com 98b7382071 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//975453004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44149 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 21:34:46 +00:00
brianwilkerson@google.com 5a4919c270 Add instrumentation (issue 22572)
R=paulberry@google.com

Review URL: https://codereview.chromium.org//956103002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44071 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 19:54:36 +00:00
brianwilkerson@google.com 921e9592ad Count task frequency in new task model
R=paulberry@google.com

Review URL: https://codereview.chromium.org//914783002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43682 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 14:26:26 +00:00
brianwilkerson@google.com f16e7b8d2e Add simple Dart tasks
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//887433002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43261 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 21:56:42 +00:00
brianwilkerson@google.com 0d6228609d Improvements to task model
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//867563004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43146 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 19:47:12 +00:00
brianwilkerson@google.com a3bf271c88 Initial task support
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//812733004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43120 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 20:18:11 +00:00