Skip to content

Add string.Format analyzer to IDiagnosticLogger.Log methods #3926

@jamescrosswell

Description

@jamescrosswell

Originally posted by @bruno-garcia in #3923 (comment)

See issue #3922

Basically someone (yeah, OK, it was me) accidentally used the wrong index in the format string when calling LogDebug.

As Bruno points out, we should use an analyzer to prevent this happening in the future, since it could crash the user's application.

Solutions

We could quickly enable this for JetBrains IDEs like so:

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeImprovementRoslynThe .NET Compiler Platform, Roslyn Components and Extensions, Microsoft.CodeAnalysis

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions