Sdk: Named constructors do not appear in completion list when not using new/const keyword

Created on 23 Apr 2018  路  7Comments  路  Source: dart-lang/sdk

When using the Dart 2 preview in VS Code / Intellij / Android Studio, there are no auto fill options named constructors.
For example trying to auto fill

new ListView.

presents me with all the named constructors for this class.
Using

ListView.

does not present any auto fill options.

Dart version: Dart 2.0.0-dev.48.0.flutter-fe606f890b

P2 analyzer-completion area-analyzer type-bug

Most helpful comment

Yes, all IDEs get completion from Analysis Server, so all of them will get constructors.

image

All 7 comments

fyi - @devoncarew

/cc @scheglov

We oscillated between enabling and disabling this feature and ended up with disabling it, because we are not sure what the state of runtime is/will-be.

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

@scheglov can you elaborate a bit on what you meant? It's a big inconvenient that moving forward, all factories will not be auto-completable.

I got a confirmation that optional new/const is ready in VM, and people actually want to stop writing them. So, I landed https://dart-review.googlesource.com/c/sdk/+/55506 that restores completion for constructors without new.

\o/!!!

It looks like the revert^3 was from today. I assume it means when the next dart version rolls, this will be on in all IDEs?

Yes, all IDEs get completion from Analysis Server, so all of them will get constructors.

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmesserly picture jmesserly  路  3Comments

matanlurey picture matanlurey  路  3Comments

DartBot picture DartBot  路  3Comments

55555Mohit55555 picture 55555Mohit55555  路  3Comments

bergwerf picture bergwerf  路  3Comments