-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definitions just go until a certain point of the code #518
Comments
Hi @weberxw Thank you for the feedback. This does look like a bug. The only limit that I can think of is a memory threshold during analysis where we sometimes throw away cache data to bring the memory usage back down. Semantic colorization runs in the background with its own analysis cache, but the Go to Definition command runs in the foreground and does not share that same state. While the screenshot clearly shows that semantic colorization stopped recognizing your view classes, can you confirm that Go to definition command is also broken for the ones that aren't colored? Could you also please try to reorder your url calls and see how that changes the result? Like move all the Discipline url calls up above Project url calls. Mostly I'm trying to figure out if it's something in the beginning of the Discipline group that breaks things. Another question, does it look like this when you first open the file, before you edit anything? Finally, are there any errors that appear in the Output window, under Python Language Server? thanks! |
Hi @huguesv , thank you for the answer. I made some tests and here are the results..
Hope this can help. |
@weberxw thank you Can you please check the output for Python Language Server, you have to select it from the combo box on the right: Is this an open source project by any chance? |
Thank you. I ended up reproducing it in a simple django project by copy/pasting several path/url calls. |
Minimal repro: mylib.py
mytest.py
After 64 entries, go to definition and semantic colorization on It's the limit specified by |
Curious; my reading of that limit is that it should only be preventing the creation of large list/dict/set types via literals, but I it's stopping any evaluation of the node. Perhaps if the limit only stopped the addition of the item to the container but still evaluated everything, it'd work due to the evaluation happening? I'm wondering if this means you can make a large list, then do something invalid at the end and it type check even though it's wrong. |
In context, this makes sense now; the screenshots in the original post hid the fact that these were appearing in a list literal. |
This issue has been fixed in version 2020.10.3, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#2020103-28-october-2020 |
All this views are in the same file, imported through this at the top from base_production import views
As you can see my definitions stop in a certain point of the code, from Deliverable FileList down no definition is accessible.
Is there some limit based on file size or some configuration to fix this or is this a bug?
Thanks guys
The text was updated successfully, but these errors were encountered: