Commit Graph

6070 Commits

Author SHA1 Message Date
Konstantin Shcheglov 6880bfca41 Cherry-pick 028ac52180 from analyzer to master.
This fixes "Evaluation of this constant expression throws an exception"
during Flutter analysis.

Initial CL: https://dart-review.googlesource.com/c/sdk/+/81750

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

Title: Enum values are always computed, compute even implicit null values of default parameters.
Change-Id: If38dde0490f04bf39119087b5f15a36272e58cab
Reviewed-on: https://dart-review.googlesource.com/c/84041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-12 19:54:18 +00:00
Konstantin Shcheglov c9ae39a9bf Issue 34741. Update error message to make it less unclear.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34741
Change-Id: If766d0aad5d87578a578849f269746a64430a68b
Reviewed-on: https://dart-review.googlesource.com/c/84100
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-12 19:00:34 +00:00
Brian Wilkerson 4534e3ea6d Use the constants defined in Experiments rather than hard coding them in multiple places
Change-Id: I56a6d93a41c5ebb8ad90ebe5c0fbce4bdb4a3ef7
Reviewed-on: https://dart-review.googlesource.com/c/84123
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-12 18:33:47 +00:00
Konstantin Shcheglov 9cf51348d4 Issue 33553. For get/set. Don't report ABSTRACT_SUPER_MEMBER_REFERENCE if the nominal superclass has noSuchMethod().
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/33553
Change-Id: Ic0e142519a839607560ae0d0e551424a9b32c954
Reviewed-on: https://dart-review.googlesource.com/c/84045
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-12 17:31:25 +00:00
Brian Wilkerson 268993acb2 Provide support for is and as expressions
Change-Id: I853fee6a868314392d37f51f8dd36e2dda319c38
Reviewed-on: https://dart-review.googlesource.com/c/84050
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-11-12 17:10:20 +00:00
Paul Berry 3ae0dcaa18 Merge commit '5ef1465c55be601f601e1f565c9b9d2f94d76aff' into analyzer
Conflicts:
	pkg/analysis_server/lib/src/analysis_server.dart
	pkg/analysis_server/lib/src/server/driver.dart
2018-11-12 06:39:27 -08:00
Johnni Winther 5cb37ff5b8 Collapse KernelToElementMapImpl hierarchy
Change-Id: Ia6e14e0890709448443c97561c8641d0379a3536
Reviewed-on: https://dart-review.googlesource.com/c/84001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-09 20:20:41 +00:00
Konstantin Shcheglov 97bb5c0e1b Fix some TODOs in MethodInvocationResolver.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I29509a71bb31f24a8d76d8ef238a5c7c5e117c5d
Reviewed-on: https://dart-review.googlesource.com/c/83885
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-09 18:14:28 +00:00
Brian Wilkerson 3a427f3294 Add an object representation for literal constant sets
Change-Id: If9ebebac0ba6891c7c5bd2398898f20a7ea82c6b
Reviewed-on: https://dart-review.googlesource.com/c/83940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-09 17:29:31 +00:00
Konstantin Shcheglov 9cbd76d2bd Issue 35090. Concrete nominal superclasses of mixin applications provide at least noSuchMethod forwarders for super-invoked members.
Bug: https://github.com/dart-lang/sdk/issues/35090
Change-Id: Id54856cb44cfb30eccaac68a2ee21f4bc9439bd2
Reviewed-on: https://dart-review.googlesource.com/c/83881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-08 22:44:46 +00:00
Brian Wilkerson a50a6c14c0 Add support for experiments to the anaysis options file
Change-Id: I79e1d50291d4cccc5e1115ae6435bae3808de059
Reviewed-on: https://dart-review.googlesource.com/c/83860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 21:44:28 +00:00
Brian Wilkerson f0f3f445a7 Add a version of getAncestor that matches by type without a closure
Change-Id: Ib10ab78284466b04b47b6480aded9d3535c79b12
Reviewed-on: https://dart-review.googlesource.com/c/83642
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 20:43:57 +00:00
Paul Berry a7bbc8e420 Remove duplicate import.
Change-Id: I9afc078bb64bf8004bef0c7c74e0980a15ef08f3
Reviewed-on: https://dart-review.googlesource.com/c/83820
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-11-08 20:09:20 +00:00
Paul Berry d076571cd9 Merge commit '35c6c79ebc052ab28efcaf045b38ff71c6ed5f3e' into analyzer 2018-11-08 09:32:18 -08:00
Konstantin Shcheglov c450bd6375 Ignore part directives that don't resolve to a file.
This fixes the issue in the internal repo, when switching resolvers
to AnalysisDriver, where missing parts are code generated, and not
available at the time when the parsed library is requested.

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

Change-Id: I77abb3b70a726a167d4ecc11849473ec037a281d
Reviewed-on: https://dart-review.googlesource.com/c/83600
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-11-08 17:16:16 +00:00
Konstantin Shcheglov 831442d0e7 Compute values of constants without AnalysisContext.getResult().
This is cherry-pick of https://dart-review.googlesource.com/c/sdk/+/81481
into the master branch.

This fixes angular_analyzer_plugin unit tests.

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

Change-Id: I432470e31b194ccd5d19d90cf0033b28f01536ba
Reviewed-on: https://dart-review.googlesource.com/c/81481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-on: https://dart-review.googlesource.com/c/83562
Reviewed-by: Paul Berry <paulberry@google.com>
2018-11-08 01:02:45 +00:00
Konstantin Shcheglov cb28c1b7f4 Issue 32815. Fix _matchInterfaceSubtypeOf().
I applied the proposed fix, seems to work.
Not sure why it was not applied from the start.
Probably because it is our code base, so we have more time for it.

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

Bug: https://github.com/dart-lang/sdk/issues/32815
Change-Id: If046300d02cd520aba6fc054c2a6dbbfce8b62f6
Reviewed-on: https://dart-review.googlesource.com/c/83561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-07 23:19:29 +00:00
Brian Wilkerson e67e66cbf3 Fix AnalysisOptions.from
Change-Id: I2bc2acb6b2816e164b82014e8c481d255c248268
Reviewed-on: https://dart-review.googlesource.com/c/83541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-07 22:38:49 +00:00
Konstantin Shcheglov 3cea05acde Don't report MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER when MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE.
Not fully the fix for the bug.

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

Bug: https://github.com/dart-lang/sdk/issues/35090
Change-Id: Ifdec0f3f839b459b613ed68486c827e7e7442372
Reviewed-on: https://dart-review.googlesource.com/c/83542
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-07 22:29:16 +00:00
Brian Wilkerson 14dec917ac Deprecate AnalysisOptions.isMixinSupportEnabled
Change-Id: If3d8cdc3618b48dc6211b6b28dc0c471d690db51
Reviewed-on: https://dart-review.googlesource.com/c/83500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-07 21:20:13 +00:00
Brian Wilkerson b8bab96369 Add a link from the options support to the process doc
Change-Id: I4c9bf99959091ed947c4134ac4c46a04e76d848a
Reviewed-on: https://dart-review.googlesource.com/c/83465
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-07 20:21:41 +00:00
Brian Wilkerson 28ff7e1e7c Add support to AnalysisOptions for enabled experiments
Change-Id: I65a1f54b9403756f6d5884879cc38ecfb4e2ff53
Reviewed-on: https://dart-review.googlesource.com/c/83463
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-07 19:01:02 +00:00
Paul Berry be7983e148 Merge commit 'c24073f442e7c7b789894ad8210aff8accc36702' into analyzer 2018-11-07 07:37:12 -08:00
Brian Wilkerson 22408c6dee Remove references to previewDart2
Change-Id: Id382dd95d3ae90d483467741b5b6d3dbc6c31ea1
Reviewed-on: https://dart-review.googlesource.com/c/83300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-07 14:52:37 +00:00
Brian Wilkerson 43bf6d0b54 Add an AST structure for set literals to analyzer
Change-Id: I1f97a0bd4c415dd679994c71cd4ba2b0a9ac8e42
Reviewed-on: https://dart-review.googlesource.com/c/83222
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-07 14:52:07 +00:00
Peter von der Ahé c24073f442 Add events for grammar-term forInitializerStatement
Change-Id: I2876085cca0e8c7e553fa14d786a2b4bd7f18470
Reviewed-on: https://dart-review.googlesource.com/c/83380
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-11-07 13:21:15 +00:00
Konstantin Shcheglov 9af769539c Issue 34387. Don't report an error when a static member is referenced in a documentation comment.
Also consolidate comment reference resolution tests.

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

Bug: https://github.com/dart-lang/sdk/issues/34387
Change-Id: I3c75c1679c7a880705e6aff9d2f5477eb81a7f11
Reviewed-on: https://dart-review.googlesource.com/c/83223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-07 00:28:37 +00:00
Konstantin Shcheglov c39df1b6db Issue 34495. Change the way unexpected elements are handled in pushInstanceCreation() of expression builder.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/34495
Change-Id: I4b56b274d33e2a274de564d3dd78f592e482e660
Reviewed-on: https://dart-review.googlesource.com/c/83200
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-11-06 22:45:42 +00:00
Konstantin Shcheglov ed03883d76 Issue 35043. Fix type instantiation for implicit new.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/35043
Change-Id: Iaff74f25cb8bb3bfea5412892932dac46157c146
Reviewed-on: https://dart-review.googlesource.com/c/83061
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-06 22:38:28 +00:00
Paul Berry 5dc2156ba4 Cherry-pick be815e1a86 to analyzer branch
Original commit message:

    [dartdevc] fix #35013, move DDC off Analyzer task model

    The new file pkg/dev_compiler/lib/src/analyzer/driver.dart handles
    building the linked summary for a build unit, and then is capable of
    doing analysis using LibraryAnalyzer.

    The algorithm is very similar to analyzer_cli's build mode. The
    biggest difference is that `dartdevc` has existing support for
    discovering source files from the explicit source list (rather than
    requiring every source to be listed on the command line). We don't want
    to break that support, so there's a bit of logic to follow imports,
    exports, and parts.

    After the linked summary is produced, DDC gets the analysis results
    (errors and resolved AST) for each library, and compiles it into a JS
    module.

Change-Id: I8d1855c27f9976cad6fd9ccb567b75a613e6048c
Reviewed-on: https://dart-review.googlesource.com/c/83060
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 21:43:42 +00:00
Konstantin Shcheglov d4ebc76d75 Fix AnalysisSessionHelper.getElementDeclaration() for elements in parts.
Accidentally triggered it while working.

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

Change-Id: I89113e5b8dc2770acdaabe763c781d89a06b4084
Reviewed-on: https://dart-review.googlesource.com/c/83160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 21:28:50 +00:00
Konstantin Shcheglov a13c22f90a Backport Parsed/ResolvedLibraryResultImpl and ElementDeclarationResult into master.
There are more Impl classes in src/dart/analysis/results.dart than
required, I decided to keep them anyway - they don't hurt anything.

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

Change-Id: I83aee3ed7423bbafcc91fba49339f5cfd9b778e9
Reviewed-on: https://dart-review.googlesource.com/c/83080
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 20:11:11 +00:00
Brian Wilkerson e78ed8c3e2 Move canBeConst from InstanceCreationExpressionImpl to LinterContext
Change-Id: I17a73c040ea15072c3e4f6cb1f2233dc003129ec
Reviewed-on: https://dart-review.googlesource.com/c/82944
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-11-06 19:35:11 +00:00
Paul Berry 57a119efed Merge commit 'd15026832117ca77a282f72cd6d7b3ab4c5fdf05' into analyzer
Conflicts:
	pkg/analyzer/lib/src/lint/linter.dart
2018-11-06 10:28:35 -08:00
Konstantin Shcheglov eeb37567af Implement Parsed/ResolvedLibraryResultImpl using AnalysisSession.
We have now these APIs in AnalysisSession, so there is no need to
repeat their implementaitons in temporary APIs.

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

Change-Id: I6f29501e2419f07ea605bc4c79d3733a3c941c49
Reviewed-on: https://dart-review.googlesource.com/c/83040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 18:04:41 +00:00
Konstantin Shcheglov 6906ce3964 Issue 33553. Don't report ABSTRACT_SUPER_MEMBER_REFERENCE if the nominal superclass has noSuchMethod().
Bug: https://github.com/dart-lang/sdk/issues/33553
Change-Id: I37ef61ed57d5a479771c7e76a78f7f6fcb99e28b
Reviewed-on: https://dart-review.googlesource.com/c/82947
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 16:41:37 +00:00
Jenny Messerly be815e1a86 [dartdevc] fix #35013, move DDC off Analyzer task model
The new file pkg/dev_compiler/lib/src/analyzer/driver.dart handles
building the linked summary for a build unit, and then is capable of
doing analysis using LibraryAnalyzer.

The algorithm is very similar to analyzer_cli's build mode. The
biggest difference is that `dartdevc` has existing support for
discovering source files from the explicit source list (rather than
requiring every source to be listed on the command line). We don't want
to break that support, so there's a bit of logic to follow imports,
exports, and parts.

After the linked summary is produced, DDC gets the analysis results
(errors and resolved AST) for each library, and compiles it into a JS
module.

Change-Id: I7bf1ce1eca73fd036002e498de5924c488b534dc
Reviewed-on: https://dart-review.googlesource.com/c/82469
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-11-06 00:52:24 +00:00
Paul Berry 85d225e3f6 Move parameter context into NodeLintRule and make it required.
This is a breaking change, so the analyzer major version number is
bumped.  However, we don't need to publish a new analyzer yet so we
use a "-dev" version number.

This breaking change requires upgrading to the latest version of the
linter package.

Change-Id: I90637068acee646c41613e7b7f7d66496bb260e9
Reviewed-on: https://dart-review.googlesource.com/c/82946
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-11-05 23:32:47 +00:00
pq d150268321 doc typo
Change-Id: I5dffd69a1bd983db5e23d0e72ed8cf6baba1b004
Reviewed-on: https://dart-review.googlesource.com/c/82886
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2018-11-05 22:14:20 +00:00
Konstantin Shcheglov 3166d6bf25 Replace ResolvedUnitCache with AnalysisSessionHelper.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ie19de8feaf82e97065d1068d0c1a06bdf3654e1d
Reviewed-on: https://dart-review.googlesource.com/c/82940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-05 20:49:44 +00:00
Brian Wilkerson 1215f239c8 Remove references to ContentCache from analysis_server
Change-Id: Ie1e107467f639e9a005c7b16055541d235ac38d8
Reviewed-on: https://dart-review.googlesource.com/c/82921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-05 18:17:57 +00:00
Paul Berry 97a51b2af2 Revert "Import path as p, in Workspace impl libraries"
This reverts commit feba863557.

Reason for revert: for now, we want this change on the analyzer branch only.

Original change's description:
> Import path as p, in Workspace impl libraries
> 
> In package_build.dart, there are several spots (builtFile(),
> builtPackageSourcePath(), ...) where `context` is called, in cases
> where I imagine the author thought there was a class member at hand
> (as is the case with PackageBuildPackageUriResolver), but these
> locations are actually using the top-level const `context` from the
> path package.
> 
> I think it is super confusing to have class members, and local
> variables, that shadow an imported top-level const. Better to import
> with a prefix.
> 
> Additionally, I unified relative/absolute checking in these files as
> assert() calls, with helpful messages.
> 
> Change-Id: I6d409636dab41959cabf392c80f64c4ec5270f7b
> Reviewed-on: https://dart-review.googlesource.com/c/82560
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com,srawlins@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I03ee1a3d3f358f8a7ac6ddad5f1b3a2e5991468f
Reviewed-on: https://dart-review.googlesource.com/c/82900
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-11-05 17:59:20 +00:00
Paul Berry b1cbfab274 Merge commit '9a1a7763f150e92e39a05519be47e581584c5de9' into analyzer 2018-11-05 04:01:07 -08:00
Brian Wilkerson 30f1c7cbab Remove references to analyzer/analyzer.dart
Change-Id: I3b3affa957ed8cc8c66f2b32c45b7dcd820f9b1e
Reviewed-on: https://dart-review.googlesource.com/c/82713
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-03 00:19:22 +00:00
Mike Fairhurst d91c030c26 Analyzer: Add a new constructor to LocalElementBuilder for dangling nodes.
To resolve `FunctionExpression`s, you must build function elements. Add
a means of using LocalElementBuilder when there is no compilation unit
element, so that the angular plugin no longer needs to override and stop
function expression resolution to avoid internal crashes.

Change-Id: I7034181633b6819f87cda32f8a59bbb99fe60ed4
Reviewed-on: https://dart-review.googlesource.com/c/82762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-11-02 23:25:32 +00:00
Konstantin Shcheglov 3f431de188 Implement AnalysisSessionHelper.getElementDeclaration() using AnalysisSession.
Also adds parsedUnit / resolvedUnit to ElementDeclarationResult, because
Analysis Server use case shows that we need them.

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

Change-Id: I845e85f658bec8fdaf3378f879e3d986a0bc01eb
Reviewed-on: https://dart-review.googlesource.com/c/82712
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-02 22:52:49 +00:00
Konstantin Shcheglov b71948faee Consolidate MockSdk(s) into one, living in analyzer/lib/src/test_utilities.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I70946b8e6f790608ad52c8f27cd6f506673f7b0d
Reviewed-on: https://dart-review.googlesource.com/c/82710
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 21:52:44 +00:00
Brian Wilkerson 94b428a130 Add utilities to replace lib/analyzer.dart
Change-Id: I04d96cdc9c78390319b2a42c000dee92f5f5685d
Reviewed-on: https://dart-review.googlesource.com/c/82661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-02 19:20:30 +00:00
Konstantin Shcheglov 2784473939 Fixes and tests for quick fixes in mixins.
I hit an exception in Analysis Server, so looked at it and related places.

R=brianwilkerson@google.com

Change-Id: Ife9bac50f8ea16aa0a092de0fdbc74c0c1534b23
Reviewed-on: https://dart-review.googlesource.com/c/82700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 18:56:49 +00:00
Konstantin Shcheglov 0eb0fd0c8e Avoid using resourceProvider.convertPath() where possible.
R=brianwilkerson@google.com

Change-Id: Ie0969ef41e2afaa8f7f8b25af1422ea26a509d79
Reviewed-on: https://dart-review.googlesource.com/c/82662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 17:53:50 +00:00