简体   繁体   English

VS Code Intellisense 不适用于 Python gRPC

[英]VS Code Intellisense Not Working for Python gRPC

Is there anything specific that needs to be done to get VS Code's intellisense working for classes auto-generated by the gRPC compiler in Python?为了让 VS Code 的智能感知适用于 Python 中的 gRPC 编译器自动生成的类,是否需要做任何具体的事情? I ran the compile command:我运行了编译命令:

python -m grpc_tools.protoc -I../../pb --python_out=. --grpc_python_out=. ../../pb/demo.proto

and then imported the generated class.然后导入生成的类。 When I'm trying to access the request object in one of the methods, autocompletion doesn't work and I'm unable to see the properties of the incoming request which makes development very tedious as I keep having to switch back to the proto file to check the names of properties.当我尝试在其中一种方法中访问request对象时,自动完成功能不起作用,并且我无法看到传入请求的属性,这使得开发非常乏味,因为我不得不切换回原始文件检查属性的名称。

You should check your Python Interpreter path.您应该检查您的 Python 解释器路径。 To select a specific environment, use the Python: Select Interpreter command from the Command Palette.要选择特定环境,请使用 Python:从命令面板中选择解释器命令。

https://code.visualstudio.com/docs/python/environments#_work-with-python-interpreters https://code.visualstudio.com/docs/python/environments#_work-with-python-interpreters

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM