Set SDK to dart-beta (non-nullable)
vincevargadev opened this issue · 1 comments
I'd like to work on a codebase with null-safety.
I installed Dart's beta using brew, as specified in these two docs:
- https://dart.dev/get-dart
- https://github.com/dart-lang/sdk/wiki/Installing-beta-and-dev-releases-with-brew,-choco,-and-apt-get
In the end, I got these:
% dart --version
Dart SDK version: 2.12.0-29.10.beta (beta) (Tue Nov 17 10:50:22 2020 +0100) on "macos_x64"
% which dart
/usr/local/bin/dart
% /usr/local/opt/dart-beta/libexec/bin/dart --version
Dart SDK version: 2.12.0-29.10.beta (beta) (Tue Nov 17 10:50:22 2020 +0100) on "macos_x64"
# Old SDK is still there
% /usr/local/opt/dart/libexec/bin/dart --version
Dart SDK version: 2.10.2 (stable) (Tue Oct 13 15:50:27 2020 +0200) on "macos_x64"
It seems like Vim is still using the old SDK.
In IntelliJ, I can switch between the stable and beta Dart channels, by changing the SDK path from /usr/local/opt/dart/libexec to /usr/local/opt/dart-beta/libexec. After that change is done, IntelliJ works correctly.
I'd like Vim to use the same Dart SDK path, but so far I can't get it done, and I don't find info about how to change the Dart SDK so that Vim recognizes that.
I tried setting export DART_SDK=/usr/local/opt/dart-beta/libexec, but it didn't change anything.
I'm new to Vim, so if this is not the right place to ask this question, let me know.
You should change your $PATH so the dart executable in your path is the one in the SDK you want to use.
We don't read any DART_SDK variable, and we don't hardcode any SDK locations - the path is always discovered based on the location of the dart executable.