GetPythonIntelliSenseInfo

Syntax

GetPythonIntelliSenseInfoResult GetPythonIntelliSenseInfo(OdId tObject, GetPythonIntelliSenseArg tArg)

Parameters

tObject. Moniker of the Python module, with which code the work is executed.

tArg. Operation execution parameters.

Description

The GetPythonIntelliSenseInfo operation gets a list of types and type members that can be used in the current Python code point.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetPythonIntelliSenseInfo xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>AFPDLADJINDAGOAEPHGKIBADCCNPCKBEKJPAEJFODGCJCBAD!M!304842</id>
  </tObject>
<tArg xmlns="">
  <text>from datetime import date;def SimpleProcedure(d): print("Today: " + d.strftime("%d-%b-%Y")) current_date = date.today()SimpleProcedure(current_date)</text>
<cursor>
  <col>20</col>
  <row>5</row>
  </cursor>
  </tArg>
  </GetPythonIntelliSenseInfo>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetPythonIntelliSenseInfoResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<items xmlns="">
<it>
  <type>Function</type>
  <name>ctime</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Property</type>
  <name>day</name>
  </it>
<it>
  <type>Function</type>
  <name>fromisoformat</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>fromordinal</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>fromtimestamp</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>isocalendar</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>isoformat</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>isoweekday</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Member</type>
  <name>max</name>
  </it>
<it>
  <type>Member</type>
  <name>min</name>
  </it>
<it>
  <type>Property</type>
  <name>month</name>
  </it>
<it>
  <type>Function</type>
  <name>replace</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Member</type>
  <name>resolution</name>
  </it>
<it>
  <type>Function</type>
  <name>strftime</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>timetuple</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>today</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>toordinal</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Function</type>
  <name>weekday</name>
  <signature>(*args)</signature>
  </it>
<it>
  <type>Property</type>
  <name>year</name>
  </it>
  </items>
  </GetPythonIntelliSenseInfoResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"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"
}
}
}
}

JSON response:

{
"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:

Working with Development Environment