mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 01:25:36 -05:00
Format sqlproj file XML on serialization (#10818)
* Format XML on serialization * Updating licences * Adding missing line in package.json * tabs to spaces * Updating yarn.lock file
This commit is contained in:
@@ -7,6 +7,7 @@ import * as path from 'path';
|
||||
import * as xmldom from 'xmldom';
|
||||
import * as constants from '../common/constants';
|
||||
import * as utils from '../common/utils';
|
||||
import * as xmlFormat from 'xml-formatter';
|
||||
|
||||
import { Uri } from 'vscode';
|
||||
import { promises as fs } from 'fs';
|
||||
@@ -305,7 +306,8 @@ export class Project {
|
||||
}
|
||||
|
||||
private async serializeToProjFile(projFileContents: any) {
|
||||
const xml = new xmldom.XMLSerializer().serializeToString(projFileContents); // TODO: how to get this to serialize with "pretty" formatting
|
||||
let xml = new xmldom.XMLSerializer().serializeToString(projFileContents);
|
||||
xml = xmlFormat(xml, { collapseContent: true, indentation: ' ' });
|
||||
|
||||
await fs.writeFile(this.projectFilePath, xml);
|
||||
}
|
||||
|
||||
@@ -69,4 +69,8 @@
|
||||
<Folder Include="Views\User"/>
|
||||
<Build Include="Views\User\Profile.sql"/>
|
||||
</ItemGroup>
|
||||
<Import Condition="'$(NetCoreBuild)' == 'true'" Project="$(NETCoreTargetsPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/><ItemGroup><PackageReference Condition="'$(NetCoreBuild)' == 'true'" Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All"/></ItemGroup></Project>
|
||||
<Import Condition="'$(NetCoreBuild)' == 'true'" Project="$(NETCoreTargetsPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="'$(NetCoreBuild)' == 'true'" Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user