JSON Path Hover for VS Code

April 22, 2026 · View on GitHub

vscode json structure

English | 简体中文

JSON Path Hover for VS Code

A lightweight VS Code extension to show and copy the current JSON path in JSON and JSONC files.

demo

Features

  • Hover any JSON or JSONC property or array item to see its access path.
  • Click Copy in the hover to copy the path to the clipboard.
  • Works in common VS Code config files such as settings.json, launch.json, and keybindings.json.
  • Special keys are escaped when needed, for example ["@antfu/eslint-config"].

Example

For this JSON:

{
  "user": {
    "profile": {
      "display-name": "Simon"
    }
  },
  "items": [
    {
      "id": 1
    }
  ]
}

The extension shows paths like:

user.profile['display-name']
items[0].id

Usage

  1. Open a .json or .jsonc file in VS Code.
  2. Move the cursor over a property or array item.
  3. Use the hover action to copy the current path.

Notes

  • The extension works on valid JSON and JSONC documents.
  • While a file is temporarily invalid during editing, the hover is hidden until the document parses again.

Support

Buy me a cup of coffee

License

MIT