DocMapDocMap automatically builds semantic mappings between docstring segments and corresponding code snippets, making it easier to understand how documentation relates to actual implementations. DocMap was initially intended as a research project developed by Ningzhi Tang during May 17-19, 2025. Later, its core idea of building natural-language-to-code mappings was incorporated into NaturalEdit. Demohttps://github.com/user-attachments/assets/6848007d-3d63-4102-9066-d7e946efa008 FeaturesAutomatic element detection Scans your codebase for all documentable elements (functions, classes, declarations) using a Tree-sitter parser with language-specific queries. Currently supports Python, JavaScript, and TypeScript, with easy extensibility to Java, C, and more. Docstring generation For elements without documentation, click Generate Document to automatically generate a docstring. Semantic mapping For elements that already have docstrings, click Build Mapping to align each docstring segment with its relevant code. Powered by LLMs with in-editor text alignment. Interactive highlighting When a docstring is detected, a clickable marker appears inline beside it. Click the marker to build the mapping and reveal the aligned code spans above the docstring. Hover over a docstring segment to highlight the corresponding code. Click to lock the highlight for long code blocks. Hover over highlighted code to see the linked docstring segment. RequirementsDocMap uses the OpenAI API to generate and map docstrings. You will need a valid OpenAI API key. On first use, the extension will prompt you to enter your key. It is stored locally in VS Code's global state and never sent anywhere other than the OpenAI API. Extension SettingsThis extension does not require any additional configuration beyond the API key setup above. Release Notes1.0.0Initial release of DocMap. |