Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/FsAutoComplete.Core/FsprojEdit.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module FsProjEditor =

let moveFileUp (fsprojPath: string) (file: string) =
let xDoc = System.Xml.XmlDocument()
xDoc.PreserveWhitespace <- true // to keep custom formatting if present
xDoc.Load fsprojPath
let xpath = sprintf "//Compile[@Include='%s']/.." file
let itemGroup = xDoc.SelectSingleNode(xpath)
Expand All @@ -64,6 +65,7 @@ module FsProjEditor =

let moveFileDown (fsprojPath: string) (file: string) =
let xDoc = System.Xml.XmlDocument()
xDoc.PreserveWhitespace <- true // to keep custom formatting if present
xDoc.Load fsprojPath
let xpath = sprintf "//Compile[@Include='%s']/.." file
let itemGroup = xDoc.SelectSingleNode(xpath)
Expand Down Expand Up @@ -96,6 +98,7 @@ module FsProjEditor =

let addFileBelow (fsprojPath: string) (belowFile: string) (newFileName: string) =
let xDoc = System.Xml.XmlDocument()
xDoc.PreserveWhitespace <- true // to keep custom formatting if present
xDoc.Load fsprojPath

if fileAlreadyIncludedViaCompileTag xDoc newFileName then
Expand All @@ -112,6 +115,7 @@ module FsProjEditor =

let renameFile (fsprojPath: string) (oldFileName: string) (newFileName: string) =
let xDoc = System.Xml.XmlDocument()
xDoc.PreserveWhitespace <- true // to keep custom formatting if present
xDoc.Load fsprojPath
let xpath = sprintf "//Compile[@Include='%s']" oldFileName
let node = xDoc.SelectSingleNode(xpath)
Expand All @@ -120,6 +124,7 @@ module FsProjEditor =

let addFile (fsprojPath: string) (newFileName: string) =
let xDoc = System.Xml.XmlDocument()
xDoc.PreserveWhitespace <- true // to keep custom formatting if present
xDoc.Load fsprojPath

if fileAlreadyIncludedViaCompileTag xDoc newFileName then
Expand Down Expand Up @@ -156,6 +161,7 @@ module FsProjEditor =

let removeFile (fsprojPath: string) (fileToRemove: string) =
let xDoc = System.Xml.XmlDocument()
xDoc.PreserveWhitespace <- true // to keep custom formatting if present
xDoc.Load fsprojPath
let sanitizedFileToRemove = fileToRemove.Replace("\\", "/")

Expand Down
Loading