Commit Graph

3080 Commits

Author SHA1 Message Date
Konstantin Shcheglov 3a0ded6d54 Use _ExecutableParameters to access named parameter names.
R=brianwilkerson@google.com

Change-Id: I801df17aca0ec466b3f60c6feffbf281744bc077
Reviewed-on: https://dart-review.googlesource.com/c/93486
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 19:58:51 +00:00
Konstantin Shcheglov 4c1025493a Enhance available suggestions protocol.
1. Rename includedSuggestionKinds -> includedElementKinds.

2. Add defaultArgumentListString and defaultArgumentListTextRanges.

R=brianwilkerson@google.com

Change-Id: I65c67252f6bad66c0c60a20315fd87affbeb653a
Reviewed-on: https://dart-review.googlesource.com/c/93560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 19:51:11 +00:00
Brian Wilkerson 28eb8604e3 Correctly handle invocations of top-level functions with an import prefix
Change-Id: I7e75dc79bf8104af974881bf9f8e3cd8de86b961
Reviewed-on: https://dart-review.googlesource.com/c/93370
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 17:50:31 +00:00
Konstantin Shcheglov 0ef30fb86e Protocol for IncludedSuggestionSet.displayUri.
R=brianwilkerson@google.com

Context: https://github.com/JetBrains/intellij-plugins/pull/633#issuecomment-464746341
Change-Id: I27339f4c9327adb761f2bb0ba326c318ce010383
Reviewed-on: https://dart-review.googlesource.com/c/93487
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 16:42:30 +00:00
Brian Wilkerson f9bb790f43 Add a fix to change invalid named argument names to an existing parameter name
Change-Id: Id03862e328d9399b0bd8d364d9448058aa1b6d43
Reviewed-on: https://dart-review.googlesource.com/c/93481
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 00:07:13 +00:00
Brian Wilkerson 1d1654592a Do not compute any imports for use on paste if import directives are being copied
Change-Id: I1e4aa232c2dac4acb6d9bc5c556fbaf619160cac
Reviewed-on: https://dart-review.googlesource.com/c/93483
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-18 20:21:33 +00:00
Paul Berry 26970f370c Move source out of PotentialModification.
Rather than have each PotentialModification keep track of its own
source, it's less wasteful to keep track of a map from each source to
a list of the potential modifications for that source.

Change-Id: Ib579f5159100195496a850fbf795b073fc927110
Reviewed-on: https://dart-review.googlesource.com/c/93466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-18 00:34:40 +00:00
Paul Berry 7d7d85ffa2 Change the default assumption for named parameters to "assume nullable".
If a named parameter has no default value, the default behavior is now
to assume that the parameter is meant to be nullable, even if no code
path can be found that passes null.

This was inspired by discussion with Matan and Ferhat--they were
concerned that users would see the migration tool changing parameters
to required that shouldn't actually be required, and react by adding
special sentinel default values.  This is not what we want to
encourage users to do; if the parameter is truly meant to be optional,
it is sensible for it to be nullable.

I will soon add logic that allows non-null intent to override this
behavior; this means that if the user asserts that the parameter is
non-null, or uses the parameter in such a way that a null value would
guaranteed to cause an exception, we'll take that as an indication
that they really mean for it to be required.

Change-Id: Iff388d0316b922d2bacae330d94bec65478d8ee0
Reviewed-on: https://dart-review.googlesource.com/c/93366
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-16 13:35:48 +00:00
Paul Berry fa8c552fd9 Propagate non-null intent from callee to caller.
Change-Id: If0095584d6d0b88e7c39b9871795c499380b636c
Reviewed-on: https://dart-review.googlesource.com/c/93364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-16 13:35:48 +00:00
Paul Berry ab38cf7897 Allow non-nullable usage to imply non-null intent.
If a method parameter is used in unconditional control flow in a way
that a `null` value would directly lead to an exception (i.e. by
dereferencing it, or by passing it to a method that requires a
non-nullable value), this is treated as implying that the method
parameter is intended to be non-nullable.

Change-Id: I4f55e4c95b3cfaee0a2ba9367b47d51083e0b7b1
Reviewed-on: https://dart-review.googlesource.com/c/93363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-16 13:35:48 +00:00
Konstantin Shcheglov 39afa4e555 Revert "Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it."
This reverts commit 5d6bab4ed2.

Reason for revert: this change is API incompatible when rolling into mono-repo.

Original change's description:
> Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
> 
> Change-Id: I9d87619e05ae769f4df6a6ba26cd7901c7c98510
> Reviewed-on: https://dart-review.googlesource.com/c/93141
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

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

Change-Id: I98d478f56e8aea037cbcc8b6cb940c36edb732fd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/93440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:38:08 +00:00
Konstantin Shcheglov 078f8e67f8 Tests for invalid library id, and requested name.
R=brianwilkerson@google.com

Change-Id: I75c7445bd2e9e25805c8789af9e648a3000b0668
Reviewed-on: https://dart-review.googlesource.com/c/93381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:35:56 +00:00
Brian Wilkerson 122aa43ef6 Convert ListLiteral and remove uses of ListLiteral2
Change-Id: I6c6f60ae969deb798cdbc8572341f2a51256b194
Reviewed-on: https://dart-review.googlesource.com/c/93341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:17:28 +00:00
Konstantin Shcheglov c8abe45b00 Retry 'getSuggestionDetails' on InconsistentAnalysisException.
I was not able to create a test that triggers it, but I saw this
exception sometimes while using it myself.

R=brianwilkerson@google.com

Change-Id: Ia8773a9914b03e73622d5e59f570006723426d42
Reviewed-on: https://dart-review.googlesource.com/c/93281
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-14 23:02:11 +00:00
Jaime Wren 48f7364d7b Remove the UX experiment 2 flag from the Dart Analysis Server.
The detachable file system manager feature is now a feature of the Dart Analysis Server, when starter.detachableFileSystemManager has been set.

Support originally added in https://dart-review.googlesource.com/c/sdk/+/73689/ under the --ux-experiment-2 flag.

Change-Id: I26e82e44891d31bf1a1b7399ef5d79e98bc62e7c
Reviewed-on: https://dart-review.googlesource.com/c/93283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-02-14 20:33:59 +00:00
Konstantin Shcheglov 5d6bab4ed2 Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
Change-Id: I9d87619e05ae769f4df6a6ba26cd7901c7c98510
Reviewed-on: https://dart-review.googlesource.com/c/93141
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-14 18:11:18 +00:00
Paul Berry 837145a7c7 Properly restore state of _inConditionalControlFlow upon entering new function/method.
Each function and method starts in unconditional control flow.  This
should allow more assertions to be recognized as demonstrating
non-null intent.

Change-Id: I5f6437a3009ebf6c91972e267c8a136a2b2fa77f
Reviewed-on: https://dart-review.googlesource.com/c/93129
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-02-14 12:58:09 +00:00
Paul Berry dfda06061a Restore state safely in migration visitors.
When the migration tool is run in permissive mode, its visitors try to
catch exceptions and continue running.  This means that when the
visitors make temporary state changes before recursive calls, they
have to restore the state inside `finally` blocks.

This should hopefully result in slightly saner behavior when running
the migration tool in permissive mode.

Change-Id: I46e07684526314befad860c4e065ec2c7f6d8b11
Reviewed-on: https://dart-review.googlesource.com/c/93127
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-02-14 12:58:09 +00:00
Paul Berry 92460b8923 Migration: use non-null assertions as a hint for parameters that should not be nullable.
Change-Id: I30d98fa28840dacb8df4fb038b49c491b347854f
Reviewed-on: https://dart-review.googlesource.com/c/93063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-14 01:08:37 +00:00
Brian Wilkerson 9b45c14c65 First stage cleanup of MapLiteral2 and SetLiteral2
Change-Id: I73ec2e6fa4509539f86dd906bcb411e6267c77aa
Reviewed-on: https://dart-review.googlesource.com/c/93143
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-13 22:51:57 +00:00
Jaime Wren 486238df49 Remove the UX experiment 1 flag from the Dart Analysis Server.
This work lead to https://github.com/JetBrains/intellij-plugins/pull/597 which will land in the Dart Plugin, 2019.1.x versions.

PR that introduced this experiment: https://dart-review.googlesource.com/c/sdk/+/75402/

Change-Id: Ia3c3a1e28da190346407504c35c57b98534d9a2c
Reviewed-on: https://dart-review.googlesource.com/c/93122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-02-13 22:49:09 +00:00
Brian Wilkerson 30f9f5b1c7 Add SetOrMapLiteral to support the code-as-ui features
Change-Id: I6d3023855fea6da859af0815bfae6857f1546cb9
Reviewed-on: https://dart-review.googlesource.com/c/93062
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-13 20:14:24 +00:00
Paul Berry d1bf6ae7d2 Track nonNullIntent in unconditional control flow.
In a future CL this will be used to prevent nullability from being
propagated into function parameters where it's clearly not intended.

Change-Id: I34430162db33f99e850ca2c11e5bca8736feb94f
Reviewed-on: https://dart-review.googlesource.com/c/93041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-13 15:46:46 +00:00
Paul Berry 13c4b160ba Add migration tool support for bare "return;" statements
Change-Id: I10e2adeaf3c682ccac011b307c43052178b0974a
Reviewed-on: https://dart-review.googlesource.com/c/93040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-02-13 15:46:46 +00:00
Paul Berry 80e43c6a75 Remove the Modification class; use SourceEdit instead.
Change-Id: I7afca644ec761a201c490a711293ea6f2710b035
Reviewed-on: https://dart-review.googlesource.com/c/92847
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-12 23:00:03 +00:00
Konstantin Shcheglov 80c8848624 Support for enums in available suggestions, getDetails, boost relevance.
R=brianwilkerson@google.com

Change-Id: I24edb0266280f8f2b8312c7af66039d8b26fdc7c
Reviewed-on: https://dart-review.googlesource.com/c/92841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 22:15:41 +00:00
Paul Berry ca32bef641 Add migration support for the @required annotation.
If a named parameter is annotated as `@required`, then this overrides
the NamedNoDefaultParameterHeuristic; the parameter is considered
required regardless of what happens at call sites.  A duplicate
`@required` annotation is not inserted.

Change-Id: Ib1385d0a65dd9001bb7abede9de2a319f65a1f86
Reviewed-on: https://dart-review.googlesource.com/c/92844
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-12 21:47:28 +00:00
Brian Wilkerson 5fe0202b0b Unify MapElement and CollectionElement
Change-Id: Ia1be138d656d07bdf4c11640b79044abbc798986
Reviewed-on: https://dart-review.googlesource.com/c/92762
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-12 17:10:58 +00:00
Danny Tuppeny f54650ccaf Add LineInfo to Declaration search results
This allows LSP to translate locations to line/col ranges without re-requesting the LineInfos.

Change-Id: I59fab4d9f9de123deefd02a901ab4cc34ef8c0fb
Reviewed-on: https://dart-review.googlesource.com/c/92680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-02-12 15:16:45 +00:00
Paul Berry ce91bcb442 Add migration support for named parameters.
Currently assuming that the language team chooses option 2 for
https://github.com/dart-lang/language/issues/156#issuecomment-460525075.

To handle the case where the user does not specify a default value,
and all call sites supply the named parameter, there are two possible
heuristics:

- assumeNullable: mark the parameter as nullable, since the implicit
  default is `null`, even though the implicit default is never used.

- assumeRequired: consider the parameter to be `@required`, ensuring
  that the implicit default will never be used.

I've provisionally chosen `assumeRequired` as the default behavior.

Functionality not yet implemented:

- If `@required` is already present in the source code, this should
  override the heuristic; also it should not be added again.

- If the parameter is already marked as nullable in the source code,
  this should override the heuristic.

- Uses of `@required` should be translated to `required`.

- If `@required` is already present in the source code, and a default
  value is supplied, the default value should be removed.

- If the parameter is used in a way that demonstrates it was intended
  to be non-nullable (i.e. it appears in a place in unconditional
  control flow that would cause an exception to be thrown if it was
  null), this should override the heuristic and cause it to be marked
  as `@required`.

Change-Id: I9f2ec63787fdb6215e6075ecfcc830ed9942b8b5
Reviewed-on: https://dart-review.googlesource.com/c/92532
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 14:49:14 +00:00
Konstantin Shcheglov 02b65ee478 Include 'includedSuggestionRelevanceTags' into completion response.
R=brianwilkerson@google.com

Change-Id: Ib2d26a2f4679c19b8fa889b9fabf80f505eaef28
Reviewed-on: https://dart-review.googlesource.com/c/92625
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 01:51:05 +00:00
Konstantin Shcheglov 71e8588399 Include enum constants into available declarations.
R=brianwilkerson@google.com

Change-Id: I86c525981119a77ad8b69878f8134d927f873817
Reviewed-on: https://dart-review.googlesource.com/c/92662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 01:04:34 +00:00
Konstantin Shcheglov b9bcfb4529 Change IncludedSuggestionRelevanceTag to using 'relevanceBoost'.
Sometimes there is no difference between 'relevance' and 'relevanceBoost',
for example for enum constants. But for primitive constants, there might
be multiple `double` constants, in different libraries with their own
different relevances. And it would be nice to keep relative relevances
of these libraries in primitive type constants.

R=brianwilkerson@google.com

Change-Id: I3641a4709e09f5c5dd979f5ca8df7b0235c708d2
Reviewed-on: https://dart-review.googlesource.com/c/92623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-11 20:10:29 +00:00
Danny Tuppeny b88d11a9bd Implement LSP workspace/symbol
Change-Id: I4303a146dce9a5a4b40345f7ea8ef8355163337b
Reviewed-on: https://dart-review.googlesource.com/c/92602
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 19:32:52 +00:00
Konstantin Shcheglov fdfe40ea95 Compute 'executableElement' and 'parameterElement' in CompletionTarget.
R=brianwilkerson@google.com

Change-Id: I58904548a034cf927d9205bdbba3be9014c49328
Reviewed-on: https://dart-review.googlesource.com/c/92539
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 06:08:00 +00:00
Brian Wilkerson 36a31879da Preserve indentation when converting documentation from block to line
Change-Id: I2528b73aaea23d85c397d2199b6f5f9706809c3c
Reviewed-on: https://dart-review.googlesource.com/c/92536
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 01:31:59 +00:00
Brian Wilkerson 6875b9b26b Do not convert empty function bodies to async (issue 35899)
Change-Id: Ie08504aa927b27f45cc6c02089cc679e3b9d2376
Reviewed-on: https://dart-review.googlesource.com/c/92537
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 01:31:52 +00:00
Paul Berry b3ee960092 Stop indirecting through VariableRecorder/VariableRepostitory to create constraint variables.
The indirection wasn't adding any value.

Change-Id: I1c1b41a55b5cee37f75c30c3fa6ebfe56083ed56
Reviewed-on: https://dart-review.googlesource.com/c/92526
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-10 01:45:20 +00:00
Konstantin Shcheglov d5038fc976 Stop using FileContentOverlay in RuntimeCompletionComputer and AbstractContextTest.
RuntimeCompletionComputer still is not good to work with AnalysisSession,
but now does not use the deprecated API.

R=brianwilkerson@google.com

Change-Id: I07f5e496c6f268c4d213ebb3794fa214b437f21e
Reviewed-on: https://dart-review.googlesource.com/c/92525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 22:26:19 +00:00
Paul Berry ad3adb6285 Move nullability migration algorithm into analysis server.
Change-Id: Ie240b42cab37e3f5adce8633d368fcf6667b3a37
Reviewed-on: https://dart-review.googlesource.com/c/92522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-09 19:01:14 +00:00
Brian Wilkerson 5787f08619 Clean up some hints in server and analyzer
Change-Id: Ia6bb5e4e4e398dbed29fe6649c490a88d4e0a406
Reviewed-on: https://dart-review.googlesource.com/c/92523
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-09 17:58:44 +00:00
Konstantin Shcheglov 5f3ed76854 Issue 3172. When adding a required argument, create a linked group for the default value.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/3172
Change-Id: I991b7d6a1094691d2a005786cb5bbc507a1004c9
Reviewed-on: https://dart-review.googlesource.com/c/92520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 17:30:35 +00:00
pq 18b5d66966 pass analysis options to linter contexts
Adds an analysis options backpointer to linter contexts.  With this, lint rules can
query options and conditionally support enabled language experiments.



Change-Id: I35dbfd112ed5f149dcc17b17b2edaf7420b38090
Reviewed-on: https://dart-review.googlesource.com/c/92460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-02-08 23:38:58 +00:00
Konstantin Shcheglov 61ae86bce2 Add relevance tags to available declarations.
R=brianwilkerson@google.com

Change-Id: Ifa0fef7f9e572368c857fe972e007483782f119e
Reviewed-on: https://dart-review.googlesource.com/c/92405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 19:56:36 +00:00
Konstantin Shcheglov 67c5923cce Enhance protocol to allow changing relevance of individual suggesions.
R=brianwilkerson@google.com

Change-Id: I3f3d256fcdc4d41c527bbc03fb71800583a264f7
Reviewed-on: https://dart-review.googlesource.com/c/92382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ari Aye <ariaye@google.com>
2019-02-08 19:25:05 +00:00
Paul Berry afe37d7fe0 Add migration support for named parameters (with and without default values).
At this point the migration tool is beginning to make assumptions
about decisions the language team hasn't made yet, so I've created a
class to document those assumptions and allow us to test variants.

Change-Id: I4638d7f534cfa2dbd8460277351045c370377ff8
Reviewed-on: https://dart-review.googlesource.com/c/92394
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-08 17:47:55 +00:00
Konstantin Shcheglov 69d0411768 Fix exception when completion is requested not in a Dart file.
R=brianwilkerson@google.com

Change-Id: I3b24631dd4dec7124b7be13cc0618c289985476c
Reviewed-on: https://dart-review.googlesource.com/c/92389
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 17:10:45 +00:00
Paul Berry 5b7b34eb3a Add a "permissive mode" to the nullability migration tool.
This allows us to try it out on substantial codebases (e.g. the
analyzer itself) without crashing, even though a lot of the underlying
logic is not yet complete.

Change-Id: I24a45eea1889f7d9afa30c0398f359d32ffb52ad
Reviewed-on: https://dart-review.googlesource.com/c/92404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-08 13:23:35 +00:00
danrubel 26379d088d Update dartfix to report path of resource if resource changes during analysis
Change-Id: Ia537083013173f9a0dafd174f55bed11ec09d95c
Reviewed-on: https://dart-review.googlesource.com/c/92360
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-07 22:05:49 +00:00
danrubel 21b596e1b1 Change NullabilityFixKind from enum to class
... so that it can carry additional information
such as an applied message for use by dartfix.

Change-Id: Ic98f4000590c9bf21be45c5a5139946afeeb196c
Reviewed-on: https://dart-review.googlesource.com/c/92302
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-07 20:47:37 +00:00