Skip to content
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

Dart extension methods are not autocompleted #40365

Closed
vanlooverenkoen opened this issue Jan 29, 2020 · 8 comments
Closed

Dart extension methods are not autocompleted #40365

vanlooverenkoen opened this issue Jan 29, 2020 · 8 comments
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@vanlooverenkoen
Copy link

vanlooverenkoen commented Jan 29, 2020

I have to import the file manualy every time I want to use one of my extensions from my extensionsfile

I use android studio.

[✓] Flutter (Channel unknown, v1.12.13+hotfix.5, on Mac OS X 10.15.1 19B88, locale en-BE)
    • Flutter version 1.12.13+hotfix.5 at /Users/vanlooverenkoen/flutter
    • Framework revision 27321ebbad (7 weeks ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/vanlooverenkoen/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    • CocoaPods version 1.7.5

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[!] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (5 available)
    • AOSP on IA Emulator • emulator-5554                        • android-x86    • Android 9 (API 28) (emulator)
    • iPhone 11 Pro Max   • F2704E51-185C-4E5F-BC54-8FB1BA3C43BE • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
    • macOS               • macOS                                • darwin-x64     • Mac OS X 10.15.1 19B88
    • Chrome              • chrome                               • web-javascript • Google Chrome 78.0.3904.108
    • Web Server          • web-server                           • web-javascript • Flutter Tools

! Doctor found issues in 1 category.

flutter/flutter#49617

@bwilkerson bwilkerson added analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Jan 29, 2020
@bwilkerson
Copy link
Member

@jwren @pq

@atreeon
Copy link

atreeon commented Apr 17, 2020

Possible Intellij workaround:
type the name of the extension

so, for extension String_Extension on String {

you would type String_Extension, intellisense should recognise the extension name and selecting it will import the reference

@vanlooverenkoen
Copy link
Author

Just tried it with a DateTime_Extension. It did not work

@atreeon
Copy link

atreeon commented Apr 17, 2020

I've using this technique for about 3 weeks now in IntelliJ. Maybe it only works in Intellij?? Worth another go as this was really really annoying beforehand!

Screenshot 2020-04-17 at 23 33 36

@jimmy-robert
Copy link

Possible Intellij workaround:
type the name of the extension

so, for extension String_Extension on String {

you would type String_Extension, intellisense should recognise the extension name and selecting it will import the reference

Yes, this works but it's kind of annoying... In intelliJ Kotlin extensions are well autocompleted as you type the method name on your variable, I hope this problem will be fixed soon

@vanlooverenkoen
Copy link
Author

I've using this technique for about 3 weeks now in IntelliJ. Maybe it only works in Intellij?? Worth another go as this was really really annoying beforehand!

Screenshot 2020-04-17 at 23 33 36

Can't get it to work in Android Studio

@DanTup
Copy link
Collaborator

DanTup commented May 14, 2020

@bwilkerson possibly a dupe of #38894?

@bwilkerson
Copy link
Member

That seems likely, so I'll close it for now under the assumption that it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

5 participants