There was some discussion with @jbelcher on Gitter about his Flutter project no longer being detected as such in Dart Code since it was moved inside the Fuchsia tree.
Currently, we don't treat Fuchsia projects like Flutter projects (eg. there's no daemon running and we don't support debugging), mainly because the original goal was to just get the analyzer working (and there's limited info on Fuchsia).
In this case, his project is standard Flutter so it's frustrating to not be able to just use it as such.
It seems like considering Fuchsia as Flutter is probably safe and we can test this by pasting a sample flutter app (eg. Stocks) inside the Fuchsia tree. I don't think this will cause any side-effects for people using Dart Code for Fuchsia, and if at some point we need to do work to support F5/debugging Fuchsia apps separately, we can just register an additional debugger type.
(cc @yyoon for opinions, who contributed initial Fuchsia stuff).
Idea from @yyoon - check if the pubspec references the futter SDK, and if so just treat it as a normal Flutter project (with the exception of the SDK locations that were picked up from Fuchsia).
I made this change, and it seemed to work, except it reports no devices when using Flutter from the Fuchsia tree and also stalls with "Waiting for another flutter command to release the startup lock..." when I try to debug.
Is there anything unusual about Fuchsia's version of Flutter that might cause these sorts of issues? Would I be better just skipping Fuchsia entirely if your root contains a pubspec.yaml with sdk: flutter and just do all the normal Flutter stuff? This means it'll use the .packagesa file and FLUTTER_HOME to try and find the Flutter SDK.
Actually, I'm not sure what happened - I restarted and it that problem went away. It just failed with:
Running "flutter packages get" in stocks...
Incompatible version constraints on file:
- flutter_driver 0.0.10-dev depends on version 2.3.4
- stocks depends on version 2.3.5
pub get failed (1)
Exited (1)
This is likely just because I took the sample app from the Flutter repo which is ahead.
So, I'm going to push these changes in the hope they'll work for @jbelcher. I'll leave this case open and supply a beta version to test sometime soon and if necessary we can make tweaks (including the change mentioned above if appropriate).
There's a beta releases here (download the vsix):
https://github.com/Dart-Code/Dart-Code/releases/tag/v2.7.0-beta.1
Instructions on installing from vsix are here:
https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix
I'm told that VS Code (latest stable) will handle vsix releases better than previous, and will seamlessly upgrade once I push a final v2.7.0 to the marketplace; however I'll aim to post a note back here as a reminder to check once it is available.
There's quite a lot of code changes in this version (though sadly not for a massive number of features), all feedback appreciated, though especially on the things in this case (handling vanilla Flutter projects under the Fuchsia root).
I just installed the beta version, and it seems to work fine with the normal Fuchsia Dart/Flutter code. @jbelcher should probably confirm if it works well with regular Flutter projects under fuchsia.
Beta version works great w/ Flutter projects under fuchsia, thanks @DanTup!
Excellent, thanks both for confirming :-)
I've got a bunch more testing to do with breakpoints because of some risky changes I made, but hopefully this version will go out in the next week or so.
If you keep the beta version installed it should update nicely when I push a release (according to MS, I've not been able to test it yet); so it'd be good to know if this happens. I'll keep this issue open as a reminder and close it with a comment when that happens, so you can confirm.
Great! I'll then keep the beta version to see if it actually picks up the newer release when it comes out.
v2.7.0 has been published. Please let me know whether it updates normally for you :-)
@DanTup I had to reload vscode but once I did it picked up the new version.
Excellent, the previous issues (where Code treated vsix and marketplace as separate extensions, so you had two installed, but it only showed one) must be resolved. This'll make it easier to do more betas in future.
Do let me know if you have any issues!
Same here. Reloaded once and now I'm on the new release version.