GetPythonIntelliSenseTooltipResult GetPythonIntelliSenseTooltip(OdId tObject, GetPythonIntelliSenseArg tArg)
tObject. Moniker of the Python module, with which code the work is executed.
tArg. Operation execution parameters.
The GetPythonIntelliSenseTooltip operation gets information used on creating a tooltip for type or type member in Python module code.
To execute the operation, in the tObject field specify module moniker and in the tArg.cursor field specify the cursor layout coordinates in the code. If the module was changed but it has not been saved yet, its code can be passed in the tArg.meta field.
The operation results in the collection of code elements that can be used in the specified code coordinate.
Below is the example of getting a tooltip in the specified code coordinate. The request contains Python module moniker, its changed text and code coordinates. The response contains the obtained tooltip.
{
"GetPythonIntelliSenseTooltip" :
{
"tObject" :
{
"id" : "PNPCCFAPCFEAGOAENJNHNIHKMPIHDHKEJJACNBBIDLGLMMMC!M!304842"
},
"tArg" :
{
"text" : "from datetime import date;def SimpleProcedure(d):\tprint("Today: " + d.strftime("%d-%b-%Y"))\tcurrent_date = date.today()SimpleProcedure(current_date)",
"cursor" :
{
"col" : "16",
"row" : "6"
}
}
}
}
{
"GetPythonIntelliSenseTooltipResult" :
{
"tooltip" : "SimpleProcedure(**d**)"
}
}
public static GetPythonIntelliSenseTooltipResult GetPythonIntelliSenseTooltip(MbId mb, string pythonModuleId, string pythonText)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new GetPythonIntelliSenseTooltip()
{
tArg = new GetPythonIntelliSenseArg()
{
cursor = new CodePoint()
{
row = 6,
col = 16
},
text = pythonText
},
// Python module moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, pythonModuleId).k }
};
// Get information
var result = somClient.GetPythonIntelliSenseTooltip(tGet);
return result;
}
See also: