Skip to content

Allow quick switching of SDK versions #222

Closed

Description

@DanTup

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?

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Nov 22, 2016
  2. devoncarew commented on Nov 29, 2016

    @devoncarew
    Contributor

    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.

  3. DanTup commented on Nov 29, 2016

    @DanTup
    MemberAuthor

    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!

  4. modified the milestones: v1.4, , on May 17, 2017
  5. Skylled commented on May 21, 2017

    @Skylled
    Contributor

    Would it be possible to turn dart.sdkPath into a map along the lines of:

        "dart.sdkPaths": {
            "Stable": "C:\\Program Files\\Dart\\dart-sdk",
            "Dev": "C:\\Dart-Dev\\dart-sdk"
        },
        "dart.currentSdk": "Stable"
    

    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.

  6. DanTup commented on May 21, 2017

    @DanTup
    MemberAuthor

    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.

  7. modified the milestones: v2.1, v2.2 on Jul 15, 2017
  8. added
    in editorRelates to code editing or language features
    on Jul 15, 2017
  9. DanTup commented on Jul 15, 2017

    @DanTup
    MemberAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions