Page MenuHomePhabricator

csharp: Hide internal stuff from editors.
AbandonedPublic

Authored by lauromoura on Sep 23 2019, 6:29 PM.

Details

Summary

Add editor guards around many implementation details that can't be
internal/private.

This way these things won't appear to IntelliSense/MonoDevelop, while
still being reachable by manual code (if you know the name of the
things).

Fixes T7752
Fixes T8165

Diff Detail

Repository
rEFL core/efl
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13573
Build 9495: arc lint + arc unit
lauromoura created this revision.Sep 23 2019, 6:29 PM
lauromoura requested review of this revision.Sep 23 2019, 6:29 PM

EditorBrowsableState.Never can also be used to hide things from the DocFX-generated docs, so I'm OK with this.

I had not success hiding this from DocFX, even though it should be possible:
https://dotnet.github.io/docfx/tutorial/howto_filter_out_unwanted_apis_attributes.html

Current filter rules seem to work fine, so I'll come back to this later on.

segfaultxavi requested changes to this revision.Sep 30 2019, 7:17 AM

OK, generated files need to have using System.ComponentModel; at the top for DocFX to correctly understand this attribute (and other editors probably too...)

This revision now requires changes to proceed.Sep 30 2019, 7:17 AM

OK, generated files need to have using System.ComponentModel; at the top for DocFX to correctly understand this attribute (and other editors probably too...)

But doesn't generated files already have this? See https://phab.enlightenment.org/diffusion/EFL/browse/master/src/bin/eolian_mono/eolian_mono.cc$140

lauromoura planned changes to this revision.Sep 30 2019, 8:17 PM

In any case, this patch needs to be updated as there is a lot of stuff that could be hidden in the manual bindings.

Yeah, you're right. These methods still appear in the DocFX output and I have no idea why.

For the record, this is the filter I am currently using at the top of filterConfig.yml:

- exclude:
    hasAttribute:
      uid: System.ComponentModel.EditorBrowsableAttribute
      ctorArguments:
      - System.ComponentModel.EditorBrowsableState.Never

I've created a minimal example in https://github.com/lauromoura/docfx-attribute-issues to try attribute filtering. It seems that it is not an EditorBroswable only thing as it affects custom attributes too, if they have a constructor.

I've created a minimal example in https://github.com/lauromoura/docfx-attribute-issues to try attribute filtering. It seems that it is not an EditorBroswable only thing as it affects custom attributes too, if they have a constructor.

Submitted two issues upstream:

https://github.com/dotnet/docfx/issues/5159 - hasAttribute not working

https://github.com/dotnet/docfx/issues/5160 - building docfx fails (for debugging the first one)

lauromoura abandoned this revision.Wed, Oct 30, 2:16 PM

Abandoning this revision as we are going with the internal approach now.