Remove build and folder includes when converting to SDK-style project (#18889)

* remove Build and Folder Includes

* add tests

* cleanup

* rollback if there was an error during the conversion
This commit is contained in:
Kim Santiago
2022-04-01 18:04:18 -07:00
committed by GitHub
parent a795e64bed
commit d6dab3dd18
7 changed files with 296 additions and 35 deletions

View File

@@ -887,15 +887,19 @@ export class ProjectsController {
*/
public async convertToSdkStyleProject(context: dataworkspace.WorkspaceTreeItem): Promise<void> {
const project = this.getProjectFromContext(context);
const updateResult = await project.convertProjectToSdkStyle();
await project.convertProjectToSdkStyle();
void this.reloadProject(context);
if (!updateResult) {
void vscode.window.showErrorMessage(constants.updatedToSdkStyleError(project.projectFileName));
} else {
void this.reloadProject(context);
// show message that project file can be simplified
const result = await vscode.window.showInformationMessage(constants.projectUpdatedToSdkStyle(project.projectFileName), constants.learnMore);
// show message that project file can be simplified
const result = await vscode.window.showInformationMessage(constants.projectUpdatedToSdkStyle(project.projectFileName), constants.learnMore);
if (result === constants.learnMore) {
void vscode.env.openExternal(vscode.Uri.parse(constants.sdkLearnMoreUrl!));
if (result === constants.learnMore) {
void vscode.env.openExternal(vscode.Uri.parse(constants.sdkLearnMoreUrl!));
}
}
}