Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>StepFlag-CodeCounterNew to Visual Studio Code? Get it now.
StepFlag-CodeCounter

StepFlag-CodeCounter

xanaki

|
1 install
| (0) | Free
Count steps per function (lines / comment lines / blank lines), flag functions in four colors, and export the results as CSV / Markdown.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

StepFlag-CodeCounter

A VSCode extension that analyzes source code in your workspace on a per-function basis and reports step counts.

StepFlag-CodeCounter counts total lines, comment lines, and blank lines for each function, method, and constructor, then exports the results as CSV / Markdown. You can also mark functions with four colored flags as reminders for reviews or refactoring.

Features

  • Per-function step counting: Analyzes source code in the workspace per function / method / constructor and aggregates total lines, comment lines, and blank lines.
  • CSV / Markdown export: Writes results to timestamped CSV and Markdown files, avoiding collisions with existing files.
  • Flags: Attach or remove one of four fixed-color flags (RED / BLUE / YELLOW / GREEN) on a function from the editor context menu.
  • Editable flag names: Assign a custom display name to each flag color (reflected in the exported files).
  • Editor decorations: Shows a colored flag mark (⚑) at the head of the name line of flagged functions.
  • Localized UI: Command titles, menus, messages, and exported CSV / Markdown headers follow the VSCode display language (English / Japanese).

Usage

Command Palette

Command titles follow the VSCode display language.

Command Action
StepFlag-CodeCounter: Count Workspace Steps Scans the workspace, aggregates results, and exports CSV and Markdown files. If no output folder is set, a folder picker is shown first.
StepFlag-CodeCounter: Set Output Directory Selects and saves the output folder.
StepFlag-CodeCounter: Edit Flag Name Pick a flag color, then enter a new name. Submitting an empty name restores the default.

Context Menu

Right-click with the cursor inside a function to use:

  • Add Flag — submenu with RED Flag / BLUE Flag / YELLOW Flag / GREEN Flag
  • Remove Flag

Supported Languages

Languages with line-classification definitions (code / comment / blank detection):

Language Extensions
TypeScript / TSX .ts, .tsx
JavaScript / JSX .js, .jsx, .mjs, .cjs
Python .py
Java .java
C / C++ .c, .h, .cpp, .hpp, .cc
C# .cs
Go .go
Rust .rs
Ruby .rb
PHP .php

Function detection is delegated to VSCode's DocumentSymbolProvider, so functions can be enumerated for any language with a symbol provider; for languages without a line-classification definition, comment lines are reported as 0.

Output Format

CSV

  • Encoding: UTF-8 with BOM
  • Line endings: CRLF
  • Escaping: RFC 4180 compliant (fields containing commas, double quotes, or line breaks are quoted)

Markdown

  • Includes a heading, metadata (workspace name, generation time, function count), and a table
  • | characters inside cells are escaped

Columns (common)

File / Function / Flag Color / Flag Name / Language / Lines / Comment Lines / Blank Lines

Headers are localized to the VSCode display language at the time of export.

Sort Order

Flag color (RED → BLUE → YELLOW → GREEN → none) → file name → line of appearance

Flag Key Constraints

Flags are identified by a key of the form:

<workspace-relative path>#<container chain joined with dots>

Example: src/foo.ts#MyClass.doWork

Requirements

  • VSCode 1.85.0 or later
  • Function detection relies on each language's DocumentSymbolProvider. A language extension for the target language (e.g. ms-vscode.cpptools or clangd for C/C++, Pylance for Python) must be installed and enabled. Files without an available provider are skipped and reported in the completion message.

Known Limitations

  • Renaming a function or moving a file loses its flags (the identity key is derived from the relative path and function name). Moving a function to a different line keeps its flags.
  • Running a count before the language extension finishes indexing may cause files to be skipped. Wait a moment and run again.
  • Some special syntax, such as C++ raw string literals R"(...)", is not supported by the line classifier.
  • Flag states and the output folder are stored per workspace (they do not carry over to other workspaces).

License

MIT — see the LICENSE file bundled with this extension.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft