diff --git a/jedi/plugins/stdlib.py b/jedi/plugins/stdlib.py index 52413a29..149e7e6d 100644 --- a/jedi/plugins/stdlib.py +++ b/jedi/plugins/stdlib.py @@ -599,4 +599,8 @@ _implemented = { # being used instead. This only matters for 3.7+. '_alias': lambda obj, arguments: NO_CONTEXTS, }, + 'dataclasses': { + # For now this works at least better than Jedi trying to understand it. + 'dataclass': lambda obj, arguments: NO_CONTEXTS, + }, } diff --git a/test/completion/decorators.py b/test/completion/decorators.py index 043ed0bf..a61487a3 100644 --- a/test/completion/decorators.py +++ b/test/completion/decorators.py @@ -310,11 +310,14 @@ follow_statement(1) # class decorators should just be ignored @should_ignore class A(): + x = 3 def ret(self): return 1 #? int() A().ret() +#? int() +A().x # ----------------- diff --git a/test/completion/pep0526_variables.py b/test/completion/pep0526_variables.py index 37e7ae71..6af77d91 100644 --- a/test/completion/pep0526_variables.py +++ b/test/completion/pep0526_variables.py @@ -103,3 +103,13 @@ d.var_class1 d.var_class2 #? [] d.int + + + +import dataclasses +@dataclasses.dataclass +class DC: + name: int = 1 + +#? int() +DC().name