Skip to content

Add autocompletion for instanciation #2869

Open
@JustAnotherVeryNormalDeveloper

Description

On Visual Studio Code, there is no useful hint on the parameters and the type for the instanciation of the object.

Example:

from mongoengine import Document, StringField

class User(Document):  
    name = StringField(required=True)
    surname = StringField(required=False)

user = User(

HINT: (...) -> User

To have useful hint, I am doing that on my project:
Example:

from typing import Optional
from mongoengine import Document, StringField

class User(Document):  
    name = StringField(required=True)
    surname = StringField(required=False)

    def __init__(self, name: str, surname: Optional[str], *args, **kwargs):  
        super().__init__(name=name, surname=surname, *args, **kwargs) 

user = User(

HINT: (name: str, surname: str | None, ...) -> User

This is really practical but I have to do a lot of duplication of code, is there a way to propose the attributes "automatically" ? can I help you do that ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions