jmrog / vscode-nuget-package-manager

An extension for Visual Studio Code that lets you easily add or remove .NET Core 1.1+ package references to/from your project's .csproj file using Code's Command Palette.
MIT License
34 stars 17 forks source link

Enhancement: Dont remove comments in csproj #9

Open CarlosAzocar opened 7 years ago

CarlosAzocar commented 7 years ago

Dont delete comments in csproj after installing package

jmrog commented 7 years ago

Thanks. This is another good suggestion. The current behavior is a result of the fact that, for whatever reason, the XML parser that this extension uses, 'xml2js', strips out comment nodes. There is an open PR on xml2js from 2012 that addresses this, but it looks like there hasn't been any progress made since then. Unfortunately, this means that the solution here is probably going to involve swapping out dependencies, and possibly writing some parsing of our own using sax.js.

jmrog commented 7 years ago

In the meantime, I'll add the fact that comments get stripped to the "Known Issues" for this extension.

jmrog commented 7 years ago

Marking as "help wanted" since I've had very little time to dedicate to this lately, and don't expect that to change too soon.