vscode-dart-import icon indicating copy to clipboard operation
vscode-dart-import copied to clipboard

Current file is not on project root or not on lib folder? (MacOS Big Bug, I mean, Big Sur)

Open JCKodel opened this issue 4 years ago • 4 comments

Error every time I save pubspec.yaml:

Current file is not on project root or not on lib folder? File must be on $root/lib. Your current file path is: '/Users/jckodel/Desktop/MeuCronogramaCapilar/frontend/pubspec.yaml' and the lib folder according to the pubspec.yaml file is '/Users/jckodel/Desktop/MeuCronogramaCapilar/frontend/lib'.

image

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
[✓] VS Code (version 1.51.1)

JCKodel avatar Dec 11 '20 00:12 JCKodel

Are you trying to format the pubspec file itself? You should be formatting *.dart files inside the lib folder

luanpotter avatar Feb 23 '21 19:02 luanpotter

@luanpotter Hence the OP didn't answer. Dart-import is triggered also for pubspec.yaml therefore this error comes up

petrnymsa avatar Jul 07 '21 07:07 petrnymsa

This error is also triggered when saving analysis_options.yaml and the Dart Import: Fix On Save option is checked.

cklanac avatar Sep 04 '21 12:09 cklanac

It seems this error is triggered when the project contains multiple dart projects too. My current source tree is constructed with multiple dart projects at the same project, and it contains multiple libs under their individual project directory.

wangmir avatar Dec 09 '21 02:12 wangmir