Repository: pydantic/pydantic

Issue:
[Feature request] [VS Code] No auto complete when using pydantic.dataclasses.dataclass
# Feature request

Similar to the issue that #2721 solves, VS Code can't auto complete models constructor parameters when using `pydantic.dataclasses.dataclass`.

Output of `python -c "import pydantic.utils; print(pydantic.utils.version_info())"`:
```
             pydantic version: 1.9.0
            pydantic compiled: True
                 install path: /tmp/hello-world/.venv/lib/python3.10/site-packages/pydantic
               python version: 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0]
                     platform: Linux-5.10.105-1-MANJARO-x86_64-with-glibc2.35
     optional deps. installed: ['typing-extensions']
```

Example Code:
```python
import pydantic
from pydantic.dataclasses import dataclass

@dataclass
class Hello:
    n: int
    s: str

hello = Hello(n=1, s="a")
hello.n
```

VS Code:

https://user-images.githubusercontent.com/13181797/164987610-f6704c45-3afd-4b92-9a8a-b9addeb83dd9.mp4



# Workaround:
You can import python pure dataclass instead of pydantic's dataclass when type checking, as stated by @JosXa [here](https://github.com/microsoft/python-language-server/issues/1898#issuecomment-743645817):

```python
from pydantic.dataclasses import dataclass
from typing import TYPE_CHECKING
if TYPE_CHECKING:
    from dataclasses import dataclass
else:
    from pydantic.dataclasses import dataclass as dataclass
```


Discussion:

Resolving patch:
diff --git a/pydantic/dataclasses.py b/pydantic/dataclasses.py
--- a/pydantic/dataclasses.py
+++ b/pydantic/dataclasses.py
@@ -1,10 +1,10 @@
-from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Type, TypeVar, Union, overload
+from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, Optional, Type, TypeVar, Union, overload
 
 from .class_validators import gather_all_validators
 from .error_wrappers import ValidationError
 from .errors import DataclassTypeError
 from .fields import Field, FieldInfo, Required, Undefined
-from .main import create_model, validate_model
+from .main import __dataclass_transform__, create_model, validate_model
 from .typing import resolve_annotations
 from .utils import ClassAttribute
 
@@ -16,11 +16,11 @@
     DataclassT = TypeVar('DataclassT', bound='Dataclass')
 
     class Dataclass:
-        __pydantic_model__: Type[BaseModel]
-        __initialised__: bool
-        __post_init_original__: Optional[Callable[..., None]]
-        __processed__: Optional[ClassAttribute]
-        __has_field_info_default__: bool  # whether or not a `pydantic.Field` is used as default value
+        __pydantic_model__: ClassVar[Type[BaseModel]]
+        __initialised__: ClassVar[bool]
+        __post_init_original__: ClassVar[Optional[Callable[..., None]]]
+        __processed__: ClassVar[Optional[ClassAttribute]]
+        __has_field_info_default__: ClassVar[bool]  # whether or not a `pydantic.Field` is used as default value
 
         def __init__(self, *args: Any, **kwargs: Any) -> None:
             pass
@@ -206,6 +206,7 @@ def _process_class(
     return cls
 
 
+@__dataclass_transform__(kw_only_default=True, field_descriptors=(Field, FieldInfo))
 @overload
 def dataclass(
     *,
@@ -220,6 +221,7 @@ def dataclass(
     ...
 
 
+@__dataclass_transform__(kw_only_default=True, field_descriptors=(Field, FieldInfo))
 @overload
 def dataclass(
     _cls: Type[Any],
@@ -235,6 +237,7 @@ def dataclass(
     ...
 
 
+@__dataclass_transform__(kw_only_default=True, field_descriptors=(Field, FieldInfo))
 def dataclass(
     _cls: Optional[Type[Any]] = None,
     *,


Test patch: