-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Version Used:
Version 17.2.0 Preview 2.0 [32303.453.main]
Steps to Reproduce:
Paste this and then start typing SomeNamespace.
using System.ComponentModel;
namespace SomeNamespace
{
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
internal class CoolTypeNotToBeUsed
{
}
}Expected Behavior:
CoolTypeNotToBeUsed doesn't show up in IntelliSense.
As it turns out, I shouldn't be surprised... the docs are pretty clear:
https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.editorbrowsableattribute?view=net-6.0
"Specifies that a property or method"... so, not a type
"In Visual C#, EditorBrowsableAttribute does not suppress members from a class in the same assembly."... so, yeah
But this makes EditorBrowsableAttribute useless for source generators that want to emit code that's not browsable by the rest of the library.
We should either change the meaning of EditorBrowsableState.Never in the IDE to actually mean "Never, not even in the same assembly", or we should add a new "NeverNotEvenInTheSameAssembly" state that does the right thing.
cc: @terrajobst, @jaredpar
