Commit Graph

25510 Commits

Author SHA1 Message Date
Konstantin Shcheglov fe585471e3 Add DartFileEditBuilder.importLibraryElement().
R=brianwilkerson@google.com

Change-Id: I83e0f58bce36660d15c477f100fdb4052b3bb672
Reviewed-on: https://dart-review.googlesource.com/c/91687
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-01 22:59:05 +00:00
Konstantin Shcheglov 460d69d08f Update 'Convert to StatefulWidget' to create private State classes.
R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/1438
Change-Id: I9415423f6d80e5d91165a796ec2bc9d86522d56f
Reviewed-on: https://dart-review.googlesource.com/c/91842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-01 22:58:45 +00:00
danrubel 509ac0648c Update non-nullability migration algorithm to handle missing types
Change-Id: Ia2bcf923be0cfd1c7e94112e6516a10d13d5a4ca
Reviewed-on: https://dart-review.googlesource.com/c/91861
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-01 20:59:41 +00:00
Konstantin Shcheglov 00c6f6b584 Document InheritanceManager deprecations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/linter/issues/1405
Change-Id: I27cfe111a65c1844a1bfd9d6479cd89ba30f6cb3
Reviewed-on: https://dart-review.googlesource.com/c/91840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-01 18:03:32 +00:00
Paul Berry 3802a6d7eb Experimental prototype of a non-nullability migration algorithm.
Change-Id: Idda9b596d612953f4f370f220729f419b1f673e1
Reviewed-on: https://dart-review.googlesource.com/c/91380
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-02-01 17:55:37 +00:00
Konstantin Shcheglov 931051814c Partial implementation of the 'available suggestion sets' protocol.
R=brianwilkerson@google.com

Change-Id: I856b6a39c2464caf6750e0b0abb0cfa29311e97c
Reviewed-on: https://dart-review.googlesource.com/c/91769
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-01 17:55:27 +00:00
danrubel 1c173c2ce7 Enhance dartfix to allow including and excluding specific fixes
This add several options to the dartfix command line
so that only specific fixes can be applied rather than all fixes.

Fix https://github.com/dart-lang/sdk/issues/35539

Change-Id: I8bb89696b0b47a291ed22aa00d4787f3ea5aa4be
Reviewed-on: https://dart-review.googlesource.com/c/91780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-01 16:55:17 +00:00
Dmitry Stefantsov 971733a08b [kernel] Add a class to track variance of type parameters
Change-Id: Ib03f5be2a3a4a2e7e81bc573b7865e9cefe75e7e
Reviewed-on: https://dart-review.googlesource.com/c/85080
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-02-01 13:14:36 +00:00
Peter von der Ahé 967b5fbac3 Finish implementing IsFunctionSubtypeOf
Change-Id: I5bd0aa4cbf2e5e16771bbfe8bd2d4ee3f8de2862
Reviewed-on: https://dart-review.googlesource.com/c/91820
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-02-01 13:07:57 +00:00
Peter von der Ahé 0d7bdd734a Ensure that top types are equivalent.
Change-Id: I7555a2b505aa750bff6f0050279fbe52608ed760
Reviewed-on: https://dart-review.googlesource.com/c/91800
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-01 13:07:57 +00:00
Peter von der Ahé d44724d0af Compute default type arguments in Fasta types.
Change-Id: Ifc8ab4dedebf1180af7ccaa65dd0ef35fcb37329
Reviewed-on: https://dart-review.googlesource.com/c/91744
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-01 13:07:57 +00:00
Peter von der Ahé d55f95e344 Add Types.isSameTypeKernel
Change-Id: I4acc0ae4cde4fd9b02efb690b23c93146f686ac6
Reviewed-on: https://dart-review.googlesource.com/c/91721
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-01 13:07:57 +00:00
Peter von der Ahé 7fa0376af7 Implement subtype rules for Null in Fasta types
Change-Id: I5ca9e1b16a463ad8101139769b189f3e9d00c52c
Reviewed-on: https://dart-review.googlesource.com/c/91720
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-01 13:07:57 +00:00
Jens Johansen d9072d5272 Re-issue all problems in the incremental compiler
Prior to this change, old problems (warnings, errors, etc) would not be
re-issued for files not actually recompiled when recompiling.

As an example, not making any change and recompiling it would seem like
everything was good.

With this change, all problems should be issued again.

Change-Id: Ia410edba27438d8a2f1842d9f4d81d0592571101
Reviewed-on: https://dart-review.googlesource.com/c/91747
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-01 12:49:57 +00:00
Peter von der Ahé b6dc18e21e Remove legacyMode parameter and delete obsolete version of test
Change-Id: Ie50c43641279f9f33e7e9fffb57e6017e4d96b98
Reviewed-on: https://dart-review.googlesource.com/c/90946
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-02-01 11:51:06 +00:00
Peter von der Ahé 33f167b039 Complete the implemention of IsInterfaceSubtypeOf.
Change-Id: I0be7af83508536c40ce0e6cdbb0d54d4d8e9dd8b
Reviewed-on: https://dart-review.googlesource.com/c/90945
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-01 11:51:06 +00:00
Peter von der Ahé 534825020a Check intersection types in subtype tests
Change-Id: Ib24c11272370c54428c92b2d09fda6e3b29907de
Reviewed-on: https://dart-review.googlesource.com/c/90943
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-01 11:51:06 +00:00
Peter von der Ahé ea0d98d98a Check FutureOr in subtype tests
Change-Id: I1cb401b3e6fdcfc103769380a4297c6ff2c0b6b0
Reviewed-on: https://dart-review.googlesource.com/c/90940
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-01 11:51:06 +00:00
Jens Johansen 014124e763 (Some) DiagnosticMessages can be serialized to/from json.
This is needed to serialize and deserialize problems to dill and
re-issuing problems as needed.

Change-Id: Id22d1c86f43b1b08c5e5a4d133869075e9b0c100
Reviewed-on: https://dart-review.googlesource.com/c/91743
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-01 11:07:27 +00:00
Jens Johansen eb956a2516 Add synthetic bit to Library flags
Fasta can generate synthetic libraries.
Previously we didn't include them when serializing, but that leaves
references in the binary to libraries that doesn't exist which isn't
ideal.

This change includes them, and adds a flag to kernel Libraries such that
we know they are synthetic.

Change-Id: Ied25a21cd1f384d318347021bc7ec18dae3a4e05
Reviewed-on: https://dart-review.googlesource.com/c/91722
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-01 11:00:26 +00:00
Jens Johansen e9597684fe Fix for incremental compiler swallowing certain errors
Prior to this change, problems issued in hierarchy.mixinInferrer could
be swallowed up because it was reported through a wrong loader that
had already issued the error.

Change-Id: Iecbc180ca8a0bfaa73db202e4cba9755812d1e3b
Reviewed-on: https://dart-review.googlesource.com/c/91746
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-02-01 10:59:26 +00:00
Johnni Winther 68d110ac2a Add test for codegen of optional parameters on native functions.
Change-Id: Ice329d52be74f98653e5434b148b2b2c8f46c7d6
Reviewed-on: https://dart-review.googlesource.com/c/91661
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-01 09:23:55 +00:00
Stephen Adams 37a1f79360 [dart2js] Move letBindings to StackFrame
This makes letBindings safe for recursive inlining.

Change-Id: I1ffddbc33f75a62c651adf7b6166e2695556578a
Reviewed-on: https://dart-review.googlesource.com/c/91243
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-01 01:31:52 +00:00
Konstantin Shcheglov d6f9d2da6f Add pkg/analysis_server/pubspec.yaml so that it is identified as a pub package.
We use this file to get regular and dev dependencies, and suggest
available declarations in correct parts of packages, e.g. lib/ can
only access declarations from regular dependencies, but test/ can
access both regular and dev dependencies.

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

Change-Id: Id92cae07485b21af750318a58056a11262cf1799
Reviewed-on: https://dart-review.googlesource.com/c/91762
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 22:26:59 +00:00
lambdabaa d4b8e0696d Add the capability in analysis server protocol for clients to express
interest in receiving not yet imported code completions from specific
packages and libraries.

The design of this interaction aims to avoid forcing analysis server
to send every public symbol from dependent packages at every completion.
Instead, clients express interest in certain packages and/or libraries
and analysis server will notify with the entire set of symbols for
each of them only once. Then it is the client's responsibility to save
these pre-computed completions in memory, and analysis server can
instruct the client on how to union them with the base set of completion
suggestions at code completion time.

Bug: https://github.com/dart-lang/sdk/issues/35680
Change-Id: I42c6fddc5d8daa2b546daa81456c0992e3ef547d
Reviewed-on: https://dart-review.googlesource.com/c/90125
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 19:56:18 +00:00
Paul Berry 7a95930bee Add a "summary-deps-output" option to build mode.
Change-Id: Ia63d260ba3dc9f15df2c6e49a95e5c20952557cd
Reviewed-on: https://dart-review.googlesource.com/c/91764
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-01-31 18:33:08 +00:00
Paul Berry 20fc81470e Fix override_on_non_overriding_method hint
Change-Id: I9a53115b5542abe0791324f26449dc210662d096
Reviewed-on: https://dart-review.googlesource.com/c/91763
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 18:06:35 +00:00
Kevin Moore ca4978e363 Add pkg:analysis_tool as an SDK-only set of utils
Reduces the API surface of pkg:analyzer that requires pkg:html

Related to https://github.com/dart-lang/sdk/issues/35802

Change-Id: Icd08d76190d6ab77cd180561cdde6df254b22557
Reviewed-on: https://dart-review.googlesource.com/c/91701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2019-01-31 16:52:05 +00:00
Konstantin Shcheglov e5164be27e Issue 35127. Fixes for mixin implements / overrides.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/35127
Change-Id: I5869175cee13b6e22ce25c2d361b0b1aa52efe48
Reviewed-on: https://dart-review.googlesource.com/c/91690
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 16:01:55 +00:00
Brian Wilkerson c31627b778 Remove the unused TypeOverrideManager
Change-Id: I031c2777e6b9d5cfd46bc0bc1978dfde95a316b7
Reviewed-on: https://dart-review.googlesource.com/c/91692
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 15:19:05 +00:00
Konstantin Shcheglov 485a41bb12 Include superclass constraints into mixin type suggestions.
R=brianwilkerson@google.com

Bug: https://buganizer.corp.google.com/issues/123231336
Change-Id: I0e1ce9a332f47211ef2614ae73009433d1839ba0
Reviewed-on: https://dart-review.googlesource.com/c/91691
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-31 15:12:15 +00:00
Brian Wilkerson 8f12035f36 Clean up the diagnostic tests
Change-Id: I0c9e962246d4c83036f91ba49b0a28dd9d1c3c4b
Reviewed-on: https://dart-review.googlesource.com/c/91688
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 14:57:05 +00:00
Peter von der Ahé d6608f19c0 Check function types in subtype tests
Change-Id: I27b38e2a6edc67e13662aa16da2fde13dc2501e9
Reviewed-on: https://dart-review.googlesource.com/c/90922
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-31 08:58:10 +00:00
Peter von der Ahé a6a9d4854b Start checking type arguments in subtype tests
Change-Id: I4832eac17be7129cfe846df0f088e59b8fa9cd6c
Reviewed-on: https://dart-review.googlesource.com/c/90921
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-31 08:58:10 +00:00
Peter von der Ahé dd70ecd5c0 Substitute type variables when computing class hierarchy
Change-Id: Ic447c2ae8aaa0bc033749de68bc6a93f6e6fcb1e
Reviewed-on: https://dart-review.googlesource.com/c/90741
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-31 08:58:10 +00:00
Peter von der Ahé 85c5082cf4 Support Kernel classes in ClassHierarchyBuilder
Change-Id: I0de3cc8c1e51aa3b429fd5aba3cdf7e0e5281154
Reviewed-on: https://dart-review.googlesource.com/c/90706
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-31 08:58:10 +00:00
Peter von der Ahé 18ff842341 Start testing Fasta types implementation
Change-Id: I93a95319cc6390beaddc36a2b35737a097096fda
Reviewed-on: https://dart-review.googlesource.com/c/90705
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-01-31 08:58:10 +00:00
danrubel db44a727e5 Extend the edit.dartfix protocol
This CL extends the dartfix protocol to allow specifying which
fixes should be applied. In summary:

* includedFixes - list of fix names to be applied
* includeRequiredFixes - bool indicating required fixes should be applied
* excludedFixes - list of fix names that should not be applied

Given that the client can specify the fixes to be included/excluded,
then the dartfix cmdline help text should include the list of known fixes.
Rather than hard code this in the dartfix client, a new edit.getDartfix
request has been added to return the list of known fixes.

Change-Id: I319f6f405a5d29757bf28b70b778a449f901bbef
Reviewed-on: https://dart-review.googlesource.com/c/91700
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 01:53:32 +00:00
Sam Rawlins 6c96d8fdaf Fix crashing analysis_server with some defensive null checks
Bug: https://github.com/dart-lang/sdk/issues/35814
Change-Id: I1536e77adb9fe4699201ca8e0462b0f5154ca127
Reviewed-on: https://dart-review.googlesource.com/c/91686
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-01-30 23:19:19 +00:00
Brian Wilkerson 3b5c1012e9 Update CodeChecker to handle the code-as-ui features
Change-Id: Iaea7e63b9ee6c5fe7f57da22c0215c9caa316a3e
Reviewed-on: https://dart-review.googlesource.com/c/91685
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-30 22:48:27 +00:00
Konstantin Shcheglov b8fc017778 Replace convertAbsolutePathToUri() with toUriStr().
Change-Id: Ib34247ce7457ada7e4705714984034387f09a80c
Reviewed-on: https://dart-review.googlesource.com/c/91684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-30 20:47:56 +00:00
Konstantin Shcheglov f903ee6dc0 Don't crash on formal parameters without name, exclude private SDK lbiraries.
R=brianwilkerson@google.com

Change-Id: Ie5d72458c6d19fb250591550d47c4076082dff1e
Reviewed-on: https://dart-review.googlesource.com/c/91683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-30 19:48:28 +00:00
pq 118bdcc1f6 backlink to language docs for customized analysis
Follow up from: https://github.com/dart-lang/linter/issues/1365.


Change-Id: Iaeef849406b191d99a84501884c3d34b37ccb59d
Reviewed-on: https://dart-review.googlesource.com/c/91681
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-30 18:01:04 +00:00
Brian Wilkerson bc2a5a6789 Generate some of the code-as-ui diagnostics; implement more resolution
Change-Id: I6d5ac14d5b6cb601d6d968a8140bc63435519230
Reviewed-on: https://dart-review.googlesource.com/c/91586
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-01-30 16:40:46 +00:00
Konstantin Shcheglov e8a0a209e3 Include into Declaration data that we will need for pre-cached suggestions.
R=brianwilkerson@google.com

Change-Id: Ie4419e785c06fa7b3913359e5831e97c611f46a7
Reviewed-on: https://dart-review.googlesource.com/c/91587
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-30 16:31:34 +00:00
danrubel 0bb1aee3ff AstBuilder cleanup
Change-Id: I83f936d353df8828795b4236655147ea414866b9
Reviewed-on: https://dart-review.googlesource.com/c/91621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-30 15:12:34 +00:00
Paul Berry ec13e61df3 Move question getter from GenericFunctionType and NamedType to their common base class.
Change-Id: I5f9494a0c354f5b1fc2ec08c7e748dd795671752
Reviewed-on: https://dart-review.googlesource.com/c/91680
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-30 14:59:24 +00:00
Jens Johansen 71bee8f05e Fix serializing procdure when realClass is Object from dart:core.
Bug: 34224
Change-Id: I244ed3c15a2e134f1599588a156a7ff45917d4be
Reviewed-on: https://dart-review.googlesource.com/c/91641
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-01-30 08:44:05 +00:00
Konstantin Shcheglov 2632e201b7 Support for DeclaredIdentifier(s) in new ForEachPartsWithDeclaration/ForElement(s).
R=brianwilkerson@google.com, danrubel@google.com

Change-Id: I589d427fca83129bf96c78070b05f61fdac74b27
Reviewed-on: https://dart-review.googlesource.com/c/91584
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-30 02:11:14 +00:00
Vijay Menon 4e0aa3ff37 Run ddb with debug port open
Change-Id: I5d83cd7deb789499517d1cf1d2a251655bff5924
Reviewed-on: https://dart-review.googlesource.com/c/90760
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-01-29 23:15:04 +00:00