Skip to content

Hide overridden JLO machinery from editor #688

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

Closed
jpobst opened this issue Aug 6, 2020 · 0 comments · Fixed by #698
Closed

Hide overridden JLO machinery from editor #688

jpobst opened this issue Aug 6, 2020 · 0 comments · Fixed by #698
Labels
enhancement Proposed change to current functionality generator Issues binding a Java library (generator, class-parse, etc.)

Comments

@jpobst
Copy link
Contributor

jpobst commented Aug 6, 2020

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.

@jpobst jpobst added enhancement Proposed change to current functionality generator Issues binding a Java library (generator, class-parse, etc.) labels Aug 6, 2020
jonpryor pushed a commit that referenced this issue Aug 28, 2020
Fixes: #688

Context: dotnet/android#4582
Context: dotnet/android@3c94f6f
Context: dotnet/android#4582 (comment)

In dotnet/android#4582 we hid "infrastructural" members like
`Java.Lang.Object.ThresholdClass` from the editor and debugger using
`[DebuggerBrowsable(DebuggerBrowsableState.Never)]` and
`[EditorBrowsable(EditorBrowsableState.Never)]`.

However, `generator` output overrides these members, and thus they're
*still* visible from the IDE editor and debugger.

In order to *fully* hide infrastructural members from the editor and
debugger, *every occurrence* of the member must also have
`DebuggerBrowsableAttribute` and `EditorBrowsableAttribute`!

Update `generator` so that all infrastructural members contain the
attributes necessary to hide them from code completion, e.g.

	[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]
	[global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)]
	public override global::Java.Interop.JniPeerMembers JniPeerMembers {
	    get { return _members; }
	}

This ensures that the members are in fact hidden from IDEs.
@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
enhancement Proposed change to current functionality generator Issues binding a Java library (generator, class-parse, etc.)
Projects
None yet
1 participant