Skip to content

Commit e659d4c

Browse files
authored
Reload extension when swiftEnvironmentVariables changes (#1430)
The generated Swift build tasks are created once when the workspace folder is added to the workspace. The environment variables are captured at task creation time. If they're updated during the lifetime of the extension they wont be attached to the generated tasks until the extension restarts. Issue: #1428
1 parent b5fc65c commit e659d4c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/extension.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<Api> {
9797
showReloadExtensionNotification(
9898
"Changing the Swift path requires Visual Studio Code be reloaded."
9999
);
100-
}
101-
// on sdk config change, restart sourcekit-lsp
102-
if (
100+
} else if (
101+
// on sdk config change, restart sourcekit-lsp
103102
event.affectsConfiguration("swift.SDK") ||
104103
event.affectsConfiguration("swift.swiftSDK")
105104
) {
@@ -108,6 +107,10 @@ export async function activate(context: vscode.ExtensionContext): Promise<Api> {
108107
showReloadExtensionNotification(
109108
"Changing the Swift SDK path requires the project be reloaded."
110109
);
110+
} else if (event.affectsConfiguration("swift.swiftEnvironmentVariables")) {
111+
showReloadExtensionNotification(
112+
"Changing environment variables requires the project be reloaded."
113+
);
111114
}
112115
})
113116
);

0 commit comments

Comments
 (0)