Paul Berry
d47c31da48
Remove NullabilityNode.isNeverNullable.
...
This method relied on querying the underlying constraint variable, so
it needed to go in order to migrate away from the contraint variable
implementation.
Change-Id: I73f4b435d3ab4127cd0a08eaf96e8f15c1591430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-05-10 22:06:58 +00:00
Danny Tuppeny
be6bbfc06b
Remove redundant error notifications from LSP server
...
Change-Id: Ie2b4ac3c348835ad817cb34f24cc9b4108f1076d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101989
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2019-05-09 18:09:31 +00:00
Danny Tuppeny
4c2b9f1d91
Don't send LSP error notifications for files in dot-folders
...
Fixes https://github.com/dart-lang/sdk/issues/33778 .
Change-Id: I721ef96a6c137495dc5bfba2ccce16acd7f5be35
Bug: https://github.com/dart-lang/sdk/issues/33778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2019-05-09 14:44:23 +00:00
Danny Tuppeny
0450462503
Improve sending/flushing of errors for files in dot folders
...
Ensure errors are only sent when there is an appropriate time to flush
them (plus ensure if of those places flushes them).
Fixes https://github.com/dart-lang/sdk/issues/33778 .
Change-Id: Ieb4a2631c24649ba013eda93808b003b0e2ddb95
Bug: https://github.com/dart-lang/sdk/issues/33778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2019-05-09 14:44:23 +00:00
Paul Berry
7e58fb155a
Sort declarations in fix_lint_task.dart
...
Change-Id: I2053afe2ebf05b5ff10de72757fc83ffc81d1590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101862
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-05-08 19:05:51 +00:00
Devon Carew
ab84e36989
[dartfix] refactor the dartfix cli UI a bit
...
Change-Id: I9935ace979b0302d4f68c8a84ed9886a0ccf0c4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101761
Commit-Queue: Devon Carew <devoncarew@google.com >
Reviewed-by: Dan Rubel <danrubel@google.com >
2019-05-08 18:51:11 +00:00
Brian Wilkerson
f7bf890ff7
Improve the convert-to-package-uri assist
...
Change-Id: I2010d33b740932569e6fcafcc15fde30a96cf0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101743
Reviewed-by: Jaime Wren <jwren@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-05-08 16:01:55 +00:00
Jaime Wren
8de23bbbff
Update the Dart Analaysis Server protocol to 1.26.1 to mark that the MOVE_FILE refactoring is now enabled. The functionality landed May 3rd, 2019 with https://dart-review.googlesource.com/c/sdk/+/101320
...
Change-Id: I7f33b73304a72db1375a6a21132dc8207cc784c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101630
Reviewed-by: Jaime Wren <jwren@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jaime Wren <jwren@google.com >
Auto-Submit: Jaime Wren <jwren@google.com >
2019-05-07 22:15:56 +00:00
Paul Berry
ca4b63f067
Remove NullabilityNode.isAlwaysNullable.
...
This method relied on querying the underlying constraint variable, so
it needed to go in order to migrate away from the contraint variable
implementation.
Change-Id: I0c5004f98fcbb1891ade67266350569a196cf756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-05-07 21:11:42 +00:00
Paul Berry
df7db795dc
Stop using ConstraintVariable.always to represent the nullability of dynamic.
...
This is a necessary part of reworking nullability migration to stop
using constraint variables entirely.
Change-Id: If6c347c16882edfc2e8bdbeac761e09d8256c9bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-05-07 20:15:18 +00:00
Paul Berry
d06c7b7c89
Remove the ability of migration to use ?s in input files as a hint.
...
This speculative feature turned out to be infeasible, since the files
that are input to migration have NNBD disabled, so `?` is not
permitted.
Change-Id: Ice3fabe436c25718cbe4099a4d9ef86c8aa19896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-05-07 20:14:08 +00:00
Paul Berry
5b63d74608
Rework some migration tests to make use of the nullability graph.
...
This required tracking the map from a node to the nodes that are
upstream from it.
Change-Id: I079fac2196f3928b521b0866fd6f1790e6f24573
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101489
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-05-07 18:34:57 +00:00
Paul Berry
078338bb1d
Create a data structure to track the graph of nullability nodes.
...
The previous design (which stored the graph impicitly in the nodes
themselves) had a memory leak because some nullability nodes are
static, meaning that once a node became connected to one of the static
nodes, it would never be garbage collected.
Change-Id: I9821660198e29ff974ee0afa678851e0418e0527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101487
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-05-06 21:48:02 +00:00
Konstantin Shcheglov
8d1ed856d2
Always create DeclarationsTracker in AnalysisServer.
...
R=brianwilkerson@google.com
Change-Id: I1de49423d921da1fdf78ecd480a26e4577efcfe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-05-06 18:56:13 +00:00
Jaime Wren
58ef1db2ba
Enable the MOVE_FILE refactoring in the Analysis Server edit_domain.dart
...
Change-Id: I8859c6aa4144f4b5328c23a22b78e400706668c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Danny Tuppeny <dantup@google.com >
Commit-Queue: Jaime Wren <jwren@google.com >
2019-05-03 17:19:14 +00:00
Brian Wilkerson
5bac4d9b0c
Reland "Add support for recording context information with analysis errors, with one example"
...
This reverts commit b9bf239c65 .
Reason for revert: The angular and angular plugins have been updated so as to make this safe.
Original change's description:
> Revert "Add support for recording context information with analysis errors, with one example"
>
> This reverts commit 6114435ea5 .
>
> Reason for revert: Broke angular and angular_analyzer_plugin
>
> Original change's description:
> > Add support for recording context information with analysis errors, with one example
> >
> > Change-Id: Iba1c48163ce264d85a68bcb9f70e5025a7cdbfbb
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100563
> > Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
> > Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
>
> TBR=scheglov@google.com ,brianwilkerson@google.com
>
> Change-Id: I275c6e4473de73199ea9b5e490379ba58aec1d43
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100628
> Reviewed-by: Paul Berry <paulberry@google.com >
> Commit-Queue: Paul Berry <paulberry@google.com >
TBR=paulberry@google.com ,scheglov@google.com ,brianwilkerson@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ib1b7e63a459e63bcbf02f26bcf167ddad45295b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-05-02 17:07:03 +00:00
Konstantin Shcheglov
158a52ee3f
Change the message for FLUTTER_REMOVE_WIDGET.
...
R=brianwilkerson@google.com
Bug: https://github.com/Dart-Code/Dart-Code/issues/1647
Change-Id: I6061e3432c267dad550e57789aea522cc8fb2d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-05-02 17:00:53 +00:00
Paul Berry
fa274ec059
Make each NullabilityNode track those nodes that are downstream of it.
...
This allows more migration tool unit tests to be simplified so that
they don't have to refer to ConstraintVariable objects directly
anymore.
In order to make this work, a few other changes were also necessary:
- Make a derived class for NullabilityNodes that arise from
conditional expressions.
- Add a getter to reveal whether a NullabilityNode is known a priori
to be non-nullable.
Change-Id: I8a68b627ce9e807a50d371369985f52848903a2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100922
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2019-05-01 12:42:14 +00:00
Paul Berry
af1dbdf13b
Change representation of ExpressionChecks.
...
Previously, this class held on to a ConstraintVariable indicating
whether a null check should be inserted. Now it holds on to
NullabilityNodes indicating whether the source and destination of an
assignment are nullable, and it can infer from this whether a null
check needs to be inserted.
This paves the way for removing the old constraint solving logic in
favor of a more direct nullability propagation approach using
nullability nodes.
Change-Id: I96b95c400ed40bd12f9c9dcbb4c09a69849e51c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100885
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-30 17:21:20 +00:00
Dan Rubel
49573f59d3
cleanup analyzer warnings
...
Change-Id: Ieb2fd5e64efe7dbd7da70b4ee2f723d0fd5243ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2019-04-29 17:50:26 +00:00
Brian Wilkerson
3d0825da5d
Improve the message when a mixin cannot be applied because the superclass does not implement a required class (issue 36775)
...
Change-Id: Ifdcf8de365dbdcb50aa70acc8552a302ef2c8e1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100700
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2019-04-29 15:13:49 +00:00
Konstantin Shcheglov
fd76dda221
Identify mobile or web Flutter correctly when both are possible.
...
R=brianwilkerson@google.com
Bug: https://buganizer.corp.google.com/issues/131257401
Change-Id: Ifccb54504e7551009cdc3a66dd454e653d3cdd4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100663
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-04-27 16:52:56 +00:00
Brian Wilkerson
d03323783a
Fix an exception in flutter outline when using ui-as-code elements (issue 36772)
...
Change-Id: If0cb8972cc172581d0365e4d9e0bab0cfee598c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100629
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-26 19:26:55 +00:00
Paul Berry
b9bf239c65
Revert "Add support for recording context information with analysis errors, with one example"
...
This reverts commit 6114435ea5 .
Reason for revert: Broke angular and angular_analyzer_plugin
Original change's description:
> Add support for recording context information with analysis errors, with one example
>
> Change-Id: Iba1c48163ce264d85a68bcb9f70e5025a7cdbfbb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100563
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
TBR=scheglov@google.com ,brianwilkerson@google.com
Change-Id: I275c6e4473de73199ea9b5e490379ba58aec1d43
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100628
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-26 18:03:57 +00:00
Devon Carew
14d09498b7
[analyzer] don't traverse into dot folders when analyzing android manifest files
...
Change-Id: Ic0797064bc4209c597afb080adc050bf4a4c1f2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100569
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
Commit-Queue: Devon Carew <devoncarew@google.com >
2019-04-26 15:14:39 +00:00
Brian Wilkerson
6114435ea5
Add support for recording context information with analysis errors, with one example
...
Change-Id: Iba1c48163ce264d85a68bcb9f70e5025a7cdbfbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100563
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-25 18:41:23 +00:00
Brian Wilkerson
000a3eb3f7
Add completion support for late and required
...
Change-Id: I418aaa3aea9e6da6bcaf02e00c7e329e91175bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100467
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-25 13:24:50 +00:00
Jaime Wren
efd1ccb31a
Modify the MOVE_FILE refactoring support to be passed a resolved unit like other refactorings.
...
Change-Id: Ia9d8ced49f3cad6974aca57de64121686d8c48e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100320
Commit-Queue: Jaime Wren <jwren@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-04-24 15:58:46 +00:00
Brian Wilkerson
43e26c2de9
Add highlight support for late and required
...
Change-Id: Ic57ab28c3cbe600f9733733d96d367e774504b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100323
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-24 13:22:26 +00:00
Jaime Wren
688f029c4f
Rename workspace to refactoringWorkspace in move_file.dart to clarify the type of the object.
...
Change-Id: Idfe7c53cfbdab59d7343c449f01c1ab4c57160db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100266
Reviewed-by: Jaime Wren <jwren@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jaime Wren <jwren@google.com >
Auto-Submit: Jaime Wren <jwren@google.com >
2019-04-23 17:40:42 +00:00
Paul Berry
cee1e41fe8
Plumb new FeatureSet class into Scanner.
...
And change clients of the scanner (within the SDK) to use it.
Long term, it would be better to store the FeatureSet object directly
in the Scanner and remove the existing flags `enableGtGt` and
`enableNonNullable`. However there are analyzer clients that
currently use these flags. So for now, we simply plumb in the
FeatureSet as a new way of setting AstBuilder flags. Once we've
updated clients to use FeatureSet, we'll publish a breaking version of
the analyzer that removes the old flag API.
Change-Id: I9e662f4ed45668d9acd4f56e42d7d8dae6180d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99975
Reviewed-by: Dan Rubel <danrubel@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-23 16:13:43 +00:00
Paul Berry
38eed58f61
Fix hints in nullability migration code
...
Change-Id: I22ef26cd928832a9d9ab2e8f4552519b914eef98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100080
Auto-Submit: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Dan Rubel <danrubel@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2019-04-22 14:00:59 +00:00
Brian Wilkerson
af0fa108da
Add support for required named parameters
...
Change-Id: Iebfd8da18c6f2158ed39043ab116e2670a7329c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99717
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2019-04-19 19:25:01 +00:00
Konstantin Shcheglov
e6e2a196a3
Issue 36667. Check for unresolved URI in getLibraryByUri().
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/36667
Change-Id: If35719b350c2f26edbb7cbe42f51af896aa41fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99713
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-04-18 18:02:38 +00:00
Konstantin Shcheglov
92729e0cd3
Remove UndefinedTypeImpl.
...
And corresponding DartType.isUndefined as well.
R=brianwilkerson@google.com , paulberry@google.com
Change-Id: I85debe627e989b5a5671becf5d9dd16413562236
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99729
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-04-18 17:42:28 +00:00
Devon Carew
cf77b82f52
[analyzer] handle youtube and animation dartdoc directives
...
Change-Id: I5bcad74803da2466c8a50160823c586f57e00ec1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99711
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Devon Carew <devoncarew@google.com >
2019-04-18 17:18:28 +00:00
Brian Wilkerson
32f5223119
Search all directories when attempting to analyze manifest files
...
Change-Id: I3a900362d8d36d27e5c22f600db7bc54059c7717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99401
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-16 00:45:32 +00:00
Paul Berry
79974bb026
Rename Nullability enum to avoid confusion with spec.
...
The spec uses the terminology "nullable", "non-nullable", etc. to
refer to properties of types that differ subtly from their structure.
For example "Null" is considered nullable, even though it lacks a
trailing "?". Since we were using the Nullability enum to denote a
purely structural property of types (whether they end in "?", "*", or
neither), this led to confusion.
So to avoid confusion, we rename the Nullability enum, and its
enumerated values, to clarify that it refers specifically to the
nullability suffixes and not to the property of being
nullable/non-nullable.
Change-Id: Ia34a500a3d2d724d30c66a410140ae11d6512f50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99275
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-15 16:50:14 +00:00
Brian Wilkerson
6c5709c44a
Remove the URI of types until we can produce better URIs
...
Change-Id: I50e4361b2736245d8d1af32da15822e416c5b2be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99267
Reviewed-by: Ari Aye <ariaye@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-12 19:18:01 +00:00
Brian Wilkerson
a9f8248bfb
Add support for computing fixes in pubspec and manifest files
...
Change-Id: Ib13f7a529a441cf02d91452ac7507fffdee06161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99091
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-11 13:23:54 +00:00
pq
b6f8c717f0
update lint error code associations
...
Change-Id: I2918958494c3ffebced64de7a398544f72f78b08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99103
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2019-04-11 00:26:33 +00:00
Brian Wilkerson
17f5d2d757
Add assists to inline add and addAll
...
Change-Id: Ie085fd10ffe533fae8a0c5f6325d081a118adc39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99040
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2019-04-10 20:40:33 +00:00
Brian Wilkerson
523e3789e0
Add support for providing fixes in analysis options files
...
Change-Id: I6c9a0a0624201538a90608c2eff9cff7b6cdb4b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98870
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-04-10 03:39:40 +00:00
pq
01967b68d7
fix convert_to_spread assist to work on empty lists
...
Noteworthy that this issue was flagged by an attempt to convert flutter (https://github.com/flutter/flutter/pull/30784 ). Specifically, the assist here was throw a Bad Element exception:
set fakeResults(Map<String, List<ProcessResult>> value) {
_fakeResults = <String, List<ProcessResult>>{};
for (String key in value.keys) {
_fakeResults[key] = <ProcessResult>[]
..addAll(value[key] ?? <ProcessResult>[ProcessResult(0, 0, '', '')]);
}
}
Change-Id: Icec80f14160cf9ba28a4e8e39935f469e762b39f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98985
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2019-04-09 22:06:07 +00:00
Paul Berry
27ef571e5b
Encapsulate more uses of NullabilityNode.nullability inside the NullabilityNode class.
...
This CL adds the following new members to NullabilityNode:
- A `debugSuffix` getter, to retrieve a string representation of a
nullability node for debugging test failures.
- An `isAlwaysNullable` getter, to determine whether a NullabilityNode
is known, by construction, to always be nullable.
- An `isNullable` getter, to determine whether constraint solving
assigned the nullability node to be nullable.
With these new members, the two constraint variables inside the
NullabilityNode class (`nullabile` and `_nonNullIntent`) are only
referred to from within the NullabilityNode class itself, and in
tests.
Change-Id: I0f51aa2834a885fb13c6bbfe7d68cd517b65724a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-09 21:31:07 +00:00
pq
30b1326b1f
allow if element conversion assist to work on conditional sub-nodes
...
Change-Id: Ic4e7e5cf80a5158c456c808134a0dd3706ff1385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98981
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2019-04-09 20:31:37 +00:00
Paul Berry
1490a90bc1
Track guards using NullabilityNode rather than ConstraintVariable.
...
Change-Id: Id7825ef3fdd4400d1ff0d00538b7002accaca7b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98980
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-04-09 19:11:27 +00:00
Paul Berry
7f224d9fbe
Track parameters that might need to be made optional/required using NullabilityNode.
...
Change-Id: Ibcd1aaadb9ffe16c7b7f1c3a0298c7abf2fc0c34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-09 18:30:07 +00:00
Paul Berry
ed7f524afb
Refactor more of the migration tool to use NullabilityNode rather than ConstraintVariable.
...
With this CL, the NullabilityNode class is now used for the following
purposes:
- In ConditionalDiscard, to keep track of when branches of "if"
statements should be discarded.
- To track the nullability relationships implied by an assignment.
- To track the nullability implied by an optional parameter that lacks
a default value.
- In _ConditionInfo, to keep track of how assert statements imply
non-null intent.
Change-Id: Ieb05bb569258a3d16720c127a3f6038f805304c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-04-09 18:30:07 +00:00
Paul Berry
e0a82a3c92
Make NullabilityNode.nonNullIntent read-only
...
Change-Id: I803a1667d39c6e3c091d248ba8d3bd6fa9918286
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98943
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-09 15:24:43 +00:00