I recently ran into this issue when I needed to use a class decorator to add custom attributes (methods and properties) to it. As seen below, when I added a decorator (wrap) along the class Foo, it adds a class method bar and a data attribute one to it. But when I then reference these two added attributes, the editor shows red squiggles underneath, and jumping to the initial definitions in the decoration function or auto-completing these attributes are also not possible. Here is a minimal example to reproduce it:
Environment data
Code Snippet
I recently ran into this issue when I needed to use a class decorator to add custom attributes (methods and properties) to it. As seen below, when I added a decorator (
wrap
) along the classFoo
, it adds a class methodbar
and a data attributeone
to it. But when I then reference these two added attributes, the editor shows red squiggles underneath, and jumping to the initial definitions in the decoration function or auto-completing these attributes are also not possible. Here is a minimal example to reproduce it:Repro Steps
main.py
Expected behavior
The references to
bar
andone
should work normally, i.e. the language server should recognize them as corresponding to what I defined above.Actual behavior
The language server sees them as unknown attributes.