opening basic ide

how do i open basic ide (macro editor) within libreoffice basic code?

i can access the ide from menu and put its icon on toolbar,

but i’d also like to be able to open the ide directly,

for instance from a window manager menu, as:

libreoffice <file> macro:///<library>.<module>.<macro>

having a basic function (<macro>) that holds the code for doing that (as with opening database tables)

Without much research I only can tell you that the “slot-machine” has a working command .uno:BasicIDEAppear which you can call using the DispatchHelper using in turn an appropriate frame as its DispatchProvider. As mostly I don’t know what parameters (PropertyValue) the command would accept. Probably you can use it to navigate to the Sub you want to move to the view.
Concerning the access to scripts independent of the IDE you should search the famous texts by Andrew Pitonyak. You also should find there something about handling the IDE.

Here is some code to point you in the right direction.

Sub openBasicIDE
    oFrame = ThisComponent.CurrentController.Frame
    oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    oDispatcher.executeDispatch(oFrame, ".uno:BasicIDEAppear", "", 0, Array())
    oComponents = StarDesktop.getComponents()
    oDocs = oComponents.createEnumeration()
    While oDocs.hasMoreElements()
        oDoc = oDocs.nextElement()
        If oDoc.supportsService("com.sun.star.script.BasicIDE") Then
            MsgBox "Found the Basic IDE"
        End If
    Wend
End Sub

Use an introspection tool such as XrayTool or MRI to find out what oDoc can do. For example, there is a method loadFromStorage with which you may be able to specify a module to load.