Open davidobrien1985 opened 5 years ago
Exact same experience on my end. I actually was looking at Troposphere specifically for this capability over CloudFormation directly. The CF plugins leave a lot to be desired that I was hoping this project would fill the gap.
As part of deprecating Python 2 and switching to Python 3 only (hopefully that won't be too controversial given the Python 2 EOL), I am looking at various implementation strategies to support a intellisense. Just need those extra free cycles to work on it. :-)
@markpeek Seems like a good opportunity to support Mypy as well. Mypy at least has a limited ability to follow metaclasses, and from my experience, VS Code's intellisense seems to behave pretty similarly to Mypy. If you support mypy, you might get intellisense for free?
Might be a big rewrite (or not too big), but I've had Great experiences with Pydantic when it comes work like this. https://github.com/samuelcolvin/pydantic
The change is that all the classes inherit from pydantic.BaseModel
.
Big rewrite might come if there is lots of code that depend on something in the current props = {..}
system.
And rewrites would have to be there to catch what happens when Pydantic model validation fails.
@lautjy I can think of either pydantic
or attrs
they are both very good integrated with Sublime, VSCode and PyCharm.
That's why I did a project troposphere_mate
that using jinja2
template engine to recreate troposphere with attrs
. It gives me a lot of auto-complete.
My point is, troposphere team should not use props = {...}
to declare those properties, they should use crawler or something to get the schema and typing for all aws resource and properties. And then use template engine like jinja2
to generate those class declaration code in pydantic / attrs / data class / even the raw Python Class declaration. Maintain those troposphere feature in Parent Base Class. That would be future of troposphere 3.0. Otherwise I feel like troposphere will die if AWS CDK getting better and better. To be honest, there's still a lot of thing troposphere can do but AWS CDK cannot.
Hi,
If this is some sort of misconfiguration on my end, please tell me to go away and fix my setup, but really, it's only happening with troposphere.
I use VS Code on Ubuntu and over the years I have gotten used to tools helping me to write code. Unfortunately, troposphere seems to be making my job really, really difficult.
If I now start typing
base_vpc.
I would expect to be able to see properties likeCidrBlock
be available to me via intellisense / tab completion, but nada, it's not.Similarly, when typing the properties inline to the object, I'd expect to see more than just
template
, but the actual properties, again, something likeCidrBlock
.I either have to move my mouse now and hover over
VPC
with a pressedCtrl
keyor actually look at the source by clicking onto the class.
This feels super unproductive.
If someone could please let me know what I have to do to get proper intellisense for troposphere, that'd be great.
Thanks, David