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 ide-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: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`
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.2.vsix
Limitations
- Function lookup is heuristic (
module.func -> module.py + def func(...)).
- If multiple files share the same basename, first match in workspace is used.
- 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.
ide-plugins monorepo · Releases