mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
Allow edit of sqlproj in place and reload (#11980)
* edit sql proj file * bug fix * updating reload project method * adding test for reload * formatting
This commit is contained in:
@@ -56,6 +56,8 @@ export class Project {
|
||||
* Reads the project setting and contents from the file
|
||||
*/
|
||||
public async readProjFile() {
|
||||
this.resetProject();
|
||||
|
||||
const projFileText = await fs.readFile(this.projectFilePath);
|
||||
this.projFileXmlDoc = new xmldom.DOMParser().parseFromString(projFileText.toString());
|
||||
|
||||
@@ -147,6 +149,17 @@ export class Project {
|
||||
}
|
||||
}
|
||||
|
||||
private resetProject() {
|
||||
this.files = [];
|
||||
this.importedTargets = [];
|
||||
this.databaseReferences = [];
|
||||
this.sqlCmdVariables = {};
|
||||
this.preDeployScripts = [];
|
||||
this.postDeployScripts = [];
|
||||
this.noneDeployScripts = [];
|
||||
this.projFileXmlDoc = undefined;
|
||||
}
|
||||
|
||||
public async updateProjectForRoundTrip() {
|
||||
await fs.copyFile(this.projectFilePath, this.projectFilePath + '_backup');
|
||||
await this.updateImportToSupportRoundTrip();
|
||||
|
||||
Reference in New Issue
Block a user