flutter / flutter/flutter-intellij

Hints completes code in the wrong places

Open
#8,615 0 comments 0 reactions 0 assignees View on GitHub
dependency: dart plugin P2
Dominant language
Java
Stars
2k
Forks
356
Avg merge
1d 11h
Merged PRs (30d)
27

Description

Try to create this code:

```
StreamSubscription? subscription;
subscription?.cancel();
```

You will see this hint:

Image

`Missing an 'await' for the 'Future' computed by this expression.`

So you hit Option+Enter (MacOS) and you get this:

Image

Accept it and it will generate this:

Image

Which is completely wrong, the `await` is being placed at the wrong place.

This happens for multiple other "smart completes" (sorry I don't know the name of these).

_______

Another example:

```dart
class TestClass {
List list = [];
}

// ....
final test = TestClass();
test.list.for // hit Tab here to accept the "for" shortcut
```

Image

This is what it generates:

Image

Which we can see it's placing the `for` at the wrong place. It looks like it can't understand that the list belongs to an object, and can't be used by itself.

@alexander-doroshko, is this something at your end?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.