[Bug]: SPU codes can not normally jump and automatically expand function in VScode
Issue Type
Support
Modules Involved
SPU runtime
Have you reproduced the bug with SPU HEAD?
Yes
Have you searched existing issues?
Yes
SPU Version
0.9.3
OS Platform and Distribution
linux ubuntu 22.04
Python Version
Python 3.10.4
Compiler Version
GCC 11.4
Current Behavior?
I am currently leanring SPU code in VScode. But it can not normally jump and automatically expand function in VScode. as the picture:
It point out
"xxxx" is not a known attribute of module "spu.spu_pb2"Pylance[reportAttributeAccessIssue] (function) xxxx: Unknown
How to solve this problem?
Standalone code to reproduce the issue
This code is the jnp_debug.py [https://github.com/secretflow/spu/blob/main/spu/tests/jnp_debug.py](url)
import numpy as np
import spu.intrinsic as si
import spu.spu_pb2 as spu_pb2
import spu.utils.simulation as ppsim
im = ppsim.Simulator.simple(3, spu_pb2.ProtocolKind.CHEETAH, spu_pb2.FieldType.FM64)
copts = spu_pb2.CompilerOptions()
# Tweak compiler options
copts.disable_div_sqrt_rewrite = True
Relevant log output
`"ProtocolKind" is not a known attribute of module "spu.spu_pb2"Pylance[reportAttributeAccessIssue]
(function) ProtocolKind: Unknown`
`"FieldType" is not a known attribute of module "spu.spu_pb2"Pylance[reportAttributeAccessIssue]
(function) FieldType: Unknown`
`"CompilerOptions" is not a known attribute of module "spu.spu_pb2"Pylance[reportAttributeAccessIssue]
(function) CompilerOptions: Unknown`
These files are auto generated during build. For VSCode to find these files, build a wheel package and install in the python env.
Sorry, I don't know much about this. I haven't found any relevant guidance on historical issues and the Internet. Can you provide some guidance and help?
see https://github.com/secretflow/spu/blob/main/libspu/spu.proto. Protobuf compiler will generate these files during building.
Thank for your reply,I had found this file. But I can't understand how to use this file to solve the follow problems, Can you give me a sample?
Stale issue message. Please comment to remove stale tag. Otherwise this issue will be closed soon.