D
D
Dmitry Petrik2017-03-09 08:20:02
Python
Dmitry Petrik, 2017-03-09 08:20:02

PuQt5 and PyQode editor. How to do code completion?

There is an article on how to do this: https://github.com/pyQode/pyQode/wiki/Advanced-top...
In the server part, I make my own provider:

class CustomCodeCompletionProvider:
    def complete(self, code, line, column, path, encoding, prefix):
        """
        Provides a static code completion list
        :param code: code to complete
        :param args: additional (unused) arguments.
        """
        return [
            {'name': 'action', 'tooltip': 'Действие выполняемое над объектом'},
            {'name': 'action.id', 'tooltip': 'Идентификатор действия'},
        ]

It is necessary that when the user starts typing "action" in the pop-up window for autocomplete, only "action" was issued. Now "action.id" is also displayed. And accordingly, after the word "action" enters a dot "." he was asked to substitute "id". In general, everything is like in any IDE.
FILTER_FUZZY filter mode. It seems like he should allow such things to turn. I can't figure out how to implement it, please help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question