Русский · Releases · Repository
VS Code-compatible extension that enables go-to-definition from Python docstring/comment references.
It makes references like submodule.py, :py:func:, and submodule.process_submodule_data:func: navigable with Ctrl+Click (or F12).run_main_flow
Developed with AI assistance (Cursor / LLM). Part of the plugins monorepo.
Compatibility: Not limited to VS Code or Cursor — runs in any VS Code-compatible editor, including Google Antigravity IDE, VSCodium, Windsurf, and other forks that support standard VS Code extensions (Open VSX or VSIX).
Supported patterns
| Pattern | Resolves to |
|---|---|
filename.py |
File in workspace |
:py:func: |
Function definition |
:py:func: |
Function definition (tolerant filename form) |
:func: |
Function definition |
:func: |
Function definition (tolerant filename form) |
:func: |
Function in the current file |
:py:class: |
Class definition |
:class: |
Class in the current file |
:py:data: |
Module-level variable (var = …) |
:data: |
Variable in the current file |
:py:attr: |
Same as data (module-level name) |
:py:func: |
If not a def, also tries class and assignment |
:py:mod: |
Module file (module.py) |
:py:mod: |
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 (any VS Code-compatible editor):
- 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
.vsixfile (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
Cursor IDE: Sign up with referral link — supports the author when you subscribe.