Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Docu PreviewNew to Visual Studio Code? Get it now.
Docu Preview

Docu Preview

onnietools

|
2 installs
| (0) | Free
Transform structured documentation and JSON payloads inside source code comments into interactive, searchable Swagger/Postman-style previews within VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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

Docu Preview


Installation

From VS Code Marketplace

  1. Open Extensions in VS Code (Ctrl+Shift+X / Cmd+Shift+X).
  2. Search for Docu Preview (onnietools.docu-preview).
  3. Click Install.

From .vsix File

  1. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
  2. Run Extensions: Install from VSIX....
  3. Select docu-preview-0.1.0.vsix.

Usage & Settings

Opening the Preview

  1. Open any PHP file containing PHPDoc blocks.
  2. 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.

Supported PHPDoc Formats

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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft