File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -65,16 +65,19 @@ import { showToolchainSelectionQuickPick } from "./ui/ToolchainSelection";
6565export type WorkspaceContextWithToolchain = WorkspaceContext & { toolchain : SwiftToolchain } ;
6666
6767export function registerToolchainCommands (
68- toolchain : SwiftToolchain | undefined ,
69- logger : SwiftLogger ,
70- cwd ?: vscode . Uri
68+ ctx : WorkspaceContext | undefined ,
69+ logger : SwiftLogger
7170) : vscode . Disposable [ ] {
7271 return [
7372 vscode . commands . registerCommand ( "swift.createNewProject" , ( ) =>
74- createNewProject ( toolchain )
73+ createNewProject ( ctx ?. globalToolchain )
7574 ) ,
7675 vscode . commands . registerCommand ( "swift.selectToolchain" , ( ) =>
77- showToolchainSelectionQuickPick ( toolchain , logger , cwd )
76+ showToolchainSelectionQuickPick (
77+ ctx ?. currentFolder ?. toolchain ?? ctx ?. globalToolchain ,
78+ logger ,
79+ ctx ?. currentFolder ?. folder
80+ )
7881 ) ,
7982 vscode . commands . registerCommand ( "swift.pickProcess" , configuration =>
8083 pickProcess ( configuration )
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<Api> {
7676 // properly configured.
7777 if ( ! toolchain ) {
7878 // In order to select a toolchain we need to register the command first.
79- const subscriptions = commands . registerToolchainCommands ( undefined , logger , undefined ) ;
79+ const subscriptions = commands . registerToolchainCommands ( undefined , logger ) ;
8080 const chosenRemediation = await showToolchainError ( ) ;
8181 subscriptions . forEach ( sub => sub . dispose ( ) ) ;
8282
@@ -101,11 +101,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<Api> {
101101 context . subscriptions . push ( new SwiftEnvironmentVariablesManager ( context ) ) ;
102102 context . subscriptions . push ( SwiftTerminalProfileProvider . register ( ) ) ;
103103 context . subscriptions . push (
104- ...commands . registerToolchainCommands (
105- toolchain ,
106- workspaceContext . logger ,
107- workspaceContext . currentFolder ?. folder
108- )
104+ ...commands . registerToolchainCommands ( workspaceContext , workspaceContext . logger )
109105 ) ;
110106
111107 // Watch for configuration changes the trigger a reload of the extension if necessary.
You can’t perform that action at this time.
0 commit comments