Commit Graph

4276 Commits

Author SHA1 Message Date
Leaf Petersen a19bd39da8 First cut at abstracting over the type system. This factors out uses of isAssignableTo and isSubtypeOf into calls through a type system object. Currently there is only one kind of type system, which just falls over to the existing implementations.
BUG=
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1329743005 .
2015-09-16 14:55:59 -07:00
Konstantin Shcheglov aab6cf0b35 Produce LINE_INFO for HTML files.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1347223002 .
2015-09-16 13:28:16 -07:00
Konstantin Shcheglov 4e18780ded Tweak for incremental result updates.
The result itself is not invalidated, but everything dependent on it is.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1339603004 .
2015-09-14 13:21:16 -07:00
Brian Wilkerson 004839fc86 Fixes for the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1342903002 .
2015-09-14 13:16:08 -07:00
Konstantin Shcheglov e878562d35 Add an extension point for contributing to HTML_ERRORS.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1341723003 .
2015-09-14 12:00:39 -07:00
Konstantin Shcheglov 3ac37fd7ea Add ReentrantSynchronousStream and use it for cache invalidation events.
Also include the (just invalidated) value into InvalidatedResult.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1342543007 .
2015-09-14 11:23:16 -07:00
Sam Rawlins e3aca49123 Fix ConstantEvaluator's doc comment
ConstantEvalulator's doc comment, when parsed as Markdown and rendered at [dartdocs.org](http://www.dartdocs.org/documentation/analyzer/0.26.1%2B3/index.html#analyzer/analyzer.ConstantEvaluator), looks terrible.

I think there was a valiant effort to make it render ok, what with the <blockquote>, but in any case, it was just a blob. This fixes a few things:

* One summary sentence first paragraph.
* Make the blockquote and list into an actual blockquote and an actual list.
* Fix some un-subscripted subscripts.
* Render the HTML that was attempted by making certain list items _blocks_, by starting out with the span tags.
2015-09-13 15:05:20 -07:00
Brian Wilkerson e84d069467 Fixed the last unit test that was failing with the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1327363002 .
2015-09-11 08:47:05 -07:00
Konstantin Shcheglov 57958d7643 Keep known valid Dart results and invalidate all the other results during incremental resolution.
By doing this we invalidate Angular results, so cause their recomputing and
updating Angular specific errors and resolved ranges.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1331223003 .
2015-09-11 07:59:23 -07:00
Brian Wilkerson 5b925adf82 Addition bug fixes for new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1331843004 .
2015-09-10 08:10:29 -07:00
Konstantin Shcheglov 12614041e5 Use contributed ResultDescriptor(s) while computing DART_ERRORS.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1317213004 .
2015-09-09 15:12:41 -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 85dadad5f7 Shift AnalysisError instances only once during incremental resolution.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1302333005 .
2015-09-08 17:47:00 -07:00
Brian Wilkerson 5efe30d458 Stop propagating return types for top-level function declarations
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1309243007 .
2015-09-08 13:14:36 -07:00
Brian Wilkerson 38bf731d54 There are several improvements:
- analyzer no longer reports errors in the initializers for static variables until the final resolution
- the collection of static variables is now computed more efficiently
- an unused analysis result is no longer being computed

In addition, this fixes several (but not all) of the tests that fail when the task model is enabled.

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

Review URL: https://codereview.chromium.org//1305863011 .
2015-09-08 10:12:20 -07:00
Paul Berry 5ea1238b56 Fix handling of shortcutting expressions and asserts in ExitDetector.
Fixes #24293.
Fixes #24294.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1331433003 .
2015-09-07 12:23:33 -07:00
Konstantin Shcheglov f0cbf430e0 Issue 24298. Fix for 'async' function body conversion.
R=paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/24298

Review URL: https://codereview.chromium.org//1324323004 .
2015-09-04 21:39:28 -07:00
Konstantin Shcheglov a4138c2a5b AnalysisEngine.userDefinedPlugins setter.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1311843004 .
2015-09-04 12:23:05 -07:00
Brian Wilkerson 0bf186526c Remove obsolete resolution task
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1306323004 .
2015-09-03 14:04:49 -07:00
Brian Wilkerson b0b97813f3 Add the task to resolve function bodies
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1326553003 .
2015-09-03 08:08:53 -07:00
Leaf Petersen f90c09df48 Strong mode foreach inference. Infer the type of declared identifiers
in foreach blocks.

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

Review URL: https://codereview.chromium.org//1323513005 .
2015-09-01 17:37:58 -07:00
Brian Wilkerson fbd968c8e5 Handle cycles when infering static variables
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1319703003 .
2015-08-31 14:27:59 -07:00
Brian Wilkerson de4280fa14 Implement task to infer instance members
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1322983002 .
2015-08-31 14:23:44 -07:00
Brian Wilkerson 1463fb3ff2 Task to infer static variables
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1323653002 .
2015-08-31 11:36:43 -07:00
Brian Wilkerson d6df4d7d84 Remove use of null-aware operator until analyzer can require 1.12
Review URL: https://codereview.chromium.org//1301333007 .
2015-08-29 09:11:01 -07:00
Konstantin Shcheglov 3e9645af53 Resolve enum documentation comments.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1325513004 .
2015-08-28 14:07:13 -07:00
Konstantin Shcheglov 3d1da0f320 Add AnalysisContext.getResult()/computeResult()
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1308033008 .
2015-08-28 13:57:25 -07:00
Brian Wilkerson 7ce07af57e Implement a task to compute the dependencies between static variables
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1320923003 .
2015-08-28 11:42:15 -07:00
Brian Wilkerson 68058da1a1 Remove some order dependency in instance member inference
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1311133009 .
2015-08-28 11:31:48 -07:00
Leaf Petersen bff9b65509 Strong mode local variable inference
BUG=
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1314793005 .
2015-08-27 13:27:10 -07:00
Brian Wilkerson c3b12a65ba Add a task to partially resolve a compilation unit
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1321523002 .
2015-08-26 11:22:03 -07:00
Brian Wilkerson 335b87c701 Integrate recent parameter override logic
R=leafp@google.com, paulberry@google.com, vsm@google.com

Review URL: https://codereview.chromium.org//1311433005 .
2015-08-26 10:35:34 -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
Paul Berry 9d6898104e Fix warning in element_handle.dart.
Commit 4bd6b4b048 added the abstract
method appendToWithoutDelimiters() to ParameterElement, which is
implemented in ParameterElementMixin.  However, one derived class was
not updated to make use of the new mixin: ParameterElementHandle.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1308713004 .
2015-08-25 13:27:25 -07:00
Brian Wilkerson 4bd6b4b048 Fix display of parameter lists in servers Element structure (issue 24194)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1313113002 .
2015-08-25 09:23:26 -07:00
Brian Wilkerson 0061447293 Implements instance member inference. Records the correct return type for synthetic function elements representing initializers.
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1306313002 .
2015-08-25 07:48:49 -07:00
Paul Berry b547acc883 Band-aid fix for issue #24191.
This is sufficient to avoid throwing an exception in the resolver,
which in turn will prevent the analysis server from going into an
infinite analysis loop.

I'll work on a more complete fix (which infers the proper type in all
cases) for the next release.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1307353002 .
2015-08-24 16:05:05 -07:00
Konstantin Shcheglov 581e20d2f6 Disable incremental resolution for not BlockFunctionBody(s).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1310073002 .
2015-08-22 10:04:53 -07:00
pq 67e988bb9f No more warnings for duplicate unnamed lib imports
Fixes #24156.

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

Review URL: https://codereview.chromium.org//1305433005 .
2015-08-20 14:30:37 -07:00
pq e11ce8ba87 Handle comparison of empty URIs (sdk/24126).
Fixes issue where `.packages` provides a key mapped to an empty value (https://github.com/dart-lang/sdk/issues/24126).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1298393004 .
2015-08-19 12:53:55 -07:00
Paul Berry e10be90e76 Support older SDKs in analyzer.
In Dart 1.12, the location of the "libraries.dart" file, which
analyzer uses to find the contents of the SDK, will be changed.
However, 1.12 hasn't been released yet, so we need analyzer to
continue supporting the current stable release of the SDK.

This change causes analyzer to first look in the new location for
"libraries.dart", and failing that, fall back to the old (pre-1.12)
location.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1296033004 .
2015-08-18 14:06:49 -07:00
pq a428c4607a Disable dart2js hints by default.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1289273005 .
2015-08-18 13:04:13 -07:00
Paul Berry 8f2ed2c68d Fix most implementations of UriResolver.restoreAbsolute.
Although it wasn't previously clear in the documentation,
implementations of UriResolver.restoreAbsolute() should only depend on
Source.fullName.  To do otherwise breaks some assumptions made by
analysis server.  This CL fixes all implementations except
SdkExtUriResolver (which has been deferred to issue #24090).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1296653003 .
2015-08-18 11:32:15 -07:00
Brian Wilkerson 81fbf6af7c Initial steps toward adding strong mode to the new task model
R=leafp@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1289283004 .
2015-08-17 17:07:50 -07:00
Vijay Menon ba4f9d8246 Add forwarding for DefaultFormalParameter metadata
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1287413003 .
2015-08-14 12:42:40 -07:00
John Messerly 6417c36b0a [analyzer] remove "auto-generated do not edit" comments
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1291143002 .
2015-08-13 13:36:02 -07:00
danrubel da92573117 fix sorting of compilation unit members - related to #23947
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1281793004 .
2015-08-11 14:24:37 -04:00
Brian Wilkerson f05106f7d1 Fix ToStringVisitor to handle external functions (issue 23968)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1269393002 .
2015-08-05 08:27:52 -07:00
Brian Wilkerson 908708d655 More fixes for failures on the Windows bot
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1266923004 .
2015-08-05 08:13:28 -07:00
Brian Wilkerson 58199fbad9 Propagate a type in asynchonous for-in statements (issue 23945)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1268733004 .
2015-08-03 17:23:35 -07:00