question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow quick switching of SDK versions

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, 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:

M:\Apps\Dart <-- latest
M:\Apps\Dart-1.20.0
M:\Apps\Dart-1.21.0
M:\Apps\Dart-{...}

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.

0reactions
DanTupcommented, 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.

screen shot 2017-07-15 at 20 16 05

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Website/quickly-switching-between-sdk-versions.md at master
To quickly switch between Dart or Flutter SDKs you need to provide Dart Code with a list of paths or containers for your...
Read more >
VSCode: Quickly switch between flutter versions
I've found the answer: Open workspace setting with CMD + SHFT + P, I choose not JSON version; Search for “SDK”; Add item...
Read more >
Support different platform versions - Android Developers
Support different platform versions · Specify minimum and target API levels · Check system version at runtime · Use platform styles and themes....
Read more >
Usage - SDKMAN! the Software Development Kit Manager
Do you want to switch SDK versions automatically when you cd into a directory? This can be done by setting the sdkman_auto_env=true in...
Read more >
Fast User Switching - Win32 apps - Microsoft Learn
Instead, it is possible for multiple users to log on and switch quickly between their open accounts. This feature is referred to as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found