Open calvinkawai opened 4 months ago
can you post a mini codebase for this?
I just went through my code, I created something similar as code below and attach error image. I opened same code in Pycharm and it's fine to look up the definition.
from django.db import models
from django.utils.functional import cached_property
class Friend:
def add_new_friend(self, person_id):
print("add new friend")
# Create your models here.
class Person(models.Model):
@cached_property
def friend(self):
return Friend()
def add_me_to_friend_list(self)
self.friend.add_new_friend(self.id)
confirm that. not working with pyright, but in Pycharm and vscode, this work well.
And IMO, this is might pyright not supported this. because, using neovim
with pyright
, will also report this error.
Is it possible changing to other language server?
I am able to reproduce this with the file you provided:
Error:
But I was able to resolve it with the following:
uv add --dev 'django-stubs[compatible-mypy]' django-types
Can you see if installing those packages into your venv resolves your issues?
Check for existing issues
Describe the bug / provide steps to reproduce it
I have a class similar in following structure, I want to go to definition of
test
function but pyright will throw errorCannot access attribute "test" for class "cached_property" Attribute "test" is unknown
Environment
Zed: v0.143.7 (Zed) OS: macOS 14.5.0 Memory: 16 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log