Commit Graph

4276 Commits

Author SHA1 Message Date
pq 0881b53a3b Error reporting for spans.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1418973002 .
2015-10-22 08:37:25 -07:00
Konstantin Shcheglov 2586267dbb Keep cache entries for explicitly added sources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1420613003 .
2015-10-21 20:15:31 -07:00
Paul Berry 9efcce02c3 Begin moving code generation tools from analysis_server to analyzer.
This CL introduces the code generation tools in analyzer, but leaves analysis_server
untouched.  In a later CL, after a new version of analyzer has been
published, I'll refactor analysis_server to point to these tools and
remove the corresponding code from analysis_server.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1411153007 .
2015-10-21 19:41:25 -07:00
pq fb8cc0aa39 Unsupported analysis option validation.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1418533004 .
2015-10-21 14:13:59 -07:00
Brian Wilkerson 63865b5d1b Possible fix for a null-pointer problem
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1408393007 .
2015-10-21 11:10:17 -07:00
Dan Rubel 417161413f Extract internal computeResultAsync method
to be used by the new completion plugin implementation

R=paulberry@google.com

Review URL: https://codereview.chromium.org/1414193003 .
2015-10-21 13:45:23 -04:00
pq 6c85fe785a Analysis Options error notifications.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1411013003 .
2015-10-21 09:59:19 -07:00
Vijay Menon ba6078197b Fix warnings on implicit casts
R=leafp@google.com

Review URL: https://codereview.chromium.org/1418653003 .
2015-10-20 16:00:21 -07:00
pq bf0ba96027 Analysis Options processing task and manager.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1413973003 .
2015-10-20 15:38:55 -07:00
Paul Berry 1a75281742 Rework handling of potentially-constant variables.
Previously, we had a mixin class PotentiallyConstVariableElement to
represent variables which might be constant.  This left some holes in
the type hierarchy which didn't implement
PotentiallyConstVariableElement but nonetheless could be reached by
constant evaluation code in the event of errors in the code being
analyzed, resulting in an invalid cast exception.

This CL drops PotentiallyConstVariableElement and moves its one getter
to VariableElementImpl so that it will be available to all variable
elements.  This allows us to avoid a lot of casts, including the one
that previously caused the exception.

Fixes #24645.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1416873003 .
2015-10-20 12:37:10 -07:00
Brian Wilkerson cc8f64b824 Do not generate warnings when noSuchMethod is inherited (issue 24337)
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1414003003 .
2015-10-20 10:35:53 -07:00
Konstantin Shcheglov 29f3baf646 Issue 24552. Disable reporting HTML parsing errors.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24552

Review URL: https://codereview.chromium.org/1418663002 .
2015-10-20 10:34:40 -07:00
Paul Berry 4e41dc0d66 Fix PackageUriResolver.restoreAbsolute on Windows
Previously, this method attempted to create a package URI by appending
part of a filesystem path to "package:"; on Windows this resulted in
nonsense URIs like "package:foo\bar.dart".

Now we transform the filesystem paths to "file:" URIs before doing other
computations; this normalizes the path separator to "/", so we can
safely use part of the resulting URIs to construct a "package:" URI.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1416863003 .
2015-10-20 09:56:24 -07:00
Konstantin Shcheglov 58937b50ef Issue 24639. Check the correct object for null.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24639

Review URL: https://codereview.chromium.org/1414733006 .
2015-10-20 09:34:23 -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 f8092a1012 Enable the new task model everywhere
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1411593005 .
2015-10-19 14:17:22 -07:00
Paul Berry f145f89ccb Create loadLibrary function element eagerly.
Previously we created this element lazily (when requested) but this
didn't work well with the new task model, because creating the element
required calling back into the context and requesting full analysis of
`dart:async` (in order to get access to the Future type), and this
could lead to reentrant task execution.

Now we explicitly create the element in ResolveLibraryTypeNamesTask,
which allows us to get the Future type from the TypeProvider, avoiding
reentrancy.

Fixes #24627.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1405963005 .
2015-10-19 13:34:20 -07:00
Konstantin Shcheglov 4249335a0e Improve incomplete for-each parsing.
Othewise a bizzare structure is returned with identifier in place of a semicolon.
It is easier for client to work with a more correct AST.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1413953003 .
2015-10-19 12:16:26 -07:00
Konstantin Shcheglov 78c7cde132 Improve recovery for local variable declarations.
We need this to improve code completion, and to *not* suggest method/keywords/etc
in cases like "main() {String s^}". Currently it is parsed as "main() {String; s^;}",
so completion cannot distinguish the variable name "s" from a of start a new expression.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1413773003 .
2015-10-19 10:24:21 -07:00
pq 140a4f5891 Register .analysis_options files for analysis.
Some oportunistic constant cleanup as well (follow-up from: https://codereview.chromium.org/1399893004/).

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

Review URL: https://codereview.chromium.org/1412213003 .
2015-10-19 09:46:54 -07:00
Brian Wilkerson b49a389fbf Add missed override
Review URL: https://codereview.chromium.org/1413823002 .
2015-10-17 08:36:54 -07:00
Brian Wilkerson 873d46cbbb Remove MissingTypeError to remove duplicate warnings (issue 24610)
R=leafp@google.com

Review URL: https://codereview.chromium.org/1413743003 .
2015-10-17 08:20:46 -07:00
Brian Wilkerson 204ee60bd0 Add a public API for the results of constant evaluation
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1410643003 .
2015-10-17 07:51:10 -07:00
Brian Wilkerson 40b38e988b Include parameter annotations in toSource (issue 24578)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1408923002 .
2015-10-16 07:41:05 -07:00
pq 91e5facc0f Registry memory leak fixes.
Fixes #24549.

A few notes:
  * does away with registry in favor of context-associated configurations
  * pulls in linter rev that does the context association
  * bumps analyzer version before publishing (needed to update analyzer_cli)

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1406043002 .
2015-10-15 14:24:20 -07:00
Brian Wilkerson d2b1edb695 Fix another place where identifiers were not being re-resolved correctly
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1409813002 .
2015-10-15 13:59:48 -07:00
Paul Berry 395b82c041 Fix additional test failures caused by cae05d6bd4
TBR=pquitslund@google.com

Review URL: https://codereview.chromium.org/1403633008 .
2015-10-15 07:06:46 -07:00
pq cae05d6bd4 Context invalidation on option changes (Implements #24574).
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1399893004 .
2015-10-14 20:42:50 -07:00
Vijay Menon 5ec298794b Fix loop var inference when iterating on a type-param type.
Fixes https://github.com/dart-lang/dev_compiler/issues/336

R=jmesserly@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1405803003 .
2015-10-14 20:05:21 -07:00
pq 888c4c526f State-carrying context API.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1403033002 .
2015-10-14 15:33:09 -07:00
John Messerly f092c247fd move strong mode hints behind flag
these test features were not supposed to be leaking into the UI

R=leafp@google.com

Review URL: https://codereview.chromium.org/1402813005 .
2015-10-13 16:46:24 -07:00
Konstantin Shcheglov a41819650e Issue 24566. Main AnalysisContext.getLibrariesContaining() should work also for SDK sources.
This also fixes IDEA's Iterable hierarchy problem.

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

Review URL: https://codereview.chromium.org/1405643002 .
2015-10-13 14:25:07 -07:00
Brian Wilkerson e6b4389f0f Partial fix for the task model issue in which analysis is not always redone when needed.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1403003002 .
2015-10-13 11:37:56 -07:00
John Messerly 0544735a60 allow computeErrors to work on non-.dart files
This is similar to the change we made recently to resolveCompilationUnit2. If someone programmatically uses the API to request resolution errors, treat it as a Dart file.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1394023004 .
2015-10-13 11:16:19 -07:00
Paul Berry ec144a055a Fix type of EninePlugin List<ResultDescriptor> getters.
These getters were improperly typed as List<TaskDescriptor>.  Due to the
fact that the underlying lists they were returning were List<dynamic>,
and the fact that new warnings for for-in loops haven't been implemented
yet (see commit 89607f06e9), no warnings
or runtime errors alerted us to the incorrect type.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1406583002 .
2015-10-13 10:45:28 -07:00
Leaf Petersen 4ca8a3f19b Strong mode checker integration. This integrates jmesserly's CL, and adds a task for computing strong mode errors and an annotated unit.
BUG=
R=brianwilkerson@google.com, jmesserly@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1396273004 .
2015-10-13 10:16:35 -07:00
John Messerly 8ae0534c1c port DDC checker code to analyzer
It's not used yet, except by its own test.

Naturally there's a *lot* to clean up here in follow ups. I tried to keep the ported code in its own directory so it's obvious. Ideally we can remove this directory once the code has been moved out.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1402783004 .
2015-10-12 12:31:00 -07:00
Sigurd Meldgaard a763c71d92 Introduce the "Embedded" category.
It is not visible from the dart2js command line.

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

Committed: https://github.com/dart-lang/sdk/commit/0aef0efb6a38a65fa676fa9e8daa85a972521745
Reverted: https://codereview.chromium.org/1401513002

Review URL: https://codereview.chromium.org/1395863002 .
2015-10-12 12:15:48 +02:00
Konstantin Shcheglov ebdfa991d4 Issue 24538. Route SDK results into SDK context DartWorkManager.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24538

Review URL: https://codereview.chromium.org/1399873002 .
2015-10-09 21:45:35 -07:00
Paul Berry 9af099fcdf Access types safely in TypeResolverVisior.visitMethodDeclaration()
Previously, when attempting to figure out the type of the synthetic
field associated with a getter (or setter),
TypeResolverVisitor.visitMethodDeclaration() used the getters
FunctionTypeImpl.returnType (or FunctionTypeImpl.normalParameterTypes)
to extract the appropriate type.  But those getters are only safe to
use after types have been fully constructed (because they may try to
perform type substitution).  Fortunately, type substitution isn't
needed here, so we can simply use FunctionTypeImpl.baseReturnType (or
FunctionTypeImpl.baseParameters) instead.

Fixes #24539.

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

Review URL: https://codereview.chromium.org/1397193002 .
2015-10-09 14:21:12 -07:00
Sam Rawlins bd8ba4b2ce Fix TODO comments; other nits
Also s/Sets/Set/ and s/Returns/Return/ for consistency.

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

Review URL: https://codereview.chromium.org/1395243002 .
2015-10-09 13:45:30 -07:00
pq 695256d586 Linter hookup into AS.
Note the TODO to fix the extension manager interaction hijinx.  Really we should ensure that we are only using the one in engine.  At the moment, it's easy to get this wrong (as the initialization heroics herein testify).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1392683003 .
2015-10-09 13:40:07 -07:00
Paul Berry 3ae9e62284 Create a breadcrumb trail for analyzing of task model extensions.
This change paves the way for modifying
pkg/analyzer/tool/task_dependency_graph.dart so that it will be able to
understand the extensibility mechanisms in the task model.
Specifically, it adds the ExtensionPointId annotation, which
task_dependency_graph.dart will be able to use to locate the
TaskDescriptors that are plugged into each task model extension point.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1401543002 .
2015-10-09 11:05:14 -07:00
Konstantin Shcheglov e1083af258 Ignore absence of DOCTYPE in HTML files.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1395033003 .
2015-10-09 10:44:03 -07:00
Konstantin Shcheglov 14ab3cae4d Fix for top level variable documention ranges.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1396693004 .
2015-10-09 10:39:46 -07:00
pq 1b6c6660f1 Lint task cleanup.
Follow-up from:

https://codereview.chromium.org/1385293002/diff/20001/pkg/analyzer/lib/src/task/dart.dart

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1386323003 .
2015-10-09 08:27:33 -07:00
Sigurd Meldgaard 01d6977030 Revert "Introduce the "Embedded" category."
This reverts commit 0aef0efb6a.

BUG=

Review URL: https://codereview.chromium.org/1401513002 .
2015-10-09 13:29:53 +02:00
Sigurd Meldgaard 0aef0efb6a Introduce the "Embedded" category.
It is not visible from the dart2js command line.

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

Review URL: https://codereview.chromium.org/1395863002 .
2015-10-09 13:08:26 +02:00
pq e19f10fbec Add context to OptionsProcessor callback API.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1392143002 .
2015-10-08 10:47:06 -07:00
Konstantin Shcheglov 9f8da95217 The (failing) test for the invalid hint / used elements problem.
The problem is that during computing RESOLVED_UNIT3 we reuse RESOLVED_UNIT2
with the previously resolved bodies. And resolver ignores already resolved
identifiers. So, this causes pointing to the stale element model, etc.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1398433004 .
2015-10-07 21:46:03 -07:00