Go to definition extension for JupyterLab
Jump to definition of a variable or function in JupyterLab notebook and file editor.
Use Alt + click to jump to a definition using your mouse, or Ctrl + Alt + B keyboard-only alternative.
You can replace the key modifier for mouse click from Alt to Control, Shift, Meta or AltGraph in the settings*.
To jump back to the variable/function usage, use Alt + o.
The plugin is language-agnostic, though optimized for Python. Initial support for R was recently implemented. Support for other languages is possible (PRs welcome).
*) For full list of physical keys mapped to the modifiers (which depend on your Operating System), please see the MDN documentation.
Safari users: Safari does not implement
MouseEvent.getModifierState (see #3), thus only Alt, Control, Shift and Meta are supported.
jupyter labextension install @krassowski/jupyterlab_go_to_definition
For a development install (requires npm version 4 or later), do the following in the repository directory:
npm install npm run build jupyter labextension link .
To rebuild the package and the JupyterLab app:
npm run build jupyter lab build
To run tests suite:
Adding support for additional languages
Support for new languages should be provided by implementation of abstract
LanguageAnalyzer class (in case of languages which support use of semicolons to terminate statements
LanguageWithOptionalSemicolons helper class can be utilized).
Each new language class needs to be included in
chooseLanguageAnalyzer function and the developer needs to verify if
fileeditor.ts will be able to recognize the language properly.