Skip to content

Commit c4f7239

Browse files
author
Sidney Andrews
committed
Add csharp.supressBuildAssetsNotification setting
1 parent 21c1668 commit c4f7239

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,10 @@
612612
"default": false,
613613
"description": "Suppress the notification window to perform a 'dotnet restore' when dependencies can't be resolved."
614614
},
615-
"csharp.suppressProjectJsonWarning": {
615+
"csharp.supressBuildAssetsNotification": {
616616
"type": "boolean",
617617
"default": false,
618-
"description": "Suppress the warning that project.json is no longer a supported project format for .NET Core applications"
618+
"description": "Suppress the notification window to add missing assets to build or debug the application."
619619
},
620620
"csharp.suppressHiddenDiagnostics": {
621621
"type": "boolean",

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)