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
{{ message }}
Repository navigation
Consider dart.analysisExcludedFolders when deciding whether to use Dart or Flutter SDK #2964
Describe the bug
I'm working with the win32 package (https://github.com/timsneath/win32) and I want to be able to easily flip between 32-bit and 64-bit SDKs to test my code. Unfortunately, the version switcher isn't available because there is one example buried deep in the folder structure that happens to use Flutter :(
I have my SDK folder set up, and other Dart-only projects provide configuration for switching:
To Reproduce
Steps to reproduce the behavior:
git clone the project above
Run it from a machine with multiple Dart SDKs
Expected behavior
Don't know what the right solution is here. I should be able to trigger the chooser somehow though. The presence of a Flutter folder shouldn't cause the entire Dart project to be unable to use a Dart SDK.
Versions (please complete the following information):
Hmm, I'm not sure how we can handle this. Currently we only support a single SDK for the whole workspace (because we can only have one analysis server and may run commands that aren't project-specific).
Would it be reasonable to exclude the example folder from analysis when you want to do this? Eg. if we made dart. analysisExcludedFolders also exclude the folder from project detection and you addd example to it, we'd no longer treat the workspace as Flutter, and you can add/remove that exclusion as required?
Yeah, that would work fine. The example is highly incidental and I'd be happy to just load that subdirectory in a separate context if I ever needed to edit it. (And that seems like a viable general solution also, more importantly...)
changed the title [-]Can't switch Dart SDK in a project with a Flutter subfolder[/-][+]Consider dart.analysisExcludedFolders when deciding whether to use Dart or Flutter SDK[/+]on Nov 25, 2020
With the fix, if you add this to your workspace settings (.vscode/settings.json):
"dart.analysisExcludedFolders": ["example"]
It will also exclude the folder from project detection when we're deciding which SDK to use (ofcourse, it'll also exclude it from analysis - but you'll need that if using a Dart SDK else you'll get errors on dart:ui). If you do want to switch back to the Flutter SDK (and have it analyzed) you can just comment that line out and run the Reload Window command (we don't currently support moving in/out of Flutter mode without a reload).
I don't think there should be any other side-effects to this, but if you notice anything weird, please let me know!
On Wed, Nov 25, 2020 at 3:18 AM Danny Tuppeny ***@***.***> wrote:
With the fix, if you add this to your workspace settings (
.vscode/settings.json):
"dart.analysisExcludedFolders": ["example"]
It will also exclude the folder from project detection when we're deciding
which SDK to use (ofcourse, it'll also exclude it from analysis - but
you'll need that if using a Dart SDK else you'll get errors on dart:ui).
If you do want to switch back to the Flutter SDK (and have it analyzed) you
can just comment that line out and run the *Reload Window* command (we
don't currently support moving in/out of Flutter mode without a reload).
I don't think there should be any other side-effects to this, but if you
notice anything weird, please let me know!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2964 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARWL654BYLVGMK6KEAWX6DSRTRZXANCNFSM4UALRH6A>
.
Activity
DanTup commentedon Nov 24, 2020
Hmm, I'm not sure how we can handle this. Currently we only support a single SDK for the whole workspace (because we can only have one analysis server and may run commands that aren't project-specific).
Would it be reasonable to exclude the example folder from analysis when you want to do this? Eg. if we made
dart. analysisExcludedFoldersalso exclude the folder from project detection and you adddexampleto it, we'd no longer treat the workspace as Flutter, and you can add/remove that exclusion as required?timsneath commentedon Nov 24, 2020
Yeah, that would work fine. The example is highly incidental and I'd be happy to just load that subdirectory in a separate context if I ever needed to edit it. (And that seems like a viable general solution also, more importantly...)
Thanks, Danny!
[-]Can't switch Dart SDK in a project with a Flutter subfolder[/-][+]Consider dart.analysisExcludedFolders when deciding whether to use Dart or Flutter SDK[/+]DanTup commentedon Nov 25, 2020
With the fix, if you add this to your workspace settings (
.vscode/settings.json):It will also exclude the folder from project detection when we're deciding which SDK to use (ofcourse, it'll also exclude it from analysis - but you'll need that if using a Dart SDK else you'll get errors on
dart:ui). If you do want to switch back to the Flutter SDK (and have it analyzed) you can just comment that line out and run the Reload Window command (we don't currently support moving in/out of Flutter mode without a reload).I don't think there should be any other side-effects to this, but if you notice anything weird, please let me know!
timsneath commentedon Nov 26, 2020
Add separate dart_nested_flutter tests for project detection
DanTup commentedon Nov 30, 2020
There's a beta build at https://github.com/Dart-Code/Dart-Code/releases that includes this if you'd like to try it (release notes not done yet though).
timsneath commentedon Nov 30, 2020
DanTup commentedon Dec 1, 2020
Provisional release notes are now here if you're interested in what else is in there for testing too -> https://dartcode.org/releases/v3-17/