Index of Array

A VS Code extension that shows the contents of an array with its indices when you hover over a variable in a C, C++ or Python file.
What it shows
- 1D arrays — every element with its index, e.g.
[0] = 10 [1] = 20 [2] = 30
- 2D arrays — a table with row index
[i] and column index [j]
- 3D arrays — one table per outer layer, with
[j] / [k] indices
- Strings — every character with its index
- Python dicts — key/value table
- Shape information — e.g.
2D · shape 3 × 4 · 12 elements
- Declared-only arrays — if an array has no literal initializer (values are filled at runtime), the declared shape is shown instead.
Array Inspector panel
The hover shows all elements with their indices. At the top of the hover, click more to open the full designed view in a side panel:
- click more in the hover, or
- press
Ctrl+Alt+A (Cmd+Alt+A on macOS) with the cursor on an array variable, or
- right-click the variable → Index of Array: Open Array Inspector.
The panel includes a shape header, a responsive grid for 1D arrays, sticky row/column headers for 2D and 3D arrays, a filter box for large arrays, and click-to-copy of any cell's expression (arr[2], arr[1][0]).
Supported languages
| Language |
Types |
| C / C++ |
raw arrays (int a[] = {...}), std::vector, std::array, std::string, char* / char[] strings, nested initializer lists |
| Python |
list, tuple, set, dict, str |
How to build
npm install
npm run compile
How to run (development)
- Open the
indexOfArray folder in VS Code.
- Press F5 (or Run → Start Debugging). This opens an Extension Development Host window.
- In that new window open any
.c, .cpp or .py file (for example examples/demo.cpp or examples/demo.py).
- Hover over an array variable name and the popup will show the indexed contents.
How to package
npm install -g @vscode/vsce
vsce package
Then install the generated .vsix with Extensions → … → Install from VSIX.
Limitations
- Values are read from literal initializers in the source code. If an array is filled at runtime (loops, input, function calls), only its declared shape can be shown.
- A variable is resolved inside the current document only.
- Very large arrays are shown in full inside the Array Inspector panel; the hover shows a compact preview.
Creator
Mahdi Bin Iqbal — @mahadihasan9
Software Developer · Python, C/C++, Kotlin, backends & automation tools · Cybersecurity enthusiast.
License
Released under the MIT License.
Copyright © 2026 Mahdi Bin Iqbal.