dotnet / dotnet/roslyn

Naming suggestions fail to correctly identify private members that lack the privatemodifier.

Open
#84,549 0 comments 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Naming-suggestions-fail-to-correctly-ide/11081199)._

---
[severity:It's more difficult to complete my work] [regression]
If you want to declare a private field of type intbut do not prefer to add the privatemodifier, the naming suggestions provided when typing the type intwill follow the style for public members. If the privatemodifier is present, the correct suggestion is given. I have ruled out the influence of extensions.

This bug likely emerged in recent versions of VS2026, as I've never noticed this issue before.

Image

if `private` exists, it is correct.

Image

Additionally, there is another issue: when a class or struct implements IDisposable, the naming suggestion inexplicably always recommends naming it IDisposable.

Image

---
### Original Comments

#### Feedback Bot on 4/27/2026, 10:56 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

#### Yeong Ping Tan (Centific Technologies Inc) [MSFT] on 5/15/2026, 00:05 PM:

Thank you for taking the time to log this issue!


Thank you for sharing the detailed steps. I was able to reproduce the issue based on the information you provided, and it has been escalated for further investigation. if there is any process, I will inform you immediately.


We look forward to hearing from you!

Contributor guide

Open the contributing guide

Research direction

Reproduce the naming suggestions in VS2026 for a private field without the private modifier and for a class or struct implementing IDisposable. Start by tracing the Roslyn naming-suggestion behavior from those cases; done means both cases recommend the appropriate naming style rather than the public-member or IDisposable name.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.