Skip to content

Strange order in finding dart/flutter SDK #3367

@Hamdor

Description

@Hamdor

Describe the bug
The extension selects the wrong flutter SDK. I expect my local checked out git version to be used.

To Reproduce
I can reproduce it as follows (locally on windows, my drive is E, probably works with C too):

  1. Put a downloaded version from flutter SDK here: E:/flutter
  2. Setup and clone a git version of the flutter SDK here: E:/flutter-git
  3. Setup PATH, it should contain "E:/flutter-git/flutter/bin", NOT E:/flutter
  4. I also have FLUTTER_ROOT setup, pointing to E:/flutter-git/flutter
  5. Start visual studio code ==> Wrong SDK is used

Expected behavior
I would have expected that the version from E:/flutter-git is used, since the PATH variable points there.

Additional information
I worked around this as follows:
Since I have the FLUTTER_ROOT variable set locally, I moved the process.env.FLUTTER_ROOT to second position in
src\extension\sdk\utils.ts@246

Versions (please complete the following information):

  • VS Code version: 1.57.0-insider
  • Dart extension version: e8fd4e9
  • Dart/Flutter SDK version: 2.14.0-153.0.dev (dev)

Metadata

Metadata

Assignees

No one assigned

    Labels

    in docs / websiteRelates to documentation, including the Dart Code website

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions