Docu Preview
Docu Preview transforms structured documentation and JSON payloads embedded inside source code comments into an interactive, searchable, Swagger/Postman-style preview directly inside VS Code.
Instead of squinting at nested JSON inside /** ... */ comment blocks or switching to external API tools, inspect requests, responses, tags, and schemas right beside your code.
Features
- Interactive JSON Tree Viewer — Expand/collapse nested objects and arrays, see key/item counts, toggle between Tree and Raw views, copy formatted JSON in one click, or click any key to copy its JSONPath.
- Smart Payload Styling — Automatically color-codes Success, Error, Warning, and Request payloads based on their heading or JSON structure.
- Live Search & Filtering — Filter by payload type (
All, Success, Error, Request) or search across method/class names, @tags, labels, and JSON keys or values.
- Outline & Source Navigation — Jump between documented classes and methods from the outline sidebar, or click Code / line badges (
L23) to jump straight to that line in your editor.
- Collapsible Cards & Live Sync — Collapse individual class or method cards to focus on what you need; the preview updates automatically as you edit or switch files.
Screenshots

Installation
From VS Code Marketplace
- Open Extensions in VS Code (
Ctrl+Shift+X / Cmd+Shift+X).
- Search for Docu Preview (
onnietools.docu-preview).
- Click Install.
From .vsix File
- Open the Command Palette (
Ctrl+Shift+P / Cmd+Shift+P).
- Run Extensions: Install from VSIX....
- Select
docu-preview-0.1.0.vsix.
Usage & Settings
Opening the Preview
- Open any PHP file containing PHPDoc blocks.
- Open the preview using any of these methods:
- Click the Docu Preview CodeLens right above a documented class or method.
- Click the Open Preview icon in the editor title bar (top-right).
- Right-click in the editor and select Docu Preview: Open Preview.
- Open the Command Palette (
Ctrl+Shift+P / Cmd+Shift+P) and run Docu Preview: Open Preview.
Write standard PHPDoc blocks with optional @param, @return, @throws tags and JSON payloads—either bare JSON or inside ```json code fences:
/**
* Fetch a single user profile by ID.
*
* @param string $id User identifier
* @return JsonResponse
*
* Sample Output (Success)
*
* {
* "success": true,
* "data": {
* "id": "123",
* "name": "Juan Dela Cruz"
* }
* }
*
* Sample Output (Error)
*
* {
* "success": false,
* "message": "Forbidden"
* }
*/
public function show(string $id): JsonResponse
Tip: Place a short label on the line above each JSON block (e.g., Sample Output (Success), Sample Output (Error), Request Payload, 200 OK) to automatically title and color-code the payload card.
Extension Settings
Configure Docu Preview in VS Code Settings (Ctrl+, / Cmd+,):
| Setting |
Default |
Description |
docuPreview.enableCodeLens |
true |
Show clickable Docu Preview CodeLens above documentation blocks. |
docuPreview.autoSyncOnEdit |
true |
Automatically refresh the preview as you edit or switch files. |
docuPreview.defaultJsonView |
"tree" |
Default display mode for JSON payloads ("tree" or "raw"). |
Supported Languages
- PHP / Laravel (PHPDoc) — Currently supported
- TypeScript, JavaScript, NestJS, Python — Planned
License
Licensed under the MIT License.