Skip to content

[Analysis Server] Dart type suggestion not work correctly since 1.22 !! (Benchmark proof 1.17, 1.20, 1.22) #43657

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

Open
EArminjon opened this issue Oct 2, 2020 · 10 comments
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-server Issues related to some aspect of the analysis server P4 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@EArminjon
Copy link

EArminjon commented Oct 2, 2020

Hi,

Flutter Dart type suggestion work bad 1.22 on intelij IDEA, suggestions are not relevant. We pass to many times to write all word instead of using suggestions system :/

I make two tests around with function call and type suggestions. I tested under theses versions of Flutter :

  • 1.22.0
  • 1.20.4
  • 1.17.0

Result : 1.17 have better suggestions...

  • On flutter 1.22.0 :

Try to got print() function suggestion :
One letter :
image

Full word:
image

Try to got CrossAxisAlignment suggestions :
Empty :
image

3 letters :
image

  • On fluttter 1.20.4:

Try to got print() function suggestion :
One letter :
image

Full word:
image

Try to got CrossAxisAlignment suggestions :
Empty :
image

3 letters :
image

  • On flutter 1.17.0 :

Try to got print() function suggestion :
One letter :
image

Full word:
image

Try to got CrossAxisAlignment suggestions :
Empty :
image

3 letters :
image

As you can see on these images, suggestions weren't based on type... I lose too much time...

@EArminjon EArminjon changed the title Dart type suggestion work bad since last update !! (Benchmark around 1.17, 1.20, 1.22) [Analysis Server] Dart type suggestion not work correctly since last update !! (Benchmark around 1.17, 1.20, 1.22) Oct 2, 2020
@EArminjon
Copy link
Author

I hope provided enough data about the problem.

Here my flutter doctor -v without flutter version (because changed for every test)


[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /home/student/Android/Sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /snap/android-studio/91/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Android Studio (version 4.0)
    • Android Studio at /snap/android-studio/91/android-studio
    • Flutter plugin version 48.1.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (1 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

@bwilkerson
Copy link
Member

Can you provide information about where you're requesting code completion, what you expected to see, and what you mean by "not work correctly"?

@EArminjon
Copy link
Author

For "print" example :

You can see that the suggestion which have the same length are not at first position… Why a larger word got the first position Instead of the one which match exactly ?

For the "crossAxisAlignement" :

Instead of display first all matching type suggestion (CrossAxisAlignment.center, CrossAxisAlignment.end, CrossAxisAlignment.start...), we got some boolean value, some context and for 1.20 a spam from cupertino... How can that be possible ?


They're is no precise location, because it's a general problem: it appear for every suggestion case…

@EArminjon EArminjon changed the title [Analysis Server] Dart type suggestion not work correctly since last update !! (Benchmark around 1.17, 1.20, 1.22) [Analysis Server] Dart type suggestion not work correctly since 1.22 !! (Benchmark proof 1.17, 1.20, 1.22) Oct 2, 2020
@mit-mit mit-mit added the legacy-area-analyzer Use area-devexp instead. label Oct 5, 2020
@debuggerx01
Copy link

Same here :/
Even worse, the temporary solution from #38739 (comment) didn't work now

@ferrerogg
Copy link

Same problem here, after upgrading to 1.22.1 autocomplete doesn't work anymore on VS Code even with "Auto Import Completions" turned off... it's really frustrating...

[flutter] flutter doctor -v
[√] Flutter (Channel stable, 1.22.1, on Microsoft Windows [Versione 10.0.17134.1726], locale it-IT)
    • Flutter version 1.22.1 at D:\Flutter\flutter
    • Framework revision f30b7f4db9 (5 days ago), 2020-10-08 10:06:30 -0700
    • Engine revision 75bef9f6c8
    • Dart version 2.10.1

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\2024\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: D:\Java\jdk1.8.0_191_x64\bin\java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
    • All Android licenses accepted.

[!] Android Studio (not installed)  <- please ignore it, it's a known problem with latest Android Studio 4.1
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.50.0)
    • VS Code at C:\Users\2024\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.15.0

@Jairolaya12x
Copy link

I have the same problem but is only in Intellij in vscode works fine

@KlausJokisuo
Copy link

For me IntelliJ and VSCode fails.

@srawlins srawlins added the devexp-server Issues related to some aspect of the analysis server label Nov 27, 2020
@DanTup
Copy link
Collaborator

DanTup commented Jan 7, 2021

Here's an example where a constructor that matched the type of a named parameter used to be suggested first but no longer is (moved from #38739 (comment)) without auto-imports (suggestion sets) or LSP:

Flutter 1.20.0:

Screenshot 2021-01-07 at 12 00 46

Flutter 1.22.0:

Screenshot 2021-01-07 at 12 15 44

I captured the relevance scores for each, and here's what they look like (TextStyle appears only with a relevance of 192, so is mixed in with the other classes):

Screenshot 2021-01-07 at 12 34 47

@shinayser
Copy link

shinayser commented Jan 7, 2021

Dart's autocomplete is a real pain for ages. I have this another issue, currently is the Top#11 issue for Dart's SDK issues ranking:
#44273
My issue contain some examples of how terrible is the completion.

Please guys, give some love to the auto-complete! I've seem some discussions about the next big deal for the language (after NNDB) being the pattern matching, but I really think Dart Team should put some efforts on fixing all those completion problems once and for all.

@DanTup
Copy link
Collaborator

DanTup commented Dec 15, 2022

There have been some changes to completion since the above (for ex. LSP now uses NotImportedContributor). On latest Futter master, the TextStyle example above seems better, but the top few results are still slightly odd:

Screenshot 2022-12-15 at 18 26 22

The top three items get a sort of 9999449 (which I think means a ranking of 550/551). The fourth result (TextStyle constructor) gets a sort of 9999458 (which I think means a ranking of 441/442). It seems a little odd that they're not the other way around (although, a named constructor on MaterialStateTextStyle or TextStyle would involve using those types*), and Null definitely seems odd (null is valid here, but it would be odd to use the type, and even using null is probably unlikely for an optional named parameter that could be omitted).

Edit: * Actually, since named constructors are already listed specifically (see #38739 (comment)), there's probably less reason for the type names to feature so highly.

@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Mar 13, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-server Issues related to some aspect of the analysis server P4 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

10 participants