Some references or definitions are not found #1754
Comments
Thanks for the bug report! We just wanted to quickly acknowledge we received it and we will triage this as soon as we can. |
@Tuzoff Can you try using Language Server? Jedi mostly provide auto completion and static analysis. It does not do so well when it come to references. |
In the last few weeks (maybe longer?), while using the Language Server, I have noticed a similar problem with at least three symbols in my code. This bug also seems to be affecting "Rename Symbol", not all symbols will be renamed. I composed a simple script that will recreate the reference bug for one of these symbols:
Once you have entered the code into VS Code Python, do the following: Select first or second occurrence of self.h, then do 'Peek References', only two references |
@karthiknadig Why is the "info needed" label still attached to this issue? My previous comment confirms this problem exists while using the Language Server. My environment data:
|
@greggaree sorry about the delayed response. Moving this to the LS repo. |
@MikhailArkhipov, @jakebailey any thoughts on this issue? This issue occurs when the language server is enabled. See my previous posts for the language server version and a test case that reproduces the bug. I have only seen this issue occur when searching for two types of references:
I don't seem to have any problem finding all references for globally defined variables. When running my previously posted test case in PyCharm and WingIDE, I had no missing references. Shouldn't this issue be labelled as a bug? |
This issue was just transferred to us, we haven't yet had time to look into it to say where the bug may be or if it's a known issue with class scoping and references. |
In the settings.json file, when I change python.jediEnabled to true, VS Code features like peek references, rename, etc. will once again find all references. I did some research online and discovered a StackOverflow posting from Jul 19 2019 about the same issue as I have. The SO poster noticed that VS Code has trouble finding class based references. @brettcannon responded to the SO post, and he said some related issues had been posted at python language server. One or both of those related issues may have been fixed, but it doesn't resolve the issue I or the SO poster have been experiencing. This seems to deserve a bug label. I do a lot of refactoring and renaming as part of my work. So not having to switch between I noticed the current assignee to this issue, @karthiknadig, belongs to the vs-code-python repo. |
Similar issue1. Reproduce Progress
2. Discovery
3. QuestionWill LSP analysis work on files opened by PS: I checked some files opened after background analysis, goto def didn't work either... But jedi will work well for new opened files. BTW, is there a way reload language server for analysis of the new open files? Switching python interpreter will make sense, any others? New solution: killing Microsoft.Python.LanguageServer.exe and waiting for its restarting, will give a hand. |
This comment has been minimized.
This comment has been minimized.
If you use |
My bad. |
Might be regression per #1988 |
Should the guys from vscode-python be involved here? |
It has nothing to do with the extension, just LS bug. |
Hi, any progress on this ugly bug? |
I think the solution might be to revert the PR in question. I looked into it and I am not sure the issue can be fixed with that PR. |
@MikhailArkhipov could you please try your solution and - if it works - fix it? This bug destroys an elementary functionality to do python programming IMO. It would be really nice to have it fixed. |
PR is up. |
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version vscode-python#3977): JediExpected behaviour
Finds all references/definitions using Peek..., Find... or Go to... tools
Actual behaviour
Some of the references/definitions are missing though they are easily found in the code
Steps to reproduce:
The text was updated successfully, but these errors were encountered: