Package imports ignored by autocomplete, forcing relative imports even when path is outside of project
See original GitHub issueSteps to Reproduce
- Have Flutter library and Flutter app on disk in the same folder (Lets say /git/myLib, and /git/myApp)
- Import /git/myLib using git or pub in pubspec of /git/myApp
- When typing, autocomplete attempts to use relative imports outside of the current project, even when a package import is already available in the same file. Additionally none of the package import items are showing in autocomplete
When I have the package import already and I am coding:
After I pick one of the options (see both imports):
Version info
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-CA)
• Flutter version 1.20.3 at /Users/jrai/dev/flutter
• Framework revision 216dee60c0 (8 days ago), 2020-09-01 12:24:47 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/jrai/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Users/jrai/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Users/jrai/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.48.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.1
[✓] Connected device (1 available)
• iPhone 11 Pro (mobile) • DF38EA89-62A3-43B5-9AE9-0122E487F43D • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7
(simulator)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Preventing inappropriate imports and enforcing project ...
You would then get an '/path/to/projectA' is not under 'rootDir' error if you tried to import projectA into common. But to be able...
Read more >Fix Python Relative Imports and Auto-completion in VSCode
In this video, you will learn how to properly handle Python relative imports without extending the sys. path. Additionally, you will learn ...
Read more >User Manual - rust-analyzer
crate : This setting will force paths to be always absolute, starting with the crate prefix, unless the item is defined outside of...
Read more >User and Workspace Settings - Visual Studio Code
project -relative: Prefers a non-relative import only if the relative import path would leave the package or project directory. "javascript.preferences.
Read more >allow relative imports for files under path mappings
I am using IntelliJ IDEA 2018.1 (Ultimate Edition) Build #IU-181.4203.519 on Windows 10 10.0. When I have a project with a paths definition...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If I get some time I’ll try a sample repo
Without additional information we’re unfortunately not sure how to resolve this issue. We’re going to close this bug for now, but please don’t hesitate to comment on the bug if you have any more information for us; we’re happy to reopen. Thanks for your contribution!