Commit Graph

8489 Commits

Author SHA1 Message Date
Konstantin Shcheglov 8eb0de07f3 Issue 23919. Fix for line starts in multiline comments.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/23919

Review URL: https://codereview.chromium.org//1271553002 .
2015-07-31 08:33:38 -07:00
pq 587697ea02 Ensure actual URIs are properly processed.
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1262213002 .
2015-07-29 13:16:15 -07:00
Paul Berry fcfea00af8 Implement DEP 34 (less restricted mixins) in analysis engine.
The feature is disabled by default; enable it by setting the option
"enableSuperMixins".  (This name was chosen to match the
"--supermixin" flag accepted by the VM).

The feature is not yet exposed through analysis server or the
analyzer_cli.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1262163002 .
2015-07-29 08:50:49 -07:00
Brian Wilkerson 2ec502a583 Code clean-up, mostly constructors
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1265453005 .
2015-07-28 11:12:51 -07:00
Paul Berry 0e98c58190 Fix analyzer interpretation of 'ClassName?.staticMember'.
Previously, trying to access a static member of a class using '?.' was
not allowed.  But the spec was changed in
b11670f899 so that
'ClassName?.staticMember' is now equivalent to
'ClassName.staticMember'.

This CL updates analyzer to follow the spec, and updates the tests in
"tests/language" accordingly.  VM and dart2js still need fixing
(see #23794 and #23795).

Fixes #23464.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1255293005 .
2015-07-28 09:49:35 -07:00
Kevin Moore 6ba9aebc3f pkg/analyzer: document alternative to deprecated api
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1242263008 .
2015-07-23 17:22:00 -07:00
Brian Wilkerson 673b94c489 Fix highlight range for missing enum constant in switch (issue 23904)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1252123004 .
2015-07-23 09:30:43 -07:00
John Messerly de7f38ccc5 analyzer: ResolutionCopier.visitAwaitExpression now copies *Type fields
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1249113003 .
2015-07-22 14:10:52 -07:00
pq f013d3868c Actual URI support for package URI resolution.
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1245263002 .
2015-07-21 15:53:56 -07:00
John Messerly 646c84762d few small analyzer fixes
ResolutionCopier.visitLibraryDirective now copies its element

AstCloner.visitVariableDeclarationList now copies the comment.
(otherwise ResolutionCopier thinks the tree structure doesn't match)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1240283004 .
2015-07-21 12:42:56 -07:00
Brian Wilkerson f241b383a9 Implement a strong-mode option in analyzer
R=jmesserly@google.com

Review URL: https://codereview.chromium.org//1241243003 .
2015-07-20 12:30:05 -07:00
Brian Wilkerson bc265ebe28 Implement support for watching directories containing implicitly analyzed files
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1244613004 .
2015-07-20 09:04:37 -07:00
John McCutchan 977d213344 Refactor AnalysisOptionsProvider
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1245513002 .
2015-07-17 15:17:40 -07:00
John McCutchan 4bf66ce912 Add an AnalysisOptionsProvider to analyzer
BUG=
R=pquitslund@google.com

Review URL: https://codereview.chromium.org//1231633011 .
2015-07-17 13:34:03 -07:00
Brian Wilkerson d37ac8d4d0 Fixed bug in implicit analysis notification and renamed tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1236013003 .
2015-07-17 12:43:59 -07:00
John McCutchan c9dd867c1f Add path filter
BUG=
R=pquitslund@google.com

Review URL: https://codereview.chromium.org//1232763004 .
2015-07-17 10:06:29 -07:00
Brian Wilkerson 503e2b68f1 Add hook for listening to implicitly analyzed files
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1239863002 .
2015-07-16 08:10:38 -07:00
Paul Berry 4b83219847 Switch on null-aware operators by default in analyzer.
Patches to update analyzer_cli and analysis_server will follow once a
new version of analyzer has been published.

BUG=dartbug.com/23793
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1239513005 .
2015-07-13 15:56:21 -07:00
Brian Wilkerson 4d2bb64183 Generic method support in element model
R=leafp@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1217373005 .
2015-07-10 13:53:35 -07:00
pq a81c308283 Analyzer code cleanup.
Removed some unused imports and fixed member sorting.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1230273002 .
2015-07-10 13:42:27 -07:00
John McCutchan 7abe54a857 Move from .sdkext to _sdkext
Reason: Pub does not publish dot files.

Review URL: https://codereview.chromium.org//1224103003 .
2015-07-08 16:33:09 -07:00
John McCutchan 13deb397a0 Second attempt at fixing SdkExtUriResolver.restoreAbsolute
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1229563006 .
2015-07-08 12:50:38 -07:00
John McCutchan 6ecf960c5e Move SdkExtUriResolver from analysis_server to analyzer so it can be used in analyzer_cli
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1214823003 .
2015-07-08 10:28:19 -07:00
pq 81f8d4fa54 Fix for URI resolution w/ file scheme set in package map.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1224693014 .
2015-07-08 09:18:04 -07:00
Brian Wilkerson 27f600058e Improve propagation in binary expressions
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1226823003 .
2015-07-08 08:02:05 -07:00
Konstantin Shcheglov aa4efb8c6e One more fix for making removing overlays incremental changes.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1214853028 .
2015-07-07 14:51:44 -07:00
pq 01af0560bb Package map source factory support [FIXED].
A rework of https://codereview.chromium.org/1206323005/ with better handling of the case where a .packages config file is not specified.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1223833008 .
2015-07-07 09:10:54 -07:00
pq bb196a27fc Revert "Package map source factory support."
This reverts commit e3a4ff55d7.

BUG=

Review URL: https://codereview.chromium.org//1228493003.
2015-07-06 11:45:32 -07:00
pq e3a4ff55d7 Package map source factory support.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1206323005.
2015-07-06 11:13:17 -07:00
Konstantin Shcheglov 2a2259aec7 Try to use incremental resolution after removing overlays.
Mostly for IDEA, because Editor updates overlays before removing them.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1218573003.
2015-07-06 09:19:26 -07:00
Brian Wilkerson 773c0cfc14 Exclude members from Object when adding members from mixins (issue 23606)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1216393002.
2015-07-01 09:41:41 -07:00
Paul Berry cf790b0829 Clean up constructors for ScopedVisitor and derived classes.
Previously, the classes ScopedVisitor, ResolverVisitor,
TypeResolverVisitor, and VariableResolverVisitor each had 4
independently maintained constructors, used respectively by
LibraryResolver (and DDC), the task model, the incremental resolver,
and LibraryResolver2.  This was difficult to maintain, and it was
about to get worse with the introduction of diet resolution.

This CL merges the constructors into one, using named optional
parameters where possible to reduce the burden on callers.

A few of the old constructors are kept on a temporary basis because
they are used by DDC, but they are deprecated; these can be removed
once DDC resolution is fully integrated with analyzer.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1207383005.
2015-06-30 15:37:17 -07:00
Konstantin Shcheglov 5bcd357802 Invalidate both hints and lints on incremental resolution.
We don't have new LINTS result descriptor yet, once we have, we need
to update the new AnalysisContext implementation.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1222433003.
2015-06-30 15:31:36 -07:00
Konstantin Shcheglov 18b3ab0c58 Dispose private cache partition on AnalysisContext.dispose().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1211993004.
2015-06-30 15:29:32 -07:00
Paul Berry 7671bce82a Compute mixin application constructors in the ClassElement.constructors getter.
Previously we computed them during resolution, but this created a
problem: since the set of constructors for a mixin application depends
on the constructors in the superclass, and the superclass might itself
be a mixin application, it might theoretically be necessary to analyze
all files in the transitive import/export closure before it is
possible to compute the set of constructors for a class.  As a result,
in order to produce completion results after a non-incremental change
to file X, we have to re-analyze the entire transitive closure of
files importing or exporting X.  This takes prohibitively long.

This change moves the computation into the ClassElement.constructors
getter.  The computation is not cached, so now a change to file X only
requires rebuilding the element models for files directly importing X
(or directly importing files that contain X in their transitive export
closure).

Since the result of the computation is not cached, this will produce
an increase in analysis time, however since mixin applications are
used so rarely, the performance impact should be negligible.

Fixes #23732.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1215053003.
2015-06-30 07:35:26 -07:00
Brian Wilkerson e575dfe1d8 Remove dead code for an unused (old) task
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1215433008.
2015-06-29 13:23:38 -07:00
Brian Wilkerson 0513859704 Re-implement the status page for the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1211243003.
2015-06-29 12:20:19 -07:00
Sigmund Cherem b18c5a3e7c sdk files reorganization to make dart2js a proper package
BUG=
R=brianwilkerson@google.com, floitsch@google.com, whesse@google.com

Review URL: https://codereview.chromium.org//1212513002.
2015-06-29 10:21:14 -07:00
Paul Berry 21b65e700b Split BuildSourceClosuresTask into two tasks; remove unnecessary computation.
This splits BuildSourceClosuresTask into BuildSourceExportClosureTask,
which produces EXPORT_SOURCE_CLOSURE, and
BuildSourceImportExportClosureTask, which produces
IMPORT_EXPORT_SOURCE_CLOSURE.  IMPORT_SOURCE_CLOSURE is no longer
computed, since it was not being used.

This should reduce the amount of analysis work that needs to be rerun
before we can produce code completions, since we will no longer have
so recompute the import/export source closure (which could potentially
need recomputation for a large number of files) until just prior to
ResolveUnitReferencesTask, which in theory doesn't need to run in
order to produce code completions.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1220743004.
2015-06-29 10:13:09 -07:00
Konstantin Shcheglov 8dc7502884 Try incremental analysis before limiting invalidation.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1220633003.
2015-06-29 10:00:52 -07:00
Paul Berry 46c0a977fa Make BuildSourceClosuresTask explicitly dependent on LIBRARY_ELEMENT2.
Previously the dependency was a private implementation detail of
_SourceClosureTaskInputBuilder, which made it difficult to statically
analyze the input/output relationships between tasks in the task
model.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1216523003.
2015-06-29 09:46:23 -07:00
Brian Wilkerson 09fd112781 Add parsing support for generic methods
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1216873002.
2015-06-29 08:39:15 -07:00
Konstantin Shcheglov 9f00e05918 Remove REFERENCED_NAMES result for ResolveUnitReferencesTask.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1212113004.
2015-06-27 11:26:20 -07:00
Paul Berry 967d4b3820 Tighten up dependencies in the task model.
- ResolveLibraryTypeNamesTask doesn't need to depend on RESOLVED_UNIT3
  for all sources in the transitive closure of imports; it only needs
  RESOLVED_UNIT3 for the units constituting the current library.

- ResolveVariableReferencesTask doesn't need to depend on
  LIBRARY_ELEMENT6 for all libraries in the transitive closure of
  imports, because it only resolves references to locals and
  parameters, and they can only resolve to elements in the same
  compilation unit; the transitive closure is not needed until
  ResolveUnitReferencesTask.

- ResolveVariableReferencesTask doesn't need LIBRARY_ELEMENT6 of the
  current library, since it only needs the LibraryElement to
  initialize the scope chain; LIBRARY_ELEMENT1 is sufficient.

- ResolveVariableReferencesTask doesn't need RESOLVED_UNIT3 of the
  current library, since it only needs to ensure that the elements for
  locals and parameters have been built; RESOLVED_UNIT1 is sufficient.

This should help reduce the amount of analysis which has to be
performed before code completions can be produced.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1212503004.
2015-06-26 21:56:20 -07:00
Brian Wilkerson fd0a53b27c Remove last failing test and minor clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1215723004.
2015-06-26 15:03:57 -07:00
Brian Wilkerson f95fb0d0e4 Fix another new task model test
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1212973003.
2015-06-26 13:05:35 -07:00
Paul Berry db6c95502a Work around naming conflict in analyzer's Resource class.
Commit f8ce36df55 introduced an SDK
class called "Resource", causing warnings to appear in any files that
reference the analyzer class with the same name.  (Fortunately there
was no regression in functionality since the spec requires the name
conflict to be resolved in favor of the definition that is outside the
SDK).

As a short term workaround to avoid the warnings, we are explicitly
importing 'dart:core' and hiding the new Resource class.  In a future
CL, we plan to rework analyzer's Resource class in order to make some
changes necessary for ".packages" file support; when that happens we
will probably rename the class to avoid the name conflict.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1215753003.
2015-06-26 13:00:44 -07:00
Brian Wilkerson 3b48abedfd AST changes necessary for generic method support
R=leafp@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1212683002.
2015-06-26 12:07:39 -07:00
Brian Wilkerson 86d0309c65 Remove incrementalAnalysisCache and fix more tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1219503003.
2015-06-26 10:54:44 -07:00
Konstantin Shcheglov b2ef3f1934 Don't remove ResultData(s) for incrementally updated results.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1218503003.
2015-06-26 09:39:15 -07:00