I am doing inline documentation on an API, using XML in comments, and I'd like to keep the indenting. Every time the document is formatted (CTRL+K CTRL+D), all indenting inside /* */ is removed. Is there an option to prevent this from happening? It looks like I can keep the indenting if I use single line commenting, but I'd rather not resort to this. Thanks for your time.
/*
<ObjectProperty Name="id" Type="string" DefaultValue="''">
<Description>
Unique identifier of the data store. Primarily used for getting a handle <docref class="ObjectManager">ObjectManager</docref>.
</Description>
<Examples>
<Example>
// Create an anonymous DataStore
// Update and Sort the data by using ObjectManager
new DataStore({ id: 'PersonsDS' });
ObjectManager.GetDataStore('PersonsDS').UpdateData([
{
ID: 1,
FirstName: 'Joe',
LastName: 'Bloggs'
},
{
ID: 2,
FirstName: 'Jane',
LastName: 'Doe'
}
]).Sort('LastName', 'desc');
</Example>
</Examples>
</ObjectProperty>
*/
Should look like
/*
<ObjectProperty Name="id" Type="string" DefaultValue="''">
<Description>
Unique identifier of the data store. Primarily used for getting a handle <docref class="ObjectManager">ObjectManager</docref>.
</Description>
<Examples>
<Example>
// Create an anonymous DataStore
// Update and Sort the data by using ObjectManager
new DataStore({ id: 'PersonsDS' });
ObjectManager.GetDataStore('PersonsDS').UpdateData([
{
ID: 1,
FirstName: 'Joe',
LastName: 'Bloggs'
},
{
ID: 2,
FirstName: 'Jane',
LastName: 'Doe'
}
]).Sort('LastName', 'desc');
</Example>
</Examples>
</ObjectProperty>
*/
In Visual Studio 2010 with Productivity Power Tools installed (free extension from Microsoft, a must-have) this problem does not exist - formatting is preserved in comments when the file is automatically formatted via Ctrl + K, D.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With