Python Doc Links (VS Code / Cursor)
Русский · Releases · Repository
VS Code / Cursor extension that enables go-to-definition from Python docstring/comment references.
It makes references like submodule.py, :py:func:submodule.process_submodule_data, and :func:run_main_flow navigable with Ctrl+Click (or F12).
Developed with AI assistance (Cursor / LLM). Part of the plugins monorepo.
Supported patterns
| Pattern |
Resolves to |
filename.py |
File in workspace |
:py:func:module.func |
Function definition |
:py:func:module.py.func |
Function definition (tolerant filename form) |
:func:module.func |
Function definition |
:func:module.py.func |
Function definition (tolerant filename form) |
:func:func |
Function in the current file |
:py:class:module.Class |
Class definition |
:class:Class |
Class in the current file |
:py:data:module.var |
Module-level variable (var = …) |
:data:var |
Variable in the current file |
:py:attr:module.attr |
Same as data (module-level name) |
:py:func:module.name |
If not a def, also tries class and assignment |
:py:mod:module |
Module file (module.py) |
:py:mod:module.py |
Module file (filename form) |
Example
def example():
"""
File: submodule.py
Function: :py:func:`submodule.process_submodule_data`
Function (filename form): :py:func:`submodule.py.process_submodule_data`
Function (current module): :func:`run_main_flow`
Variable: :py:data:`config.hosters_data`
Class: :py:class:`ObjectWithProperties`
Module: :py:mod:`submodule`
Module (filename form): :py:mod:`submodule.py`
"""
Install (persistent, via VSIX)
Build the VSIX package:
npm install -g @vscode/vsce
cd vscode/py-doc-links
build.bat
Then install the generated .vsix.
Command Palette (primary method, VS Code and Cursor):
- Open Command Palette: F1, Ctrl+Shift+P (Windows/Linux), Cmd+Shift+P (macOS), or View → Command Palette
- Type:
Install from VSIX
- Select Extensions: Install from VSIX...
- Pick the
.vsix file (see path below)
Resulting package file:
vscode/py-doc-links/build/py-doc-links-0.2.10.vsix
Limitations
- Function lookup is heuristic (
module.func -> module.py + def func(...)).
- If multiple files share the same basename, the copy in the same folder as the source file is preferred; matches under
docs/ and similar trees are de-prioritized.
- No rename/find-usages integration for these textual references.
- Works only in Python files (
language: python).
Related upstream context:
License
MIT — free to use, modify, and distribute, at your own risk.
plugins monorepo · Releases
Author
Rufat
Cursor IDE: Sign up with referral link — supports the author when you subscribe.