Can I exclude part of the code from the format document in Visual Studio
I have some transliteration tables in the code that are formed to make it easier to see the pairs, simplified example:
oldChar = new string[] { "Æ", "æ", "Å", "å", "Ä", "ä", "Ø", "ø", "Ö", "ö" };
newChar = new string[] { "AE", "ae", "A", "a", "A", "a", "O", "o", "O", "o" };
and as a habit I use the Visual Document Format Document command a lot and naturally this command turns this piece of code into this:
oldChar = new string[] { "Æ", "æ", "Å", "å", "Ä", "ä", "Ø", "ø", "Ö", "ö" };
newChar = new string[] { "AE", "ae", "A", "a", "A", "a", "O", "o", "O", "o" };
May I say to leave this part alone, perhaps for the region?
+3
source to share
1 answer
Sorry, you can't. The format command works either against the entire document or from text. This is not to say to format and exclude a specific section.
A couple of really hackish options that I was thinking
- Comment lines, format, uncomment
- Write a macro to format the selection above and then below
0
source to share