https://pulumi.com logo
#getting-started
Title
# getting-started
f

freezing-vase-18205

01/14/2024, 7:04 PM
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
<ResourceName>Args
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
<ResourceName>Args
Is this expected?
b

brave-planet-10645

01/15/2024, 2:08 PM
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
f

freezing-vase-18205

01/15/2024, 2:22 PM
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