Skip to content

Commit 72d69ee

Browse files
authored
Merge pull request #137 from lukester1975/refresh-builddir-change
extension: reload window if buildFolder changes.
2 parents bdea839 + 3ef2b88 commit 72d69ee

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"mesonbuild.buildFolder": {
113113
"type": "string",
114114
"default": "builddir",
115-
"description": "Specify in which folder Meson build configure and build the project."
115+
"description": "Specify in which folder Meson build configure and build the project. Changing this value will reload the VS Code window."
116116
},
117117
"mesonbuild.configureOptions": {
118118
"type": "array",
@@ -329,4 +329,4 @@
329329
"typescript": "^4.4.4"
330330
},
331331
"dependencies": {}
332-
}
332+
}

src/extension.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,13 @@ export async function activate(ctx: vscode.ExtensionContext) {
9494
ctx.subscriptions.push(watcher);
9595
await genEnvFile(buildDir);
9696

97-
// Refresh if the extension configuration is changed. builddir changes won't be reflected, however.
97+
// Refresh if the extension configuration is changed.
9898
ctx.subscriptions.push(
9999
vscode.workspace.onDidChangeConfiguration((e: vscode.ConfigurationChangeEvent) => {
100-
if (e.affectsConfiguration("mesonbuild")) {
100+
if (e.affectsConfiguration("mesonbuild.buildFolder")) {
101+
// buildFolder is rather ingrained right now, so changes there require a full reload.
102+
vscode.commands.executeCommand("workbench.action.reloadWindow");
103+
} else if (e.affectsConfiguration("mesonbuild")) {
101104
changeHandler();
102105
}
103106
})

0 commit comments

Comments
 (0)