Skip to content
| Marketplace
Sign in
Visual Studio>Tools>CollectionInfo
CollectionInfo

CollectionInfo

Rouhollah Sedaqati

|
1 install
| (0) | Free
CollectionInfo displays zero-based indexes for items in C# collection initializers directly in the Visual Studio editor, making collection positions easy to identify while coding.
Download

CollectionInfo

![icon.png](icon.png)

CollectionInfo is a Visual Studio extension for C# developers that displays the index of an item when the caret is positioned on an element of a collection initializer.

Overview

When working with collection initializers such as:

List<int> source = [10, 5, 3];

CollectionInfo is designed to show the corresponding zero-based index:

10  → 0
5   → 1
3   → 2

The goal is to make collection positions easier to identify without manually counting elements.

Features

  • Displays zero-based collection item indexes in the editor.
  • Works with C# collection initializer syntax.
  • Provides index information directly in the code editor.
  • Uses Visual Studio's editor and C# language-service infrastructure.
  • Designed to remain unobtrusive while programming.

Example

![preview.gif](preview.gif)

Given:

var numbers = new List<int>
{
    10,
    5,
    3
};

CollectionInfo can indicate:

10 → 0
5  → 1
3  → 2

Requirements

  • Visual Studio Community 18.x or compatible Visual Studio 2026 installation.
  • C# development workload.

Intended Use

CollectionInfo is useful when working with:

  • List<T>
  • Collection initializers
  • Array-like collection data
  • Large collections where manually counting positions is inconvenient
  • Code where knowing an item's zero-based position is useful during development

License

MIT License

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