No constructor argument name auto completion for AWS cdk classes
Environment data
- Pylance version: v2024.8.1
- OS and version: Windows 11 (tried both in Windows and WSL)
- Python version: Python 3.12.5
Code Snippet
Install aws-cdk-lib==2.154.1 in a virtual environment and select the environment in VSCode.
from aws_cdk import (
Stack,
aws_lambda,
)
from constructs import Construct
class TestStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
aws_lambda.Function(
self,
"TestLambda",
runtime=aws_lambda.Runtime.PYTHON_3_12,
handler="index.handler",
code=aws_lambda.Code.from_inline("def handler(_, _):\n pass\n"),
)
Expected behavior
With Pycharm or Jedi python language server in VSCode I get autocompletion for Function constructor arguments:
Actual behavior
With Pylance in VSCode I don't get suggestions for arguments, only "kwargs":
This might be a dupe of https://github.com/microsoft/pylance-release/issues/6286.
Verified this doesn't repro in 2024.7.1, should be a regression.
Similar circumstances to the other issue, but this is with aws_cdk and its type annotations. I'm not sure if they're wrong or not.
But not exactly the same bug as #6286
This was fixed in Pyright 1.1.378 and that fix shipped in Pylance 2024.8.104