Details
Status | Assigned | Task | ||
---|---|---|---|---|
Resolved | asemke | T5382 Port worksheet syntax highlighting to KSyntaxHighlighting | ||
Resolved | filipesaraiva | T9512 Port Python 3 backend to KSyntaxHighlighting |
Hi, @fililesaraiva.
PythonKeywords::instance()->addVariable(variable); }
don't good idea, because in this case we store all variables from all Python session in singliton PythonKeywords.
I think, keywords classes should store only session independent data, in our case, from KSyntaxHigligting
Thanks @sirgienko. When I ported to KSyntaxHighlighting the tab completion stopped to work for variables.
I will study an alternative implementation to maintain tab completion. Do you have any idea?
As variant, we could use variable model: it alreay stored variable names, unique for each session, and we have api to acess to it from Cantor::Session.
But maybe more simple way is using native autocompletion tools from Python itself. Like we do it in Octave (octavecompletionobject.cpp::35).
Also, for example, Maxima already use variable model for getting lists of variable names (maximacompletionobject.cpp:58), so I think, Python could do it too.
Hi, @filipesaraiva
In 610f8c8ec70b4b52a3f4487c3348b87b66a0b85f I have added autocompletion by native Python autocompletion.
It's work for variables, functions, modules, even for class methods and fields.
Also in previous commit i have fixed some autocompletion type fetching's bugs, so now functions autocomplited as functions, and keywords as keywords.
I think, you will like it :)