GHpython VScode AutoComplete

Hi everyone, I met the some question in GHpython. I am trying to import ghpythonlib.components in VScode, it works but cannot AutoComplete like rhinoscriptsyntax.
image

Any ideas?

Thanks

This is not going to work. ghpythonlib.components is dynamically generated based on what is available in Grasshopper.

2 Likes

Thanks steveļ¼ŒWhen I use ghpythonlib.components in GHpython ļ¼Œit can Autocomplete GH components likeā€œAbsoluteā€ļ¼Œā€œAdditionā€and"AdjustPlane" .How can I Achieve the same Autocomplete in VScodeļ¼Ÿ

Thanks :slight_smile:

GhPython can do this because it is the same process as Grasshopper and therefore can ask grasshopper about all of the components available. This is not available in VSCode. Someone would have to write a program to communicate between Rhino and VSCode or to generate a python stub file based on the components available on your computer.

1 Like

Hi @WenjieHuang

you also emailed me in private. Steve is correct. There might be some way but it would involve knowing very well the VSCode code completion library, which I donā€™t.

Thanks,

Giulio

ā€“
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

1 Like

Thank you! This answer helped me a lot :slight_smile:

@WenjieHuang well, Iā€™m glad.

In cases such as the ones Steve mentions, Iā€™ve seen this being done with .pyi files.

But Iā€™m reading long discussions with those and VSCode, so I donā€™t know if this will be easy/a long rabbit hole or how it works. I cannot start this project at this point.

Thanks,

Giulio

ā€“
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

1 Like