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
I often find myself swapping between SDKs, eg. testing dev releases that have fixes for bugs I've reported, switching to an older version to try and repro bugs, testing Dart Code against older SDKs that users might be using.
I think this could be made much easier with fairly little effort..
Add a new user setting that points to a folder that is a collection of SDKs. When set, the version number shown in the status bar can be clicked on to open a picklist (same as how Code's indent settings work) and let you pick a sub-folder from that location (the list should only include those that look like SDKs). This would set the sdkPath setting and prompt to reload (or maybe automatically reload if no dirty buffers).
This should support symlinks too, eg. so if you have checked out versions of the SDK repo you could have a dev (or whatever) symlink pointing there for easy switching in and out of release/dev.
If we can detect the architecture, we could also possibly add a new option to the "new SDK" notification for "Download now" which automatically downloads and extracts (this might need specific x-plat code) to that folder and switches to it.
@devoncarew Might this be useful to you? Anything else to add?
I generally run with the latest dev sdk release (or sometimes, with the sdk version that flutter has vendored in), but am likely an atypical user. I suspect that many users just stay on the latest stable release, or latest dev release.
My plan (which was formed pre-flutter) was to keep it as a string and just scan all adjacent folders for the dart binary to get the possible SDKs. I have my SDKs all together like this:
Whenever a new SDK comes out I just rename the old folder and drop the new one in Dart. Currently I also then change my settings path to switch between them.
My plan was to make it so when the user clicks on the SDK version in the status bar we scan the adjacent folders and do exists checks for the Dart VM (.\bin\dart.bat). If there's more than one then use a Code pick-list to let the user select one, then just update the sdkPath user setting and reload the project.
It would work very much like the language-selector already in Code (other than requiring a reload).
I don't know enough about Flutter dev to know whether it'd be useful to do the same there - each time I used it it seemed to want its own version of the Dart SDK, so I don't know what the workflow would be like to use an old version.
Edit: I see when I wrote this I said the setting would point at the parent folder; that's an option too - sdkPaths (plural) could be set if you want to have a folder full of Dart SDKs and we can just do the same thing I mentioned above based on that. The advantage to this way is that we know where the user wants to keep their SDKs so auto-downloads might be easier in future.
Added dart.sdkPaths. When set, the version in the status bar becomes clickable and shows a picklist of SDKs found inside that folder. Top option resets the config setting to blank which will search path at startup.
Note: Selecting something from this list will set the dart.sdkPath option in your user settings (figured it'd be confusing to have two options, one where the user typed it into settings and another hidden setting being set by this).
Activity
devoncarew commentedon Nov 29, 2016
I generally run with the latest dev sdk release (or sometimes, with the sdk version that flutter has vendored in), but am likely an atypical user. I suspect that many users just stay on the latest stable release, or latest dev release.
DanTup commentedon Nov 29, 2016
Maybe this isn't that useful to normal users, though would be pretty useful to me so might still do if it's easy and clean!
Skylled commentedon May 21, 2017
Would it be possible to turn
dart.sdkPathinto a map along the lines of:Then add a command to switch SDKs and reload?
Same could technically be done for Flutter SDK, if someone wanted to have master branch and alpha branch separately installed, or a local branch.
DanTup commentedon May 21, 2017
My plan (which was formed pre-flutter) was to keep it as a string and just scan all adjacent folders for the dart binary to get the possible SDKs. I have my SDKs all together like this:
Whenever a new SDK comes out I just rename the old folder and drop the new one in Dart. Currently I also then change my settings path to switch between them.
My plan was to make it so when the user clicks on the SDK version in the status bar we scan the adjacent folders and do exists checks for the Dart VM (
.\bin\dart.bat). If there's more than one then use a Code pick-list to let the user select one, then just update thesdkPathuser setting and reload the project.It would work very much like the language-selector already in Code (other than requiring a reload).
I don't know enough about Flutter dev to know whether it'd be useful to do the same there - each time I used it it seemed to want its own version of the Dart SDK, so I don't know what the workflow would be like to use an old version.
Edit: I see when I wrote this I said the setting would point at the parent folder; that's an option too -
sdkPaths(plural) could be set if you want to have a folder full of Dart SDKs and we can just do the same thing I mentioned above based on that. The advantage to this way is that we know where the user wants to keep their SDKs so auto-downloads might be easier in future.DanTup commentedon Jul 15, 2017
Added
dart.sdkPaths. When set, the version in the status bar becomes clickable and shows a picklist of SDKs found inside that folder. Top option resets the config setting to blank which will search path at startup.Note: Selecting something from this list will set the
dart.sdkPathoption in your user settings (figured it'd be confusing to have two options, one where the user typed it into settings and another hidden setting being set by this).