Hi I noticed that in Python there are two ways of ...
# getting-started
Hi I noticed that in Python there are two ways of defining resources 1. where resource params are “inlined” to the resource args 2. where resource params are nested under
structure Pulumi docs always use the first method of passing resource arguments, and while it is shorter and sweeter, I noticed that my VSCode instance (with Pylance/Python plugins) fail to fetch argument documentation in that case. Here is an example when docs are provided by the language server when the arg belongs to
Is this expected?
I think it’s to do with how the language server in VSCode sees the SDK. I’m no expert in Python but I use option 1 all the time and I’ve found it useful to activate the virtual environment (so
source venv/bin/activate
) and then open VSCode from the command line. Or you can open VSCode and then activate the virtual environment. Otherwise VSCode will struggle to see the SDK
thanks @brave-planet-10645, venv is not a problem here, otherwise vscode won’t see any pulumi imports whatsoever it is just that with option 1 it doesn’t show the descriptions. This is almost certainly related how the sdk for py is generated, but I was curious if others find it the same