Page 1 of 2

Python autocomplete improvements (feature request)

Posted: 14.10.2018 07:30
by urlwolf
Hi guys,

I love how light and fast cudatext it. Like the name too. I can't help but notice that the autocompletions for python are kinda poor (if working at all; it only has the stdlib and it's not context dependent). For a while I thought 'ok, this is an editor, not an IDE'. But then I realized that spyder, atom, vscode etc all have much better autocompletions.

It turns out lots has happened in the python world that could help making cudatext perform better autocompletions recently. See:

https://docs.python.org/3/library/inspect.html

You can get function signatures, on the fly. No need to precompute them in an .acp file that will be hopelessly incomplete!

You can also get the doc string. This would make it possible for cudatext to show both signature and docs on pressing ctrl space.

There's also rope : https://github.com/python-rope/rope/blo ... erview.rst

I suspect spyder, atom, vscode etc use these things to 'look' a lot more like an ide.

I want to keep the speed of cudatext, but would need those autocompletions too. Since plugins are in python, this would benefit the entire community. What do you think?

Posted: 14.10.2018 07:36
by urlwolf

Posted: 14.10.2018 10:35
by urlwolf

Posted: 14.10.2018 14:51
by Alexey
> I can't help but notice that the autocompletions for python are kinda poor (if working at all; it only has the stdlib and it's not context dependent).
Of course.
User needs plugin Python IntelliSense to use OK completions. in Addon Manager.

Posted: 14.10.2018 14:54
by Alexey

Posted: 14.10.2018 18:00
by urlwolf
That's great news.
I installed, chose the python intrepreter. But I cannot replicate what you do in the gif.
No go to definition. Autocompletion after the dot proudces the same matches as before (the acp file matches).
What am I doing wrong?

Posted: 14.10.2018 18:02
by urlwolf
Also 'cannot find docstring'. Maybe I need to 'activate' it so it starts indexing the libraries?

Posted: 14.10.2018 18:21
by urlwolf
Ok, I got some things working. I see you have to press a shortcut to get autocompletion.
Is it possible to make it 'as you type'? See how vscode does it:
https://marketplace.visualstudio.com/it ... hon.python

Posted: 14.10.2018 19:53
by Alexey
user.json options

Go to definition by Ctrl+Alt+click: change option mouse_goto_definition
Auto completion by typing n chars: change opt autocomplete_autoshow_chars / autocomplete_trigger_chars

Posted: 16.10.2018 17:44
by urlwolf
Hmm, I read on settings.json that these params don't go into user.json. Where do they go? I couldn't find any lexer files with json extension.