Commit Graph

2825 Commits

Author SHA1 Message Date
Konstantin Shcheglov cfdcfe2bfe Update DeclarationsTracker when a context options change.
E.g. when .packages changes, we want to re-scan the context for new
available libraries. We also don't want to discard all context, and
resend everything.

R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/1723
Change-Id: I19ee71c1d021fb9bcda9d02d86b7cbb078704aa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-21 18:43:36 +00:00
Danny Tuppeny 88f139db68 Fix NPEs when processing unknown kinds in LSP
Fixes https://github.com/dart-lang/sdk/issues/37016.

Change-Id: I72eae50a03bb2c73678b65a07e6924a2a53d137e
Bug: https://github.com/dart-lang/sdk/issues/37016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103131
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-21 13:30:10 +00:00
Danny Tuppeny 022adc5bc3 Implement using suggestion sets for LSP completions
Change-Id: I66d725c09492040be5e621d80270b12a21bb8192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102704
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny b6ce27a141 Add LSP tests for suggestion sets (marked failing)
Change-Id: Iab8f632038f136963ea2e02fa9e9d76c66e32845
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 7be23977f1 Minor LSP tweaks in preperation for included suggestionSets
Change-Id: I9dff56139754b8a182e906d64dd0bcc009c4b6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Paul Berry 42334a7f67 Infer when the bound of a type parameter needs to be nullable.
Change-Id: I6c500318a66e05a0b3d10c85f07660dfe37339ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-17 20:41:11 +00:00
Paul Berry 14d21859e7 Make assertConnection failures easier to debug
Change-Id: I0f3934826c7464ec3d3c4f3d206a75ab53ce4ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-15 15:55:39 +00:00
Danny Tuppeny 6805bb52ea Add implementation/tests for textDocument/Implementation
Fixes https://github.com/dart-lang/sdk/issues/36896

Change-Id: Ie450c6c5257ac13aa3c7b48343aa8b015b1dc4d8

Tweak tests to require all, plus fix empty classes

Change-Id: Iefff7e24c6b965f0a1bc5abf8adbac26ad38e3a0

Add implementation/tests for textDocument/Implementation

Change-Id: I640379d83aeb9baa73d04d98d39147e2b748d6c3
Bug: https://github.com/dart-lang/sdk/issues/36896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102366
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-15 09:08:28 +00:00
Danny Tuppeny 3a7ce7a646 Enable declarations tracker for LSP to support dart doc macros
Change-Id: I614be91ecf7a1afc377afeee70e559cff324dc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102368
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-15 08:16:18 +00:00
Danny Tuppeny cdcc387084 Add LSP custom notifications for analyzing status
Change-Id: I0d26d274c9ccc472da81e45d0c9170104bbd9414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102370
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-15 06:35:48 +00:00
Paul Berry 3ecb89ba8c Move NullabilityGraph into nullability_node.dart.
This will allow NullabilityGraph and NullabilityNode to have shared
access to private data without having to expose it to all other
libraries.

Change-Id: Idbef9a60cdeb273cd5739c45d501370d89b653df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102403
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-13 22:31:44 +00:00
Paul Berry bed74d6e97 Remove NullabilityGraph._upstream.
Its only purpose was to make NullabilityGraph.getUpstreamNodes fast to
compute, but that function was only used in unit tests anyway so there
was no need for it to be fast.  (Minor exception: it was also used in
an assert statement, but I was able to change that to
Nullabilitygraph.getUnconditionalUpstreamNodes).

Change-Id: I8be18560c2f454908eb0e31d198fd22961a89278
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102388
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 19:23:51 +00:00
Paul Berry 228df22dbf Remove the old constraint variable based nullability migration logic.
Change-Id: I4fe2836160acf5adfd805a327616880f857e9b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102387
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 16:38:01 +00:00
Paul Berry 933ad32baa Add logic to assertNonNullIntent to check the nullability graph.
This will be necessary to avoid losing test coverage when we remove
the old constraint-variable based migration algorithm.

Change-Id: Ie0c29e681f92044d11be6acdeeed1a16c806960a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-13 15:52:31 +00:00
Paul Berry 8a8a700336 Fix nullability of inferred dynamic types
Change-Id: Ib27c5ade4a57bbfa73c528adbafaaa19be53c97c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:43:40 +00:00
Danny Tuppeny a779db0813 Update LSP spec to latest
Change-Id: I6f7ff3c6707f992aa618ad172e81857153b75795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102360
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:11:15 +00:00
Danny Tuppeny b7521f5e1b Fix lints not appearing when using LSP Server
Change-Id: Ib3b4396a611be32b91b08d68c962302899a1ad88
Bug: https://github.com/dart-lang/sdk/issues/36931
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-13 15:03:30 +00:00
Danny Tuppeny f7e288e3ad Return empty responses instead of errors for non-Dart files in LSP server
Previously we could return "invalid path" responses for any non-Dart files. This allows clients to send requests for other files and just successful (though empty) responses.

Change-Id: I192e83ac2ebd2124c03c22e3e048a066cfd33f17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101990
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-13 09:04:36 +00:00
Konstantin Shcheglov 6dd7007b48 Tweak CONVERT_TO_PACKAGE_IMPORT assist.
There were a (probably very rare) case of invalid URI issue.
I also renamed the ID and method to be consistent with the message.

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

Change-Id: Ie97b1f81c78b67565d7831d532b7a28800db41a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102246
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-12 18:08:47 +00:00
Paul Berry b8050f9322 Make NullabilityNode.nullable private.
This will help ensure that we don't accidentally make more use of it
before removing the constraint variable migration implementation
entirely.

Change-Id: I6cd898d1a3b2f2a4e9df9ea22c17ca77d3119567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101741
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:07:08 +00:00
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
Jaime Wren 454b98c490 Some additional tests in variable_name_contributor_test.dart to cover all the doIncludePrivateVersion cases
Change-Id: I8ec2a14e8ba4cc3a1ca4228c5455ab7cb6a2138c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101924
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-05-08 23:10:49 +00:00
Paul Berry 51fe641e82 Create a SynchronousSession class.
In the long term this class will take over much of the role played by
RestrictedAnalysisContext.  For now it is simply a container for the
analysis options, declared variables, type provider, and type system.

In follow-up CLs I will plumb this object through various parts of the
analyzer, especially the LinterContext; this will enable the
canBeConst... methods to be moved into SynchronousSession, and that
will allow us to stop creating a LinterContext in
BestPracticesVerifier.

Change-Id: I7ac2d386c10d2e5339d9715848b185c163e1f858
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-08 19:57:31 +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
Brian Wilkerson f80f0bfcfd Reland "Implement the type Never"
This reverts commit 78e50a5f9b.

Change-Id: I2ec4cdcfda4a6d199308a3b25a2ed0792e9d9a26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101621
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 13:26:45 +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
Jaime Wren 2ee973102c Add some additional tests for variable name completions for variable naming inside of for-statements
Change-Id: Ifbc06485a7378f917770ec41e8f0f602bbc2bd1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101624
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 20:06:55 +00:00
Paul Berry 2c3114f7a7 Replace most uses of assertConstraint with assertConnection.
This helps reduce the use of constraint variables in nullability
migration tests.

Change-Id: I48fb540489b1124f278b542a7f847c4dd3270185
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101465
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 19:55:28 +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
Brian Wilkerson 78e50a5f9b Revert "Implement the type Never"
This reverts commit 40a06c3a77.

Reason for revert: Introduced a bug that is blocking a roll.

Original change's description:
> Implement the type Never
> 
> Change-Id: Icbf407bc19f602c8382946b1e735905cc165c59c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100993
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com

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

Change-Id: Iebb5b8327b0be7129298f39b343555b812314abf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 16:22:37 +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
Jaime Wren f6ba1abab1 Additional MOVE_FILE bazel tests that cannot yet be run due to the expectations around analysis roots and the refactoring test framework.
Change-Id: Idea9b52a7e1be39750cdfa4b40e2e0d5756e20fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101442
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-06 18:11:42 +00:00
Jaime Wren ff0f2a6b2e Refactoring renaming of some tests in move_file_test.dart and sorting of the tests
Change-Id: I14d132c070b866da0a1373fc0f807f868f3024a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101078
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-02 21:40:24 +00:00
Jaime Wren 4a31d8b62b Additional tests in move_file_test.dart - the analysis server tests for the MOVE_FILE refactoring.
Change-Id: Icddbdf0da237b43af2513ec2407ec774218360f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101068
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 19:56:51 +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
Brian Wilkerson 40a06c3a77 Implement the type Never
Change-Id: Icbf407bc19f602c8382946b1e735905cc165c59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100993
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-02 16:31:23 +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
Brian Wilkerson 9670b2ccb9 Update the server API to support context messages
Change-Id: Ic07ef7d01125ca76f72e8c0e370181ea4f6f7cb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100825
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2019-05-01 01:31:44 +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
Jaime Wren a7325f9e59 Re-enable and fix the move_file_test.dart tests in the analysis server.
Change-Id: I633ea597dc5ed4540eda119766e9390cba0152ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100786
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-04-30 16:16:08 +00:00
Dan Rubel 4215dc8365 cleanup analyzer warnings
Change-Id: Ia5282ebb910babc47f9e2012bb5a5bc616846568
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100881
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-30 15:56:08 +00:00
Paul Berry 9cf5e51988 Consolidate test usage of ExpressionChecks.nullCheck into a single method.
This should make it easier to refactor the migration logic without
having to change tests too much.

Note that there is a minor loss of test coverage: in
test_functionInvocation_parameter_fromLocalParameter, we no longer
verify that non-null intent is sufficent to force a check to occur.
This is ok, because in future CLs, we will be simplifying the logic
for deciding when to add null checks so that it occurs precisely when
it's necessary to avoid a type mismatch.  Once that change has been
made, the correct behavior with non-null intent will happen
automatically.

Change-Id: I087c5c800fae3defa5b68380f05da40700af1359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100793
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-30 12:50:38 +00:00
Brian Wilkerson 2f06696655 Include the keyword required when printing elements, with additional cleanup
Change-Id: If252711ece4ed92bb52b9285704d91944a482c4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 17:51:50 +00:00
Paul Berry e2d0f5a50b Add featureSet parameter to Parser constructor.
And deprecate old parser configuration setters.

Change-Id: Ib1507b8d2b20be7c883061e2a92ec9205d6a378f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100664
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 16:42:19 +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