Wish [SOLVED] Only expose some classes in b4xlibs when using the library

Sandman

Expert
Licensed User
Longtime User
Let's say I have a b4xlib made out of ten classes. Only one or two of these are meant to be exposed in the code completion in the IDE, the rest nine classes are all internal to the lib. It sure would be nice to have a way to specify this somehow.

To be constructive, here are the three ways I can see to do this:

1. Add a field to manifest to hide classes meant to be private
B4X:
PrivateClasses=MyInternalCircularCalculationClass, SomeRadiusInformationPrivateClass, ThisLocationProcessingIsAlsoPrivateSoMuchWow

2. Add a field to manifest to expose classes meant to be available
Important note: Absense of this field would mean to expose ALL classes, to not break backward compatibility
B4X:
PublicClasses=MyGeofenceClass,MyLocationInfo

3. Add a directive in the class itself, to make IDE always exclude from code completion
B4X:
#ExcludeFromCodeCompletion

Sub Class_Globals
    Private fx As JFX
End Sub

'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
   
End Sub


I would be happy with any of these, but I think option 2 would be the best one because it's very explicit. It's probably possible to forget a class in the first option, but if you miss something in option 2 you would notice it quickly. Option 3 is somewhat in line with existing directives ("#ExcludeFromLibrary"), with the slight downside that it will interfere with the actual coding of the library as one wouldn't have the help of the code completion there.

I suppose I should also point out that this wish is only about avoiding noise in the code completion, this has nothing to do with security etc.
 
Last edited:

Sandman

Expert
Licensed User
Longtime User
Just a note that this was solved with B4A 12.5.
 
Top