Skip to content

inconsistent completion for optional argument #1940

@nbros

Description

@nbros

Let's say you have the following functions:

void fun1() {}
void fun2(int a) {}
void fun3({int a}) {}

Now I try to complete the call to each function:

  fun1();
  fun2(1);
  fun3();

In order to complete the calls we can type:

  • fun1 tab semicolon
  • fun2 tab 1 tab semicolon
  • fun3 tab right arrow semicolon
    For fun3, we need to use the right arrow or end key to move after the closing parenthesis that was automatically added by the completion.
    For fun1 and fun2, we can use the tab key to move after the parenthesis, but not for fun3 : if we type tab a tab is inserted between the parentheses.

I believe the issue is that Dart-Code does not add an empty completion placeholder after the closing parenthesis when the completed function has an optional named parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions