Py code completion at a runtime
Hi all,
I need to find a way how to customize python console code completion. Is completioncontributor what i need here? How can i get access to the console context(all the variables already defined there with their values)?
The simplified case is dict keys completion:
a = {'1': 'a', '2': 'b'}
so when user typed a[ and ctrl+space it will suggest him 1 or 2 instead of no suggestions found?
Best Regards,
Artem
Please sign in to leave a comment.
Hi all,
Sorry if i am asking dumb question, but...
We need to find a way how to add python console code completions based on some extra python code(for ex. when user types open("" and press ctrl+space it gets cwd and all the files recursively)
Currently i have added a CompletionContributor.addCompletions with code like:
The slowest place here is:
DumbService.getInstance(psiFile.project).smartInvokeLater({
try {
myClient.execInterpreter(commandPy){}
}finally {
waiter.release()
}
})
while (!waiter.tryAcquire(100, TimeUnit.MILLISECONDS)) {
ProgressManager.checkCanceled()
}
Is this approach right and is there any way how we can speed up completion(now it takes 3-5 secs
to show the completion box)?
Best Regards,
Artem