Skip to content

Commit

Permalink
Push SDK paths onto Terminal environment PATH
Browse files Browse the repository at this point in the history
Fixes #2209, but currently a bit doesn't currently work well because of microsoft/vscode#99878.
  • Loading branch information
DanTup committed Jun 11, 2020
1 parent 0a69327 commit f5e1193
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ export async function activate(context: vs.ExtensionContext, isRestart: boolean
analytics.flutterSdkVersion = sdks.flutterVersion;
}

// Add the PATHs to the Terminal environment so if the user runs commands
// there they match the versions (and can be resolved, if not already on PATH).
let envPathPrefix = `${sdks.dart}${path.delimiter}`;
if (sdks.flutter)
envPathPrefix += `${sdks.flutter}${path.delimiter}`;
context.environmentVariableCollection.prepend("PATH", envPathPrefix);

if (config.previewLsp || process.env.DART_CODE_FORCE_LSP) {
isUsingLsp = true;
}
Expand Down

0 comments on commit f5e1193

Please sign in to comment.