Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant line in Python doc popup #4253

Open
hippie68 opened this issue Aug 11, 2024 · 2 comments
Open

Redundant line in Python doc popup #4253

hippie68 opened this issue Aug 11, 2024 · 2 comments

Comments

@hippie68
Copy link

hippie68 commented Aug 11, 2024

How to reproduce:
In .vimrc, put set completeopt-=preview and set completeopt+=popup.
Then open a Python file and type something, for example prin. Press Ctrl-Space to show the completion menu. Press Ctrl-N to select print. A popup will appear.

The bug:
As opposed to what would have happened in a preview scratch buffer, the popup will display the function signature twice (see screenshot).

ycm-popup-bug

@bstaletic
Copy link
Collaborator

Now this is an interesting case.
First, this can only happen with popup.
https://github.com/ycm-core/YouCompleteMe/blob/master/python/ycm/client/completion_request.py#L195-L201

If the select completion item's info does not start with extra_menu_info, we want both in the popup.
These properties are populated by the server, which for python is here:
https://github.com/ycm-core/ycmd/blob/master/ycmd/completers/python/python_completer.py#L269-L270
And the _BuildTypeInfo is here:
https://github.com/ycm-core/ycmd/blob/master/ycmd/completers/python/python_completer.py#L416-L427

So the docstring is provided by jedi and does not include def .
The type info that we build relies on jedi's definition.description, which does contain def.

Looking at the jedi API, maybe we should be using definition.name instead.
Mind trying that out and reporting your experience?

@bstaletic
Copy link
Collaborator

Nope. Replacing description with name massively hinders other parts of completion.
I'm not sure we'll be able to find a proper solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants