Mon, 22 Jun 2020 19:16:15 +0200
Removed support for Python2.
<!DOCTYPE html> <html><head> <title>Plugin_Assistant_Eric.AssistantEric.Assistant</title> <meta charset="UTF-8"> <style> body { background: #EDECE6; margin: 0em 1em 10em 1em; color: black; } h1 { color: white; background: #85774A; } h2 { color: white; background: #85774A; } h3 { color: white; background: #9D936E; } h4 { color: white; background: #9D936E; } a { color: #BA6D36; } </style> </head> <body> <a NAME="top" ID="top"></a> <h1>Plugin_Assistant_Eric.AssistantEric.Assistant</h1> <p> Module implementing the eric assistant, an alternative autocompletion and calltips system. </p> <h3>Global Attributes</h3> <table> <tr><td>AcsAPIs</td></tr><tr><td>AcsDocument</td></tr><tr><td>AcsProject</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#Assistant">Assistant</a></td> <td>Class implementing the autocompletion and calltips system.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="Assistant" ID="Assistant"></a> <h2>Assistant</h2> <p> Class implementing the autocompletion and calltips system. </p> <h3>Derived from</h3> QObject <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#Assistant.__init__">Assistant</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#Assistant.__editorClosed">__editorClosed</a></td> <td>Private slot called, when an editor was closed.</td> </tr> <tr> <td><a href="#Assistant.__editorOpened">__editorOpened</a></td> <td>Private slot called, when a new editor was opened.</td> </tr> <tr> <td><a href="#Assistant.__getApiCalltips">__getApiCalltips</a></td> <td>Private method to determine calltips from APIs.</td> </tr> <tr> <td><a href="#Assistant.__getApiCompletions">__getApiCompletions</a></td> <td>Private method to determine a list of completions from an API object.</td> </tr> <tr> <td><a href="#Assistant.__getCompletions">__getCompletions</a></td> <td>Private method to get the list of possible completions.</td> </tr> <tr> <td><a href="#Assistant.__getDocumentCalltips">__getDocumentCalltips</a></td> <td>Private method to determine calltips from the document.</td> </tr> <tr> <td><a href="#Assistant.__getDocumentCompletions">__getDocumentCompletions</a></td> <td>Private method to determine autocompletion proposals from the document.</td> </tr> <tr> <td><a href="#Assistant.__getProjectType">__getProjectType</a></td> <td>Private method to determine the project type to be used.</td> </tr> <tr> <td><a href="#Assistant.__preferencesChanged">__preferencesChanged</a></td> <td>Private method to handle a change of the global configuration.</td> </tr> <tr> <td><a href="#Assistant.__recordSelectedContext">__recordSelectedContext</a></td> <td>Private slot to handle the selection from the completion list to record the selected completion context.</td> </tr> <tr> <td><a href="#Assistant.__setAutoCompletionHook">__setAutoCompletionHook</a></td> <td>Private method to set the autocompletion hook.</td> </tr> <tr> <td><a href="#Assistant.__setCalltipsHook">__setCalltipsHook</a></td> <td>Private method to set the calltip hook.</td> </tr> <tr> <td><a href="#Assistant.__shutdown">__shutdown</a></td> <td>Private slot to handle the shutdown signal.</td> </tr> <tr> <td><a href="#Assistant.__unsetAutoCompletionHook">__unsetAutoCompletionHook</a></td> <td>Private method to unset the autocompletion hook.</td> </tr> <tr> <td><a href="#Assistant.__unsetCalltipsHook">__unsetCalltipsHook</a></td> <td>Private method to unset the calltip hook.</td> </tr> <tr> <td><a href="#Assistant.activate">activate</a></td> <td>Public method to perform actions upon activation.</td> </tr> <tr> <td><a href="#Assistant.calltips">calltips</a></td> <td>Public method to return a list of calltips.</td> </tr> <tr> <td><a href="#Assistant.deactivate">deactivate</a></td> <td>Public method to perform actions upon deactivation.</td> </tr> <tr> <td><a href="#Assistant.getCompletionsList">getCompletionsList</a></td> <td>Public method to get a list of possible completions.</td> </tr> <tr> <td><a href="#Assistant.setEnabled">setEnabled</a></td> <td>Public method to enable or disable a feature.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="Assistant.__init__" ID="Assistant.__init__"></a> <h4>Assistant (Constructor)</h4> <b>Assistant</b>(<i>plugin, parent=None</i>) <p> Constructor </p> <dl> <dt><i>plugin</i></dt> <dd> reference to the plugin object </dd> <dt><i>parent</i></dt> <dd> parent (QObject) </dd> </dl> <a NAME="Assistant.__editorClosed" ID="Assistant.__editorClosed"></a> <h4>Assistant.__editorClosed</h4> <b>__editorClosed</b>(<i>editor</i>) <p> Private slot called, when an editor was closed. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor (QScintilla.Editor) </dd> </dl> <a NAME="Assistant.__editorOpened" ID="Assistant.__editorOpened"></a> <h4>Assistant.__editorOpened</h4> <b>__editorOpened</b>(<i>editor</i>) <p> Private slot called, when a new editor was opened. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the new editor (QScintilla.Editor) </dd> </dl> <a NAME="Assistant.__getApiCalltips" ID="Assistant.__getApiCalltips"></a> <h4>Assistant.__getApiCalltips</h4> <b>__getApiCalltips</b>(<i>api, word, commas, prefix, module, editor</i>) <p> Private method to determine calltips from APIs. </p> <dl> <dt><i>api</i></dt> <dd> reference to the API object to be used (APIsManager.DbAPIs) </dd> <dt><i>word</i></dt> <dd> function to get calltips for (string) </dd> <dt><i>commas</i></dt> <dd> minimum number of commas contained in the calltip (integer) </dd> <dt><i>prefix</i></dt> <dd> prefix of the word to be completed (string) </dd> <dt><i>module</i></dt> <dd> reference to the scanned module info (Module) </dd> <dt><i>editor</i></dt> <dd> reference to the editor object (QScintilla.Editor) </dd> </dl> <dl> <dt>Returns:</dt> <dd> list of calltips (list of string) </dd> </dl> <a NAME="Assistant.__getApiCompletions" ID="Assistant.__getApiCompletions"></a> <h4>Assistant.__getApiCompletions</h4> <b>__getApiCompletions</b>(<i>api, word, context, prefix, module, editor</i>) <p> Private method to determine a list of completions from an API object. </p> <dl> <dt><i>api</i></dt> <dd> reference to the API object to be used (APIsManager.DbAPIs) </dd> <dt><i>word</i></dt> <dd> word (or wordpart) to complete (string) </dd> <dt><i>context</i></dt> <dd> flag indicating to autocomplete a context (boolean) </dd> <dt><i>prefix</i></dt> <dd> prefix of the word to be completed (string) </dd> <dt><i>module</i></dt> <dd> reference to the scanned module info (Module) </dd> <dt><i>editor</i></dt> <dd> reference to the editor object (QScintilla.Editor.Editor) </dd> </dl> <dl> <dt>Returns:</dt> <dd> list of possible completions (list of strings) </dd> </dl> <a NAME="Assistant.__getCompletions" ID="Assistant.__getCompletions"></a> <h4>Assistant.__getCompletions</h4> <b>__getCompletions</b>(<i>word, context, prefix, language, projectType, module, editor, importCompletion, documentOnly, sep</i>) <p> Private method to get the list of possible completions. </p> <dl> <dt><i>word</i></dt> <dd> word (or wordpart) to complete (string) </dd> <dt><i>context</i></dt> <dd> flag indicating to autocomplete a context (boolean) </dd> <dt><i>prefix</i></dt> <dd> prefix of the word to be completed (string) </dd> <dt><i>language</i></dt> <dd> programming language of the source (string) </dd> <dt><i>projectType</i></dt> <dd> type of the project (string) </dd> <dt><i>module</i></dt> <dd> reference to the scanned module info (Module) </dd> <dt><i>editor</i></dt> <dd> reference to the editor object (QScintilla.Editor.Editor) </dd> <dt><i>importCompletion</i></dt> <dd> flag indicating an import completion (boolean) </dd> <dt><i>documentOnly</i></dt> <dd> flag indicating to complete from the document only (boolean) </dd> <dt><i>sep</i></dt> <dd> separator string (string) </dd> </dl> <dl> <dt>Returns:</dt> <dd> list of possible completions (list of strings) </dd> </dl> <a NAME="Assistant.__getDocumentCalltips" ID="Assistant.__getDocumentCalltips"></a> <h4>Assistant.__getDocumentCalltips</h4> <b>__getDocumentCalltips</b>(<i>word, prefix, module, editor, doHierarchy=False</i>) <p> Private method to determine calltips from the document. </p> <dl> <dt><i>word</i></dt> <dd> function to get calltips for (string) </dd> <dt><i>prefix</i></dt> <dd> prefix of the word to be completed (string) </dd> <dt><i>module</i></dt> <dd> reference to the scanned module info (Module) </dd> <dt><i>editor</i></dt> <dd> reference to the editor object (QScintilla.Editor) </dd> <dt><i>doHierarchy=</i></dt> <dd> flag indicating a hierarchical search (boolean) </dd> </dl> <dl> <dt>Returns:</dt> <dd> list of calltips (list of string) </dd> </dl> <a NAME="Assistant.__getDocumentCompletions" ID="Assistant.__getDocumentCompletions"></a> <h4>Assistant.__getDocumentCompletions</h4> <b>__getDocumentCompletions</b>(<i>editor, word, context, sep, prefix, module, doHierarchy=False</i>) <p> Private method to determine autocompletion proposals from the document. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor object (QScintilla.Editor.Editor) </dd> <dt><i>word</i></dt> <dd> string to be completed (string) </dd> <dt><i>context</i></dt> <dd> flag indicating to autocomplete a context (boolean) </dd> <dt><i>sep</i></dt> <dd> separator string (string) </dd> <dt><i>prefix</i></dt> <dd> prefix of the word to be completed (string) </dd> <dt><i>module</i></dt> <dd> reference to the scanned module info (Module) </dd> <dt><i>doHierarchy=</i></dt> <dd> flag indicating a hierarchical search (boolean) </dd> </dl> <dl> <dt>Returns:</dt> <dd> list of possible completions (list of strings) </dd> </dl> <a NAME="Assistant.__getProjectType" ID="Assistant.__getProjectType"></a> <h4>Assistant.__getProjectType</h4> <b>__getProjectType</b>(<i>editor</i>) <p> Private method to determine the project type to be used. </p> <dl> <dt><i>editor</i> (Editor)</dt> <dd> reference to the editor to check </dd> </dl> <dl> <dt>Returns:</dt> <dd> project type </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <a NAME="Assistant.__preferencesChanged" ID="Assistant.__preferencesChanged"></a> <h4>Assistant.__preferencesChanged</h4> <b>__preferencesChanged</b>(<i></i>) <p> Private method to handle a change of the global configuration. </p> <a NAME="Assistant.__recordSelectedContext" ID="Assistant.__recordSelectedContext"></a> <h4>Assistant.__recordSelectedContext</h4> <b>__recordSelectedContext</b>(<i>userListId, txt</i>) <p> Private slot to handle the selection from the completion list to record the selected completion context. </p> <dl> <dt><i>userListId</i></dt> <dd> the ID of the user list (should be 1) (integer) </dd> <dt><i>txt</i></dt> <dd> the selected text (string) </dd> </dl> <a NAME="Assistant.__setAutoCompletionHook" ID="Assistant.__setAutoCompletionHook"></a> <h4>Assistant.__setAutoCompletionHook</h4> <b>__setAutoCompletionHook</b>(<i>editor</i>) <p> Private method to set the autocompletion hook. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor (QScintilla.Editor) </dd> </dl> <a NAME="Assistant.__setCalltipsHook" ID="Assistant.__setCalltipsHook"></a> <h4>Assistant.__setCalltipsHook</h4> <b>__setCalltipsHook</b>(<i>editor</i>) <p> Private method to set the calltip hook. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor (QScintilla.Editor) </dd> </dl> <a NAME="Assistant.__shutdown" ID="Assistant.__shutdown"></a> <h4>Assistant.__shutdown</h4> <b>__shutdown</b>(<i></i>) <p> Private slot to handle the shutdown signal. </p> <a NAME="Assistant.__unsetAutoCompletionHook" ID="Assistant.__unsetAutoCompletionHook"></a> <h4>Assistant.__unsetAutoCompletionHook</h4> <b>__unsetAutoCompletionHook</b>(<i>editor</i>) <p> Private method to unset the autocompletion hook. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor (QScintilla.Editor) </dd> </dl> <a NAME="Assistant.__unsetCalltipsHook" ID="Assistant.__unsetCalltipsHook"></a> <h4>Assistant.__unsetCalltipsHook</h4> <b>__unsetCalltipsHook</b>(<i>editor</i>) <p> Private method to unset the calltip hook. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor (QScintilla.Editor) </dd> </dl> <a NAME="Assistant.activate" ID="Assistant.activate"></a> <h4>Assistant.activate</h4> <b>activate</b>(<i></i>) <p> Public method to perform actions upon activation. </p> <a NAME="Assistant.calltips" ID="Assistant.calltips"></a> <h4>Assistant.calltips</h4> <b>calltips</b>(<i>editor, pos, commas</i>) <p> Public method to return a list of calltips. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor (QScintilla.Editor) </dd> <dt><i>pos</i></dt> <dd> position in the text for the calltip (integer) </dd> <dt><i>commas</i></dt> <dd> minimum number of commas contained in the calltip (integer) </dd> </dl> <dl> <dt>Returns:</dt> <dd> list of possible calltips (list of strings) </dd> </dl> <a NAME="Assistant.deactivate" ID="Assistant.deactivate"></a> <h4>Assistant.deactivate</h4> <b>deactivate</b>(<i></i>) <p> Public method to perform actions upon deactivation. </p> <a NAME="Assistant.getCompletionsList" ID="Assistant.getCompletionsList"></a> <h4>Assistant.getCompletionsList</h4> <b>getCompletionsList</b>(<i>editor, context</i>) <p> Public method to get a list of possible completions. </p> <dl> <dt><i>editor</i></dt> <dd> reference to the editor object, that called this method (QScintilla.Editor) </dd> <dt><i>context</i></dt> <dd> flag indicating to autocomplete a context (boolean) </dd> </dl> <dl> <dt>Returns:</dt> <dd> list of possible completions (list of strings) </dd> </dl> <a NAME="Assistant.setEnabled" ID="Assistant.setEnabled"></a> <h4>Assistant.setEnabled</h4> <b>setEnabled</b>(<i>key, enabled</i>) <p> Public method to enable or disable a feature. </p> <dl> <dt><i>key</i></dt> <dd> feature to set (string) </dd> <dt><i>enabled</i></dt> <dd> flag indicating the status (boolean) </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>