Plugin_Assistant_Eric.AssistantEric.Assistant

Module implementic the eric assistant, an alternative autocompletion and calltips system.

Global Attributes

AcsAPIs
AcsDocument
AcsOther
AcsProject

Classes

Assistant Class implementing the autocompletion and calltips system.

Functions

None


Assistant

Class implementing the autocompletion and calltips system.

Derived from

QObject

Class Attributes

None

Methods

Assistant Constructor
__completionListSelected Private slot to handle the selection from the completion list.
__editorClosed Private slot called, when an editor was closed.
__editorOpened Private slot called, when a new editor was opened.
__getApiCompletions Private method to determine a list of completions from an API object.
__getCharacter Private method to get the character to the left of the current position in the current line.
__preferencesChanged Private method to handle a change of the global configuration.
__setAutoCompletionHook Private method to set the autocompletion hook.
__setCalltipsHook Private method to set the calltip hook.
__shutdown Private slot to handle the shutdown signal.
__unsetAutoCompletionHook Private method to unset the autocompletion hook.
__unsetCalltipsHook Private method to unset the calltip hook.
activate Public method to perform actions upon activation.
autocomplete Public method to determine the autocompletion proposals.
calltips Public method to return a list of calltips.
deactivate Public method to perform actions upon deactivation.
getCompletionsFromDocument Public method to determine autocompletion proposals from the document.
setEnabled Public method to enable or disable a feature.

Assistant (Constructor)

Assistant(plugin, parent = None)

Constructor

plugin
reference to the plugin object
parent
parent (QObject)

Assistant.__completionListSelected

__completionListSelected(id, txt)

Private slot to handle the selection from the completion list.

id
the ID of the user list (should be 1) (integer)
txt
the selected text (QString)

Assistant.__editorClosed

__editorClosed(editor)

Private slot called, when an editor was closed.

editor
reference to the editor (QScintilla.Editor)

Assistant.__editorOpened

__editorOpened(editor)

Private slot called, when a new editor was opened.

editor
reference to the new editor (QScintilla.Editor)

Assistant.__getApiCompletions

__getApiCompletions(api, word, context)

Private method to determine a list of completions from an API object.

api
reference to the API object to be used (APIsManager.DbAPIs)
word
word (or wordpart) to complete (QString)
context
flag indicating to autocomplete a context (boolean)
Returns:
list of possible completions (QStringList)

Assistant.__getCharacter

__getCharacter(pos, editor)

Private method to get the character to the left of the current position in the current line.

pos
position to get character at (integer)
editor
reference to the editor object to work with (QScintilla.Editor)
Returns:
requested character or "", if there are no more (string) and the next position (i.e. pos - 1)

Assistant.__preferencesChanged

__preferencesChanged()

Private method to handle a change of the global configuration.

Assistant.__setAutoCompletionHook

__setAutoCompletionHook(editor)

Private method to set the autocompletion hook.

editor
reference to the editor (QScintilla.Editor)

Assistant.__setCalltipsHook

__setCalltipsHook(editor)

Private method to set the calltip hook.

editor
reference to the editor (QScintilla.Editor)

Assistant.__shutdown

__shutdown()

Private slot to handle the shutdown signal.

Assistant.__unsetAutoCompletionHook

__unsetAutoCompletionHook(editor)

Private method to unset the autocompletion hook.

editor
reference to the editor (QScintilla.Editor)

Assistant.__unsetCalltipsHook

__unsetCalltipsHook(editor)

Private method to unset the calltip hook.

editor
reference to the editor (QScintilla.Editor)

Assistant.activate

activate()

Public method to perform actions upon activation.

Assistant.autocomplete

autocomplete(editor, context)

Public method to determine the autocompletion proposals.

editor
reference to the editor object, that called this method (QScintilla.Editor)
context
flag indicating to autocomplete a context (boolean)

Assistant.calltips

calltips(editor, pos, commas)

Public method to return a list of calltips.

editor
reference to the editor (QScintilla.Editor)
pos
position in the text for the calltip (integer)
commas
minimum number of commas contained in the calltip (integer)
Returns:
list of possible calltips (list of strings)

Assistant.deactivate

deactivate()

Public method to perform actions upon deactivation.

Assistant.getCompletionsFromDocument

getCompletionsFromDocument(editor, word, context, sep)

Public method to determine autocompletion proposals from the document.

editor
reference to the editor object (QScintilla.Editor)
word
string to be completed (QString)
context
flag indicating to autocomplete a context (boolean)
sep
separator string (QString)
Returns:
list of possible completions (QStringList)

Assistant.setEnabled

setEnabled(key, enabled)

Public method to enable or disable a feature.

key
feature to set (string)
enabled
flag indicating the status (boolean)
Up