-
Notifications
You must be signed in to change notification settings - Fork 10
Home
M. Krassowski edited this page Jul 16, 2019
·
3 revisions
Welcome to the jupyterlab-go-to-definition wiki!
- (A) create symbolic links in a hidden folder, e.g.
.jupyter-symlinks
and open the file using this link:- easy on Linux, what about Windows?
- read and write possible as long as the user has the rights (which is fine)
- use of symlinks was also suggested in https://github.com/jupyterlab/jupyterlab/issues/6351
- (B) alternative: create a read-only copy in a dir which is removed
atexit()
The (A) method was implemented in 0.5.1 version.
There are some shortcomings though:
-
due to the requirement of having a kernel, the precise resolution of file paths works only:
- in notebooks as those have a running kernel
- when the kernel is running and not busy
which could be worked around in future by setting up a custom kernel just for the extension
-
for Python some modules have no source files (e.g. sys). This may be because those are implemented in C or otherwise do not have the python source in the first place. To deal with such cases some IDEs (e.g. PyCharm) use stubs with definitions autogenerated based on the documentation.
- optional (and require support from language analyzer), active by default.
- the analyzer would connect to the server before doing static analysis and try to get the location of the symbol. this is certainly possible for functions and classes, not sure about other objects. This could actually be conditioned on the symbol type (from static analysis):
- if it is a simple variable do not bother the kernel
- this has to be a blacklist to enable discovery of symbols imported via
import *
;
- a timeout is needed so that we do not wait forever - then it's better to fall back to static analysis.