Skip to content

Commit 7855897

Browse files
committed
Added missing xml prolog to generated dgml files.
1 parent 7b6e17f commit 7855897

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/commands/showHierarchyBase.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export class ShowHierarchyBase extends CommandBase {
7979
// Serialize the xml into a string
8080
const xmlAsString = xmlSerializer.serializeToString(xmlDocument.documentElement);
8181
let fileContent = prettifyXml(xmlAsString);
82-
fileContent = fileContent.replace('HasCategory('RootComponent')', "HasCategory('RootComponent')");
82+
const xmlProlog = '<?xml version="1.0" encoding="utf-8"?>\n';
83+
fileContent = xmlProlog + fileContent.replace('HasCategory(&apos;RootComponent&apos;)', "HasCategory('RootComponent')");
8384

8485
// Write the prettified xml string to the ReadMe-ProjectStructure.dgml file.
8586
var directoryPath: string = this.fsUtils.getWorkspaceFolder();

0 commit comments

Comments
 (0)