Skip to content

Commit 6b97ec9

Browse files
authored
Merge pull request #3538 from seesharprun/disable-asset-notification
Add csharp.supressBuildAssetsNotification setting to allow the 'Required assets to build and debug' notifications to be supressed
2 parents 21c1668 + d9f133d commit 6b97ec9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,11 @@
617617
"default": false,
618618
"description": "Suppress the warning that project.json is no longer a supported project format for .NET Core applications"
619619
},
620+
"csharp.supressBuildAssetsNotification": {
621+
"type": "boolean",
622+
"default": false,
623+
"description": "Suppress the notification window to add missing assets to build or debug the application."
624+
},
620625
"csharp.suppressHiddenDiagnostics": {
621626
"type": "boolean",
622627
"default": true,

src/assets.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,12 @@ async function promptToAddAssets(workspaceFolder: vscode.WorkspaceFolder) {
455455

456456
const projectName = path.basename(workspaceFolder.uri.fsPath);
457457

458-
vscode.window.showWarningMessage(
459-
`Required assets to build and debug are missing from '${projectName}'. Add them?`, disableItem, noItem, yesItem)
460-
.then(selection => resolve(selection.result));
458+
let csharpConfig = vscode.workspace.getConfiguration('csharp');
459+
if (!csharpConfig.get<boolean>('supressBuildAssetsNotification')) {
460+
vscode.window.showWarningMessage(
461+
`Required assets to build and debug are missing from '${projectName}'. Add them?`, disableItem, noItem, yesItem)
462+
.then(selection => resolve(selection.result));
463+
}
461464
});
462465
}
463466

0 commit comments

Comments
 (0)