GetPythonIntelliSenseInfoResult GetPythonIntelliSenseInfo(OdId tObject, GetPythonIntelliSenseArg tArg)
tObject. Moniker of the Python module, with which code the work is executed.
tArg. Operation execution parameters.
The GetPythonIntelliSenseInfo operation gets a list of types and type members that can be used in the current Python code point.
The operation gets the list that will be displayed on using the IntelliSense technology during Python module code development. To execute the operation, in the tObject field specify Python 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.text 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 the list of types and type members that can be used in the specified code coordinate. The request contains Python module moniker, its changed text and code coordinates. The response contains the obtained list of types and type members.
{
"GetPythonIntelliSenseInfo" :
{
"tObject" :
{
"id" : "AFPDLADJINDAGOAEPHGKIBADCCNPCKBEKJPAEJFODGCJCBAD!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" : "20",
"row" : "5"
}
}
}
}
{
"GetPythonIntelliSenseInfoResult" :
{
"items" :
{
"it" :
[
{
"type" : "Function",
"name" : "ctime",
"signature" : "(*args)"
},
{
"type" : "Property",
"name" : "day"
},
{
"type" : "Function",
"name" : "fromisoformat",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "fromordinal",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "fromtimestamp",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "isocalendar",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "isoformat",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "isoweekday",
"signature" : "(*args)"
},
{
"type" : "Member",
"name" : "max"
},
{
"type" : "Member",
"name" : "min"
},
{
"type" : "Property",
"name" : "month"
},
{
"type" : "Function",
"name" : "replace",
"signature" : "(*args)"
},
{
"type" : "Member",
"name" : "resolution"
},
{
"type" : "Function",
"name" : "strftime",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "timetuple",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "today",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "toordinal",
"signature" : "(*args)"
},
{
"type" : "Function",
"name" : "weekday",
"signature" : "(*args)"
},
{
"type" : "Property",
"name" : "year"
}
]
}
}
}
public static GetPythonIntelliSenseInfoResult GetPythonIntelliSenseInfo(MbId mb, string pythonModuleId, string pythonText)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new GetPythonIntelliSenseInfo()
{
tArg = new GetPythonIntelliSenseArg()
{
cursor = new CodePoint()
{
row = 5,
col = 20
},
text = pythonText
},
// Python module moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, pythonModuleId).k }
};
// Get information
var result = somClient.GetPythonIntelliSenseInfo(tGet);
return result;
}
See also: