Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[analysis_server] Autocompletion suggestion for redirecting factory constructors shouldn't add arguments #53016

Closed
parlough opened this issue Jul 22, 2023 · 2 comments
Assignees
Labels
analyzer-completion Issues with the analysis server's code completion feature analyzer-completion-correctness area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@parlough
Copy link
Member

parlough commented Jul 22, 2023

When auto-completing a call to another constructor when declaring a redirecting factory constructor, arguments shouldn't be added to the result since they can't be specified.

class A {
  A.a(int value);

  factory A.b(int value) = A[!]
}

Autocompleting at the [!] results in:

class A {
  A.a(int value);

  factory A.b(int value) = A.a(value)
}

I would expect:

class A {
  A.a(int value);

  factory A.b(int value) = A.a
}
@lrhn lrhn added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Jul 22, 2023
@keertip keertip added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) analyzer-completion Issues with the analysis server's code completion feature labels Jul 24, 2023
@keertip
Copy link
Contributor

keertip commented Jul 24, 2023

/cc @bwilkerson

@keertip keertip added the P3 A lower priority bug or feature request label Jul 24, 2023
@scheglov scheglov self-assigned this Mar 6, 2024
@scheglov
Copy link
Contributor

scheglov commented Mar 6, 2024

https://dart-review.googlesource.com/c/sdk/+/356141

copybara-service bot pushed a commit that referenced this issue Mar 7, 2024
…ER when factory redirect.

Replaces NamedConstructorContributor with new style implementation.

Bug: #53016
Change-Id: I254c139a0c08eae8a256e9589b09481997f40e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov scheglov closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-completion Issues with the analysis server's code completion feature analyzer-completion-correctness area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants