-
Notifications
You must be signed in to change notification settings - Fork 295
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
Flutter projects nested more than 2 levels deep do not force "Flutter mode", preventing launching/debugging apps #1549
Comments
This is expected right now. When deciding whether to load the Flutter SDK or Dart SDK, we look two levels down to see if there's a Flutter project, and if not, we go into "Dart Mode". If you can't open a folder closer to the apps, the best current fix is to click File -> Add Folder to Workspace and then select your app1/app2 folders which will show them in the Explorer tree as "Workspace Folders". Unfortunately, this means they will appear in two places in the tree - there is a request to fix that in VS Code at microsoft/vscode#45470 (please add a 👍 ). We could scan further down the tree looking for Flutter projects at startup, but it would slow down startup (significantly for those opening large trees) and doing it this way also prevents you from having your own settings/launch configs within each of the apps folders. |
Would be ideal if the level(s) scanned could be a configurable setting. Rationale
|
I've been trying to avoid encouraging people down this route because there are lots of other drawbacks with this. For example, you can't have per-project launch configs if your project is set up like this, or per-project settings. This means opening a project ( VS Code supports multi-root workspaces which allow you to open multiple projects together while still treating them as "projects" and having their own VS Code settings, launch configs, etc. which is what the issue linked above is about trying to improve to handle the case of nested folders better. I'll try and do some investigation into how other languages are handling this (probably next week now). I did start along this path once but it was not trivial (for example, when you tried to run things like |
Right, that also makes sense. Guess this is a "better safe than sorry" concern and the sacrifice from a monorepo perspective would be not seeing the actual folder structure. I'm not sure if forcing monorepo-wide settings on purpose would make a strong case where common/shared packaged exist but that's what I had in mind. |
In my case I'm hosting the monorepo apps on Firebase in a single project. After doing some research I came to the conclusion that it's better to separate each app into its own Firebase project. In this light your advice makes much more sense so I'm fine with this issue being closed. |
Thanks for the update! I'll keep this open because I think we should do a better job of guiding people here (the error when trying to run a Flutter project on the Dart VM is cryptic for one), even if it's just detecting the failure and linking them to a page/issue that describes the above. |
In #1792 we started walking down the tree further (3 levels) when looking for projects. I think this solves the issue above (at least until someone comes along with a structure that has them 4 levels deep 😄). |
Folder structure
Works
Doesn't work
The text was updated successfully, but these errors were encountered: