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

Crash on autocomplete when using type hints for protobuf classes #794

Closed
pascalwhoop opened this issue Apr 10, 2018 · 4 comments
Closed

Comments

@pascalwhoop
Copy link

pascalwhoop commented Apr 10, 2018

Vim crashes when using the following code the moment the . is placed after request:

class PortfolioManagerService(ptac_grpc.PortfolioManagerServiceServicer):
    def handlePBCashPosition(self, request:ptac_pb2.PBCashPosition, context):
        request. #crash
        warn_about_grpc_not_implemented()
        return ptac_pb2.Empty()

it seems the moment the autocomplete is triggered, something is happening with the protobuf generated sources that jedi doesn't like.

[libprotobuf FATAL google/protobuf/stubs/common.cc:67] This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 3.0.0.  Please update your library.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "google/protobuf/descriptor.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 3.0.0.  Please update your library.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "google/protobuf/descriptor.pb.cc".)
@davidhalter
Copy link
Owner

This will be fixed in a few days (maybe weeks) once jedi 0.12.0 is released.

@pascalwhoop
Copy link
Author

@davidhalter do you mind sharing a link where I can follow up on this? Will Jedi be able to autocomplete this metaclass magic that's going on or will just the crash be avoided? Protobuf generates this really weird code from the proto files and all IDEs fail to work with this. pyCharm doesn't do anything and vim crashed so if Jedi now somehow learns to autocomplete this, that would be amazing.

@davidhalter
Copy link
Owner

You can follow the release schedule here: davidhalter/jedi#1063.

Understanding metaclass magic will only be possible with davidhalter/jedi#626.

So I'm sorry to disappoint you, understanding this is not that easy :)

@pascalwhoop
Copy link
Author

Thanks!
It may also be solved on the protobuf side by generating more info

protocolbuffers/protobuf#2638

Apparently there's a mypy-protobuf project by the Dropbox crew

https://github.com/dropbox/mypy-protobuf

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