Skip to content

Conversation

ptrv
Copy link
Collaborator

@ptrv ptrv commented Jun 5, 2017

ycmd now indicates a python function in extra_menu_info with def instead of
function.

See:
ycm-core/ycmd@72bfc38

@ptrv ptrv mentioned this pull request Jun 5, 2017
@ptrv ptrv changed the title company-ycmd: Use new format for functions in ycmd company-ycmd: Use new format for python functions in ycmd Jun 5, 2017
ycmd now indicates a python function in extra_menu_info with `def` instead of
`function`.

See: ycm-core/ycmd@72bfc38
@ptrv ptrv force-pushed the company-ycmd-adapt-to-latest-jedi branch from d9e75f5 to 992b646 Compare June 5, 2017 23:41
@noxdafox
Copy link
Contributor

noxdafox commented Jun 6, 2017

I tested the code and it didn't fix the issue. Still see the function definition being suggested as def funcname.

Moreover I guess this change would break backward compatibility as is.

@noxdafox
Copy link
Contributor

noxdafox commented Jun 6, 2017

Looking a bit further from the logic you pointed out.

Trying the following code:

import requests


def main(foo, bar):
    pass


requests.del      # completing here, expecting completion of delete with params

It seems that the function company-ycmd--extract-params-python receive its first parameter as nil which prevents it from extracting the parameters.

Looking closer, it seems it cannot get the function signature from the requests library. This suggests there is something wrong in my PYTHONPATH variable.

I just tested with Python standard library and the parameters are indeed showing. So it's probably something wrong with my env vars.

Yet it is weird as the semantic completion seems to work, all functions and classes defined in the requests library are suggested. Just the parameters are missing.

@ptrv
Copy link
Collaborator Author

ptrv commented Jun 6, 2017

@noxdafox I tried you code snippet and I have the same behavior.

If you run M-x ycmd-display-completions RET you will see that the extra_menu_info only shows def delete without any further information. So this is what we get from ycmd.

The problem before was the parsing of the params itself which the #431 fixes

Maybe worth asking in the ycmd project?

@noxdafox
Copy link
Contributor

noxdafox commented Jun 6, 2017

Yes I will open an issue against their project. For this patch, IMHO would be better to ensure backward compatibility.

@abingham abingham merged commit 29aba53 into abingham:master Jun 6, 2017
@ptrv
Copy link
Collaborator Author

ptrv commented Jun 6, 2017

would be better to ensure backward compatibility.

ycmd is tied to a specific jedi version so no need to maintain backward compatibility

@ptrv ptrv deleted the company-ycmd-adapt-to-latest-jedi branch June 6, 2017 08:00
@noxdafox
Copy link
Contributor

noxdafox commented Jun 6, 2017

Ycmd is enforcing specific version of its dependency right now that it's under heavy development, hopefully in future it will change. Bear in mind the User might still be using old Ycmd.

Debian, for example, now ships a ycmd package: https://packages.debian.org/sid/ycmd

The change would break compatibility with that version for example.

@micbou
Copy link

micbou commented Jun 6, 2017

Ycmd is enforcing specific version of its dependency right now that it's under heavy development, hopefully in future it will change.

Not sure why you are saying that. It points to the Jedi release 0.10.2 which is supposed to be stable.

@noxdafox
Copy link
Contributor

noxdafox commented Jun 6, 2017

What I mean is that I hope to be able to use distribution packages rather than pulling the source code of all the dependencies in future.

https://github.com/Valloric/ycmd/blob/master/.gitmodules

@noxdafox
Copy link
Contributor

noxdafox commented Jun 8, 2017

@ptrv I tried an older version of ycmd and I get the paramters completion as well (see ycm-core/ycmd#773).

EDIT: I forgot to eval the change. Reverting this commit makes company-ycmd showing the function parameters again. So it's definitely something wrong in recent ycmd changes.

noxdafox added a commit to noxdafox/emacs-settings that referenced this pull request Aug 22, 2017
Issue abingham/emacs-ycmd#431 was fixed.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
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

Successfully merging this pull request may close these issues.

4 participants