dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.27k stars 5.9k forks source link

[New article]: Missing code analyzer IDE0320 #42105

Open Sella-GH opened 2 months ago

Sella-GH commented 2 months ago

Proposed topic or title

Make anonymous function static (IDE0320)

Location in table of contents.

Learn/.NET/Code Analysis/Rule reference/Code style rules/Language and unnecessary code rules/IDE0320

Reason for the article

It's an included analyzer inside the Visual Studio 2022 IDE. If you click on the link in the IDE which describes the IDE0320 analyzer you stumble across a 404 - Content Not Found page.

Article abstract

Relate to the other articles about IDEXXXX analyzers. Suggested TOC:

# Make anonymous function static (IDE0320)
{table with general property and value stats about the analyzer}
|Property|Value|
|---|---|
|**Rule ID**|IDE0320|
|etc|etc|
|**Options**|`csharp_prefer_static_anonymous_function`|

## Overview
{general explanation what this analyzer does}

## Options
{explanation what the options do}

### csharp_prefer_static_anonymous_function
{table with general property and value stats about the option}

## Example
{violation code}
{fixed code}

## Suppress a warning
{explain how to suppress the warning with #pragma or .editorconfig}

Relevant searches

wk-bd commented 2 months ago

I just hit this too. Here is the feature spec related to this analyzer: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/static-anonymous-functions