Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Visual Studio Code #2121

Closed
4 tasks done
MartinThoma opened this issue Nov 13, 2020 · 3 comments
Closed
4 tasks done

Add support for Visual Studio Code #2121

MartinThoma opened this issue Nov 13, 2020 · 3 comments

Comments

@MartinThoma
Copy link

Checks

  • I added a descriptive title to this issue
  • I have searched (google, github) for similar issues and couldn't find anything
  • I have read and followed the docs and still think this feature/change is needed
  • After submitting this, I commit to one of:
    • Look through open issues and helped at least one other person
    • Hit the "watch" button on this repo to receive notifications and I commit to help at least 2 people that ask questions in the future
    • Implement a Pull Request for a confirmed bug

Feature Request

Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":

             pydantic version: 1.7.2
            pydantic compiled: True
                 install path: /home/math/.pyenv/versions/3.7.8/lib/python3.7/site-packages/pydantic
               python version: 3.7.8 (default, Aug 18 2020, 10:52:32)  [GCC 9.3.0]
                     platform: Linux-4.19.104-microsoft-standard-x86_64-with-debian-bullseye-sid
     optional deps. installed: ['typing-extensions']

This is more of a pointer, I think, less of a feature request. At the moment, with VS Code 1.51.1 and pylance 2020.11.1, the type hints just say **data: Any when a pydantic object is created. It would be cool if that could be improved.

@PrettyWood
Copy link
Member

Hi @MartinThoma
You're absolutely right! It's something a lot of us want. There is actually an opened issue to add BaseModel autocompletion among other things on Pycharm (already done) and VSCode.

@MartinThoma
Copy link
Author

Nice! Should I close this issue then?

@nzig
Copy link

nzig commented Jul 11, 2021

Since this is the first result when googling "vscode pydantic", I'd like to link this here:
Until #2721 is merged, you can add a small snippet to pydantic to get completions. Instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants