VSDiagnostics icon indicating copy to clipboard operation
VSDiagnostics copied to clipboard

Implement StringDotFormatToInterpolatedString analyzer

Open Vannevelj opened this issue 9 years ago • 5 comments

Step away from the pre-C# 6 string.Format and use an interpolated string instead. Take note that I'm not entirely sure yet if an interpolated string has all the capabilities string.Format has. Something about a new type FormattableString?

Vannevelj avatar May 29 '15 20:05 Vannevelj

Relevant Roslyn issue: https://github.com/dotnet/roslyn/issues/7044

Vannevelj avatar May 09 '16 01:05 Vannevelj

As the feature was being developed the community decided and ensure that the capabilities and internal syntax matched String.Format. With exception that argument holes can use expressions within them. Support for this has already been implement by the community.

AdamSpeight2008 avatar Jun 16 '16 18:06 AdamSpeight2008

@AdamSpeight2008 What exactly do you mean when you refer to "the community"?

Vannevelj avatar Jun 17 '16 08:06 Vannevelj

@Vannevelj people who are interested and or develop Roslyn, Analysters etc.

Eg CSharp Essentials+ by Dustin Campbell

AdamSpeight2008 avatar Jun 17 '16 09:06 AdamSpeight2008

True, it has been implemented before. Still, I'd like to have it (eventually) in VSDiagnostics as well. Otherwise the user is basically forced to install multiple packages. Obviously this is a long-term view but it doesn't hurt to have it on the backlog.

Vannevelj avatar Jun 22 '16 15:06 Vannevelj