Commit Graph

7128 Commits

Author SHA1 Message Date
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
danrubel 79db30d8d0 (TBR) patch test on Windows pending investigation
dartbug.com/23762

Review URL: https://codereview.chromium.org//1219863004.
2015-07-06 12:18:16 -04: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 508e6ca49b Fix incremental resolver test
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1214853004.
2015-06-29 12:33:20 -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
Konstantin Shcheglov d693006bc6 Fix for the test.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1217853003.
2015-06-29 10:46:17 -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
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
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
Konstantin Shcheglov 4eda1a5240 Test for final top-level variables.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1204423002.
2015-06-26 09:35:35 -07:00
Brian Wilkerson c9069537d8 Get more tests passing using the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1211993003.
2015-06-26 07:43:27 -07:00
John Messerly 646eeb7af1 fix NodeReplacer for AwaitExpression
similar fix to https://github.com/dart-lang/sdk/commit/fa5b8ce45607827d12532c9f78bb30c3273094a5

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1216463002.
2015-06-25 15:00:17 -07:00
Konstantin Shcheglov d0dcb514a4 Initial version of limiting invalidation.
Work in progress.
It's nor the most optimal, nor always correct.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1204373002.
2015-06-25 11:20:17 -07:00
John Messerly fa5b8ce456 fix NodeReplacer for YieldStatement
it was missing a return, so it always fell through to the visitNode error case

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1213503002.
2015-06-25 10:59:20 -07:00
pq 09842b1508 Test cleanup.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1212533002.
2015-06-25 10:06:42 -07:00
Paul Berry ba289ecac9 Clean up and rename RESOLVED_UNIT* vars.
Now that the analysis server is no longer making use of the deprecated
RESOLVED_UNIT3, we can remove it and adjust the other RESOLVED_UNIT*
variables accordingly.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1206183002.
2015-06-24 21:03:07 -07:00
pq 2cd5cc0c50 SourceFactoryTest extraction.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1209773002.
2015-06-24 14:37:05 -07:00
Paul Berry 160645fba6 Add an analyzer method to flush resolved ASTs (for testing).
This should allow us to avoid referring to some private implementation
details of analyzer from analysis server.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1210603002.
2015-06-24 13:16:58 -07:00
Brian Wilkerson 4c2c18e49f fix resolution of URIs
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1205993002.
2015-06-24 13:09:57 -07:00
Paul Berry 19d0ea816b Remove BuildFunctionTypeAliasesTask.
There seems to be no reason to do this as a separate step from
ResolveUnitTypeNamesTask.

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

Review URL: https://codereview.chromium.org//1211523003.
2015-06-24 08:08:05 -07:00
Brian Wilkerson 563127941e Initial HTML work manager
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1200313002.
2015-06-23 13:48:08 -07:00
Brian Wilkerson a087d36d78 Deprecate old HTML support
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1200913002.
2015-06-22 09:32:18 -07:00
Konstantin Shcheglov e9c3b2d7b1 Move cache consistency validation into Analysis Server.
This speeds up the add/analyze/remove/analyze cycle from 1600 ms to
1300 ms, i.e. on about 20%.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1195183002.
2015-06-22 08:19:44 -07:00
Brian Wilkerson c891a348ab Next steps toward HTML support
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1193143002.
2015-06-21 09:21:42 -07:00
Dan Rubel f550b8d76e add file watching support
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1191933004.
2015-06-20 15:03:14 -04:00
Konstantin Shcheglov 12d4759685 Add AnalysisCache.onResultInvalidated, use in DartWorkManager.
It helps to reduce add/analyze/remove cycle from 1850 ms to 1650 ms, i.e. on about 11%.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1193993003.
2015-06-19 10:45:49 -07:00
Paul Berry 9c90a66d0d Update analyzer to reflect new rules for prefixes.
As of commit 67b99e4b33, it is now
consistently a compile error for a prefix not to be followed by '.'.
(Previously, there were two exceptions in which a prefix not followed
by '.' was treated as though it was preceded by "this.")

This CL updates analyzer to be consistent with the new spec langauge,
and modifies the tests in tests/language accordingly.

Dart2js and the VM do not yet produce the correct compile-time error
in all circumstances.  See issues #23611 and #23612.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1186033004.
2015-06-18 10:03:07 -07:00
Paul Berry 13c3c10f22 Refactor least upper bound computation; support bottom correctly.
Previously, the least upper bound code was only half-written--it
computed correct results if both types were interface types, and
otherwise returned null.  Now we always return a non-null type.

Unfortunately, the full least upper bound algorithm in the spec
requires referencing types not reachable from the types being
compared; thus in order to execute it we need access to the
TypeProvider.  We can't do this with the existing API.  So that API
has been deprecated.  The new API uses a class TypeSystem which
contains a pointer to the TypeProvider.  This new class should also be
a useful starting point in case we need to make the type system more
pluggable in the future.

Clients that use the old API will see no change in behavior--they will
still get the half-written algorithm.

Still to be addressed in future CL's:
- Deprecate getSmartLeastUpperBound.
- Fix calls to getLeastUpperBound and getSmartLeastUpperBound in analysis
  server.
- Implement least upper bound computation for function types.
- Make sure type parameters function correctly in the presence of F-bounded
  polymorphism.
- Implement shared tests.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1179343004.
2015-06-17 10:10:38 -07:00
Dan Rubel 1c1a87e820 associate @deprecated with enum element
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1162013007
2015-06-17 10:44:53 -04:00
Brian Wilkerson cb8b774fef Re-enable and add new HTML support
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1182303006.
2015-06-16 09:52:18 -07:00
Konstantin Shcheglov 96670b0e97 Fix for explicit dart:core import.
This fixes the rest of the co19/ tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1181663004.
2015-06-12 13:26:12 -07:00
Konstantin Shcheglov a16ec77494 Mix VARIABLE_REFERENCE_ERRORS into the full errors list on ChangeNotice.
This fixes 11 tests in language/ and co19/.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1179253002.
2015-06-12 12:52:15 -07:00
Konstantin Shcheglov 5538e1f105 Add self-reference sources into INCLUDED_PARTS.
It's an error of course, but unless we add it in the first place, we
cannot detect this error in the library element building task.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1183773002.
2015-06-12 12:30:09 -07:00
Konstantin Shcheglov 9634a03393 Explicitly compute library errors in tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1183723002.
2015-06-12 12:28:24 -07:00