Skip to content

No parameter hints when invoking a callable class #5153

Closed

Description

@HosseinYousefi

In this code:

class Foo {
  int call(int a, String b) {
    return a + b.length;
  }
}

void main() {
  final foo = Foo();
  foo.call( // Auto-complete and hints are helpful.
}

when I write foo.call I get helpful auto-complete and hints about the signature of the method as expected, however I could call the same method using ():

void main() {
  final foo = Foo();
  foo( // No hints :(
}
Screenshot 2024-06-25 at 12 18 46 Screenshot 2024-06-25 at 12 18 27
Dart Code extension: 3.90.0
Flutter extension: 3.90.0 (activated)

App: Visual Studio Code
App Host: desktop
Remote: ssh-remote
Host Kind: ssh-remote
Version: linux 1.90.2

Workspace type: Dart, Flutter (LSP)

Dart (3.4.3)
Flutter (3.22.2)

Activity

  1. changed the title [-]No auto-complete on calling a class with a `.call` method.[/-] [+]No parameter hints when invoking a callable class[/+] on Jun 25, 2024
  2. added this to the v3.94.0 milestone on Jun 25, 2024
  3. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    on Jun 25, 2024
  4. DanTup commented on Jul 25, 2024

    @DanTup
    Member

    This is fixed by dart-lang/sdk@3fffa71. The change is in the Dart analysis server so will ship with a future Dart/Flutter SDK release rather than show up in the VS Code extension release.

  5. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions