-
Notifications
You must be signed in to change notification settings - Fork 133
Support goto definition in library files #840
Comments
This appears to be coming from the extension, rather than VS Code itself. See microsoft/vscode-python#5132. |
Modules outside of the workspace are considered libraries and in order to conserve memory file content, parse tree and navigation information is not preserved. This might be made into an option if memory consumption increase is not a concern. |
|
As I created issue: #1848 that was closed a duplicate of this one. I do have three things that irk me about how it works now. Why:
I couldn't find documentation about this. |
Libraries are analyzed but information is not completely kept in order to conserve memory. They are analyzed when imported, library doesn't have to be opened. If you open library file it is not re-analyzed. As mentioned above, a setting may be added to keep all information at the expense of memory. |
I would like for such a flag to be included.
Just to add: When a library file is open from the start, it is analyzed.
Follow these steps to see this in action:
-> Open a library file in a VSCode workspace
-> Close VSCode
-> Open VSCode
-> Library file is analyzed and goto def is supported in that file.
…On 23-12-2019 14:33, Mikhail Arkhipov wrote:
Libraries are analyzed but information is not completely kept in order
to conserve memory. They are analyzed when imported, library doesn't
have to be opened. If you open library file it is not re-analyzed. As
mentioned above, a setting may be added to keep all information at the
expense of memory.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#840?email_source=notifications&email_token=AAFNQ43ZUG5CPZ7FKLPSDSTQ2C4Z5A5CNFSM4HCEYHQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHREJBQ#issuecomment-568476806>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFNQ42JJGMQWQSZY7PCPGDQ2C4Z5ANCNFSM4HCEYHQQ>.
|
For those watching this, you may be able to restore this functionality through a pair of settings that will tell the LS to not drop info for libraries from memory:
But the memory cost of storing this info will likely be significant, as it will be stored for all referenced libraries in the dependency graph for the opened files. |
I tried these two settings but language server still can't jump between library files. I have to say the lack of this feature is a little frustrating. |
This will be available in 0.5.37 and above as an optional feature that can be enabled (#1861) by setting: "python.analysis.memory.keepLibraryAst": true Note that storing this information about libraries is likely to be very memory heavy, hence why we threw this information away in the first place. Your experience may vary. |
I just tried @jakebailey 's suggestion and it's working perfectly on my environment (Windows 10 + SSH to Linux Azure VM). It's great that I can just Go To Definition (F12) for library code/functions. Thank you! |
Currently we navigate to library, but then
Goto Def
is no longer available.The text was updated successfully, but these errors were encountered: