Skip to content

[generator] Emit [EditorBrowsable(false)] and [DebuggerBrowsable(false)] for JLO machinery. #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Aug 26, 2020

Context: dotnet/android#4582
Fixes: #688

In dotnet/android#4582 we hid "internal" methods like Java.Lang.Object.ThresholdClass from the editor and debugger using [DebuggerBrowsable (DebuggerBrowsableState.Never)] and [EditorBrowsable (EditorBrowsableState.Never)]. However our bindings override some of these methods/properties and need to also apply these attributes or else they still show up in IDEs.

@@ -45,6 +45,7 @@ public static class Compiler
MetadataReference.CreateFromFile (unitTestFrameworkAssemblyPath),
MetadataReference.CreateFromFile (typeof(object).Assembly.Location),
MetadataReference.CreateFromFile (typeof(Enumerable).Assembly.Location),
MetadataReference.CreateFromFile (typeof(Uri).Assembly.Location),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This is to reference System.)

@jpobst jpobst marked this pull request as ready for review August 26, 2020 18:44
{
public override void WriteAttribute (CodeWriter writer)
{
writer.WriteLine ("[DebuggerBrowsable (DebuggerBrowsableState.Never)]");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry whenever we don't global::… fully qualify a type reference, as this has bitten us before. (I'd swear there's a current instance where we need-to-but-don't emit global:…, but I can't find it.)

@jonpryor jonpryor merged commit 0334f42 into master Aug 28, 2020
@jonpryor jonpryor deleted the editorbrowsable branch August 28, 2020 17:53
@jpobst jpobst added this to the 11.1 (16.9 / 8.9) milestone Sep 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide overridden JLO machinery from editor
2 participants