tomasr / viasfora

A Visual Studio Extension containing miscellaneous improvements to the editor.
Other
557 stars 91 forks source link

String Format Specifier issues #283

Open nurbles opened 5 years ago

nurbles commented 5 years ago

I really like the ability to have a special color for string format specifiers (thank you!) but issues with the matching actually caused me to make some formatting errors before I realized that it only matches very simple, basic format specifiers.

For example, try this string with Viasfora: "%d xx %-2.2s xx %hd xx %hhd xx %I64u" and you will see that not all of the characters in all of the format specifiers are colored correctly.

To really be helpful rather than a little misleading, I think the matcher should support the formats as Microsoft documented them for its compiler: Format Specification Syntax

Finally, I also think that "%%" should [optionally?] be matched, but I am unsure whether to consider it a format specifier or an escape. It is a special escape for the character that begins a format specifier. Either would probably work.