Python syntax server not working with Django's db.models class
Summary
Highlights an existing correct object as an error
Description
When I work with a Django project, it shows an error with every django.db.models's .objects. When I use any model object like <model>.objects.all() it underlines the .objects part with red and displays an error saying "Cannot access attribute "objects" for class "type[Product]" Attribute "objects" is unknown (Pyright reportAttributeAccessIssue)"
Expected Behavior: it should not display it as an error as objects is an object of models class.
Actual Behavior: showing error on .objects
Zed Version and System Specs
Zed 0.187.9; Apple M2, 8GB RAM, OS15
"Cannot access attribute "objects" for class "type[Product]" Attribute "objects" is unknown (Pyright reportAttributeAccessIssue)"
Does this happen in any other editors that use the same language server?
Zed is an editor and knows almost nothing about languages, including no info about "access", "attribute", "class", etc. — so the only potential issue could be here is that server being misconfigured (thus checking in other editors to be sure).
Apart from that, we cannot control which diagnostics the language server emits and how.
No this does not happen in any other editor. I've used VSCode and Cursor. These editors never showed any error for this line of code. That was the reason I was hesitant to use zed at the 1st place but I eventually shifted to zed for its speed and light weight use.
I am also getting the same error but when using neovim. It is not technically an error since the attribute object exists in the instance of Product
VSCode use Pyright under the hood but it's used inside its extension Pylance.
It must have some modification to make it works seamless with Django.