You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flutter SDK installed using Snap is not located correctly on Arch Linux #2886
@MarcusTomlinson I mis-read the code when I posted here - we're already looking in "~/snap/flutter/common/flutter". The issue is that we only do this if we find a file at /snap/flutter/current/flutter.sh:
So is the file /snap/flutter/current/flutter.sh in a different place on Arch? If I understand correctly, we're using this simple as a check for "does the user have the Flutter snap installed?" so we know whether it's reasonable to run ~/snap/flutter/common/flutter if it looks like an uninitialised SDK so it'll pass the later checks.
I wonder how the Android studio extension finds/prioritises SDK path
In the issue you linked, the project was created with flutter create then opened. In VS Code the same should work - as we should read the .packages file and find the SDK that way. It doesn't help for projects that haven't had the packages restored already though (or in the case where the Snap hasn't been initialised fully).
We could also probably easily add ~/snap/flutter/common/flutter to the default locations we search for SDKs which would solve this issue if the Snap was initialised, but it wouldn't help the case where it's been installed and not initialised.
We could also probably easily add ~/snap/flutter/common/flutter to the default locations we search for SDKs which would solve this issue if the Snap was initialised, but it wouldn't help the case where it's been installed and not initialised.
Right, this is the way forward I believe. Without snap-specific logic in the extension (which we don't want), we have to assume the snap is initialised externally. I don't think it's a totally unfair assumption. Most people are likely to install flutter and run at least one command before using it elsewhere (such as flutter upgrade or flutter doctor).
Ok cool, I'll do that then. I'll leave the other logic in for now too (that can handle uninitialised Snap - albeit only for Ubuntu and others that use the same path) since it's fairly simple. The main goal was to not require Snap-specific implementation for each editor, but that doesn't mean we can't have the additional nice functionality here if it might help simplify getting started.
Activity
DanTup commentedon Oct 19, 2020
@MarcusTomlinson I mis-read the code when I posted here - we're already looking in "~/snap/flutter/common/flutter". The issue is that we only do this if we find a file at
/snap/flutter/current/flutter.sh:Dart-Code/src/extension/sdk/utils.ts
Line 455 in 616ebc1
So is the file
/snap/flutter/current/flutter.shin a different place on Arch? If I understand correctly, we're using this simple as a check for "does the user have the Flutter snap installed?" so we know whether it's reasonable to run~/snap/flutter/common/flutterif it looks like an uninitialised SDK so it'll pass the later checks.In the issue you linked, the project was created with
flutter createthen opened. In VS Code the same should work - as we should read the.packagesfile and find the SDK that way. It doesn't help for projects that haven't had the packages restored already though (or in the case where the Snap hasn't been initialised fully).We could also probably easily add
~/snap/flutter/common/flutterto the default locations we search for SDKs which would solve this issue if the Snap was initialised, but it wouldn't help the case where it's been installed and not initialised.MarcusTomlinson commentedon Oct 19, 2020
Right, this is the way forward I believe. Without snap-specific logic in the extension (which we don't want), we have to assume the snap is initialised externally. I don't think it's a totally unfair assumption. Most people are likely to install flutter and run at least one command before using it elsewhere (such as
flutter upgradeorflutter doctor).DanTup commentedon Oct 19, 2020
Ok cool, I'll do that then. I'll leave the other logic in for now too (that can handle uninitialised Snap - albeit only for Ubuntu and others that use the same path) since it's fairly simple. The main goal was to not require Snap-specific implementation for each editor, but that doesn't mean we can't have the additional nice functionality here if it might help simplify getting started.
Thanks!
Add location for Flutter SDK if installed via Snap on Arch Linux