阻止Visual Studio 2010中的注释格式

Bre*_*ett 5 visual-studio-2010 visual-studio

我正在使用API​​中的内联文档,在评论中使用XML,我想保留缩进.每次格式化文档(CTRL + K CTRL + D)时,都会删除/**/中的所有缩进.有没有办法防止这种情况发生?如果我使用单行注释,看起来我可以保持缩进,但我宁愿不诉诸于此.谢谢你的时间.

/*
<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>
*/
Run Code Online (Sandbox Code Playgroud)

应该是这样的

/*
<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>
*/
Run Code Online (Sandbox Code Playgroud)

sko*_*ima 1

在安装了Productivity Power Tools(Microsoft 的免费扩展,必备)的Visual Studio 2010 中,不存在此问题 - 当文件通过Ctrl+ K, .自动格式化时,格式会保留在注释中D