Skip to content

Commit 56c79b3

Browse files
authored
Add docs for IDE3000 (#46275)
1 parent e72182e commit 56c79b3

File tree

5 files changed

+85
-2
lines changed

5 files changed

+85
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
> [!NOTE]
2-
> Even if you [enable code style rules on build](../overview.md#enable-on-build), this rule is not enabled. It only surfaces in the Visual Studio editor.
2+
> Even if you [enable code style rules on build](../overview.md#enable-on-build), this rule is not enabled. It only surfaces in the IDE.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: "IDE3000: Implement with Copilot"
3+
description: "Learn about code analysis rule IDE3000: Implement with Copilot."
4+
ms.date: 05/20/2025
5+
f1_keywords:
6+
- IDE3000
7+
helpviewer_keywords:
8+
- IDE3000
9+
dev_langs:
10+
- CSharp
11+
ai-usage: ai-assisted
12+
---
13+
14+
# Implement with Copilot (IDE3000)
15+
16+
| Property | Value |
17+
|--------------------------|-------------------------------|
18+
| **Rule ID** | IDE3000 |
19+
| **Title** | Implement with Copilot |
20+
| **Category** | CodeQuality |
21+
| **Subcategory** | Miscellaneous rules |
22+
| **Applicable languages** | C# |
23+
24+
## Overview
25+
26+
This rule identifies methods that contain a <xref:System.NotImplementedException> and provides a light bulb suggestion to implement the method using GitHub Copilot. When you use this code fix, GitHub Copilot generates an implementation for the method based on its signature, type context, and other available information.
27+
28+
[!INCLUDE [enabled-on-build-never](../includes/enabled-on-build-never.md)]
29+
30+
## Options
31+
32+
This rule has no associated code-style options.
33+
34+
## Example
35+
36+
```csharp
37+
// Code with NotImplementedException
38+
public class Calculator
39+
{
40+
public int Add(int a, int b)
41+
{
42+
// IDE3000: Implement with Copilot.
43+
throw new NotImplementedException();
44+
}
45+
}
46+
```
47+
48+
When you click on the light bulb suggestion, select the **Implement with Copilot** option to prompt GitHub Copilot to generate an implementation for the method.
49+
50+
## Suppress a warning
51+
52+
If you want to suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the rule.
53+
54+
```csharp
55+
#pragma warning disable IDE3000
56+
// The code that's violating the rule is on this line.
57+
#pragma warning restore IDE3000
58+
```
59+
60+
To disable the rule for a file, folder, or project, set its severity to `none` in the [configuration file](../configuration-files.md).
61+
62+
```ini
63+
[*.{cs,vb}]
64+
dotnet_diagnostic.IDE3000.severity = none
65+
```
66+
67+
To disable all of the code-style rules, set the severity for the category `Style` to `none` in the [configuration file](../configuration-files.md).
68+
69+
```ini
70+
[*.{cs,vb}]
71+
dotnet_analyzer_diagnostic.category-Style.severity = none
72+
```
73+
74+
For more information, see [How to suppress code analysis warnings](../suppress-warnings.md).
75+
76+
## See also
77+
78+
- [Generate unit tests with GitHub Copilot](../../../core/testing/unit-testing-with-copilot.md)
79+
- [Code style rules reference](index.md)

docs/fundamentals/code-analysis/style-rules/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Code-style rules overview
33
description: Learn about the different .NET code-style rules and categories.
4-
ms.date: 03/25/2025
4+
ms.date: 05/20/2025
55
author: gewarren
66
ms.author: gewarren
77
---
@@ -148,6 +148,7 @@ The following table list all the code-style rules by ID and [options](../code-st
148148
> | [IDE0350](ide0350.md) | Use implicitly typed lambda | [csharp_style_prefer_implicitly_typed_lambda_expression](ide0350.md#csharp_style_prefer_implicitly_typed_lambda_expression) |
149149
> | [IDE1005](ide1005.md) | Use conditional delegate call | [csharp_style_conditional_delegate_call](ide1005.md#csharp_style_conditional_delegate_call) |
150150
> | [IDE1006](naming-rules.md) | Naming styles | |
151+
> | [IDE3000](ide3000.md) | Implement with Copilot | |
151152
152153
> [!NOTE]
153154
> There are some rules that only surface in the Visual Studio IDE, and these regard JSON and regular expression pattern strings. For more information, see [JSON001](/visualstudio/ide/reference/json001), [JSON002](/visualstudio/ide/reference/json002), and [RE0001](/visualstudio/ide/reference/re0001).

docs/fundamentals/code-analysis/style-rules/miscellaneous-rules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This section contains code-style rules that don't fit in any other category. The
1111

1212
- [Remove invalid global 'SuppressMessageAttribute' (IDE0076)](ide0076.md)
1313
- [Avoid legacy format target in global 'SuppressMessageAttribute' (IDE0077)](ide0077.md)
14+
- [Implement with Copilot (IDE3000)](ide3000.md)
1415

1516
## See also
1617

docs/navigate/tools-diagnostics/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,8 @@ items:
16971697
href: ../../fundamentals/code-analysis/style-rules/ide0076.md
16981698
- name: IDE0077
16991699
href: ../../fundamentals/code-analysis/style-rules/ide0077.md
1700+
- name: IDE3000
1701+
href: ../../fundamentals/code-analysis/style-rules/ide3000.md
17001702
- name: Formatting rules
17011703
items:
17021704
- name: IDE0055

0 commit comments

Comments
 (0)