CodeVisualizer

DucPhamNgoc08MIT活跃维护

VS Code 插件,能把函数控制流画成流程图、把项目模块依赖画成关系图,帮开发者快速看懂陌生代码结构和调用关系。

CodeVisualizer is a powerful VS Code extension that provides two main visualization capabilities: function-level flowcharts for understanding code control flow, and codebase-level dependency graphs for analyzing project structure and module relationships.

v1.0.6发布于 2025-11-15 04:30 UTC700star68fork同步于 2026-11-07 07:32 UTC

怎么上手

由 README 提炼,执行前请确认
在 VS Code 扩展市场搜索 CodeVisualizer 并安装;或执行 code --install-extension codevisualizer-1.0.2.vsix
硬件要求按 README 说明

README 未说明;代码解析全部在本地完成,AI 标签可选本地 Ollama 运行。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

VS Code 扩展,用交互式流程图和依赖图把代码结构和控制流可视化出来

VS Code 插件,能把函数控制流画成流程图、把项目模块依赖画成关系图,帮开发者快速看懂陌生代码结构和调用关系。

核心能力

  • 把单个函数转成可点击跳转的交互式流程图
  • 按目录层级生成代码库模块依赖关系图
  • 用 Tree-sitter WASM 在本地解析代码并生成 AST
  • 可选接入 OpenAI、Gemini、Groq、Ollama 等生成易读标签
  • 内置 9 套主题并随 VS Code 明暗主题自动适配

容易踩的坑

需要 VS Code 1.105.0 或更高版本;依赖图目前只支持 TypeScript/JavaScript、Python 和 PHP,其他语言仅支持函数流程图;AI 标签默认关闭,需手动启用并配置 API Key 或本地 Ollama。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

3 个版本v1.0.6
  1. v1.0.6v1.0.6 - Multi-line Code Visualization Fix (Nov 15, 2025)最新正式版2025-11-15 · 2025-11-15 04:30 UTC

    Fixed

    • Fixed "Unsupported markdown" error when visualizing Promise constructors and multi-line async code
    • Normalized whitespace in node labels to prevent Mermaid parser failures

    Noted

    • Typo fix in EnvironmentDetector.ts by @HoneyBadgerSeeker

    What's Changed

    New Contributors

  2. v1.0.5v1.0.5 - Publisher ID Compatibility Fix (Nov 13, 2025)2025-11-13 · 2025-11-13 04:21 UTC
    查看更新说明

    Fixed

    • Fixed "Failed to fetch" error preventing extension from loading on VS Code 1.105.1+
    • Normalized publisher ID to lowercase format to comply with VS Marketplace requirements
    • Affects all platforms (Windows, macOS, Linux)

    Notes

    • No functional changes to extension features
    • Update recommended for users on VS Code 1.105.1 or later

    What's Changed

  3. v1.0.3v1.0.3 - LLM Translation & Stability Improvements (Nov 12, 2025)2025-11-11 · 2025-11-11 18:57 UTC
    查看更新说明

    This release focuses on improving the LLM translation workflow and fixing several bugs affecting diagram rendering and webview behavior.

    LLM Enhancements

    • Improved translation handling for various LLM response formats

    • Added proper logging for all LLM-related operations

    • Auto-applies LLM labels automatically when the webview loads

    Bug Fixes

    • Fixed missing LLM labels in diagrams

    • Fixed incorrect icon paths

    What's Changed

    LLM labels now display clear plain-text explanations directly on the diagram, making code understanding easier and more intuitive

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Contributors Forks Stargazers Issues MIT License VS Code

    About The Project

    ![CodeVisualizer Demo][product-video]

    CodeVisualizer is a powerful VS Code extension that transforms the way you understand and navigate code. Whether you're diving into a new codebase, debugging complex logic, or documenting your architecture, CodeVisualizer provides instant visual insights through two powerful visualization modes.

    Why CodeVisualizer?

    • Understand complex codebases instantly with interactive dependency graphs showing how your modules connect
    • Debug and comprehend function logic through beautiful flowcharts that reveal control flow, loops, and decision points
    • Save hours of manual diagramming - generate production-ready visualizations in seconds
    • Support for 8+ programming languages with intelligent semantic analysis
    • Privacy-first design - all code analysis happens locally on your machine

    CodeVisualizer bridges the gap between code and comprehension, making it easier for developers to onboard, debug, and maintain software projects of any size.

    Built With

    This extension leverages cutting-edge technologies to deliver fast, accurate code analysis and beautiful visualizations:

    • TypeScript
    • Node.js
    • VS Code API
    • Tree-sitter
    • Mermaid
    • WebAssembly

    Key Features

    Note on Language Support:

    • Function-Level Flowcharts: Supports Python, TypeScript/JavaScript, Java, C++, C, Rust, Go, and PHP
    • Codebase Dependency Visualization: Currently supports TypeScript/JavaScript, Python, and PHP (more languages coming soon)
    • AI-Powered Features: Available only for Function-Level Flowcharts
    Function-Level Flowchart Generation

    Transform individual functions into interactive, visual flowcharts to understand control flow, decision points, and execution paths.

    Capabilities:

    • Multi-language Support: Parse and visualize functions across Python, TypeScript/JavaScript, Java, C++, C, Rust, Go, and PHP
    • Interactive Visualization: Click nodes to navigate to code, zoom and pan for detailed exploration
    • Multiple Views: Sidebar view for quick reference and detachable panel windows for deep analysis
    • Semantic Analysis: Intelligent understanding of control flow, loops, exceptions, and async operations
    • 9 Beautiful Themes: Choose from Monokai, Catppuccin, GitHub, Solarized, One Dark Pro, Dracula, Material Theme, Nord, or Tokyo Night
    • Auto-refresh: Automatically update flowcharts as you edit code
    Codebase Dependency Visualization

    Analyze and visualize your entire codebase structure, revealing module dependencies, file relationships, and project architecture at a glance.

    Capabilities:

    • Dependency Graph: Complete visualization of import/require relationships between modules
    • Color-Coded Categories: Automatic file classification into Core, Report, Config, Tool, and Entry categories
    • VSCode Theme Integration: Seamless dark/light theme support matching your editor
    • High-Contrast Visualization: Color-coded edges and strokes for instant comprehension
    • Interactive Navigation: Zoom, pan, and explore even the largest dependency graphs smoothly
    • Folder Hierarchy: Smart subgraphs organized by your directory structure
    AI-Powered Features (Function Flowcharts)

    Note: AI features enhance function-level flowcharts only, making complex logic instantly readable.

    • Smart Labels: AI-generated human-friendly descriptions replace cryptic variable names and expressions
    • Multiple Providers: Works with OpenAI, Gemini, Groq, Ollama (local), and Anthropic
    • Intelligent Caching: Minimizes API calls and costs through efficient label caching
    • Customizable Styles: Choose between concise, explanatory, or technical label formats
    • Multi-language Support: Generate labels in your preferred language for global teams

    Getting Started

    Get CodeVisualizer up and running in your VS Code environment in just a few clicks.

    Prerequisites

    • Visual Studio Code version 1.105.0 or higher
    • Active workspace with supported programming languages (Python, TypeScript/JavaScript, Java, C++, C, Rust, or Go)

    Installation

    1. Install from VS Code Marketplace

      • Open VS Code
      • Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac) to open Extensions
      • Search for "CodeVisualizer"
      • Click Install
    2. Install from VSIX file (if applicable)

      code --install-extension codevisualizer-1.0.2.vsix
      
    3. Configure AI Features (Optional)

      • Open Settings: Ctrl+, (Windows/Linux) or Cmd+, (Mac)
      • Search for "CodeVisualizer"
      • Enable AI labels and add your API key for supported providers, including Atlas Cloud
      • Or use Ollama for completely local AI processing
    4. Start Visualizing

      • Right-click any function → "CodeVisualizer: Open flowchart in new window"
      • Right-click any folder → "Visualize Codebase Flow"

    Usage

    Generating Function Flowcharts

    1. Open any supported source file in VS Code
    2. Right-click in the editor
    3. Select "CodeVisualizer: Open flowchart in new window"
      • Alternatively, use Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and type "CodeVisualizer"
    4. Explore the interactive flowchart:
      • Click nodes to jump to corresponding code
      • Zoom in/out with mouse wheel
      • Pan by clicking and dragging
      • Switch themes from the settings icon

    Visualizing Codebase Dependencies

    1. In the Explorer sidebar, right-click on any folder containing your source code
      • Alternatively, use Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and type "Visualize Codebase Flow"
    2. Select "Visualize Codebase Flow"
    3. Explore the dependency graph:
      • View color-coded file categories
      • Trace import chains between modules
      • Identify circular dependencies
      • Understand your project architecture at a glance

    AI-Enhanced Labels (Function Flowcharts)

    1. Enable AI labels in Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and type "CodeVisualizer: Enable AI Labels"
    2. Configure your preferred LLM provider and API key
    3. Generate a flowchart - AI labels will automatically replace technical labels

    Supported Languages

    Function-Level Flowcharts

    LanguageStatus
    PythonFull Support
    TypeScript/JavaScriptFull Support
    JavaFull Support
    C++Full Support
    CFull Support
    RustFull Support
    GoFull Support
    PHPFull Support

    Codebase Dependency Visualization

    LanguageStatusFile Extensions
    TypeScript/JavaScriptFull Support.js, .ts, .mjs, .cjs
    PythonFull Support.py
    PHPBasic Support.php

    Planned Support: Java, C++, C, Rust, Go dependency analysis coming in future releases.

    How It Works

    Function-Level Flowchart Pipeline

    1. Parsing: Tree-sitter parsers (compiled to WASM) convert source code into Abstract Syntax Trees (AST)
    2. Analysis: AST traversal identifies control structures, function boundaries, exception handling, async operations, and data flow
    3. IR Generation: AST is transformed into an Intermediate Representation (IR) with nodes representing code blocks and edges showing flow
    4. Visualization: IR is converted to Mermaid diagram syntax
    5. Rendering: Mermaid.js renders an interactive flowchart in a VS Code webview panel

    Codebase Dependency Analysis Pipeline

    1. File Discovery: Scans workspace recursively for supported file types
    2. Dependency Extraction: Parses import/require statements using language-specific parsers
    3. Path Resolution: Resolves relative and absolute import paths to actual file locations
    4. Graph Building: Constructs a directed graph with files as nodes and dependencies as edges
    5. Classification: Categorizes files based on naming patterns and directory structure
    6. Visualization: Generates Mermaid flowchart with color-coded nodes and edges
    7. Rendering: Displays an interactive graph with zoom, pan, and navigation features

    AI Label Generation (Function Flowcharts)

    1. Extraction: Extracts node labels from generated Mermaid code
    2. Caching: Checks local cache for previously generated labels
    3. Translation: Sends uncached labels to selected LLM provider with optimized prompts
    4. Replacement: Replaces technical labels with human-friendly descriptions
    5. Storage: Caches results locally to minimize future API calls

    Privacy & Security

    Data Handling

    Code Analysis:

    • All code parsing happens 100% locally on your machine
    • No code is ever sent to external servers for flowchart generation
    • AST parsing uses local Tree-sitter WASM parsers with zero network requests
    • Your source code never leaves your computer

    AI Features (Optional & Opt-in):

    • When AI labels are enabled, only node labels (short text snippets, not full code) are sent to LLM providers
    • API keys are stored securely using VS Code's built-in Secret Storage API with encryption
    • Smart caching minimizes API calls and reduces data transmission
    • Use Ollama for complete privacy with local model processing
    • All AI features are disabled by default and require explicit user activation

    What Data is Collected?

    None. CodeVisualizer does not collect, store, or transmit your data.

    Exception: When AI labels are explicitly enabled by you, minimal label text (e.g., "if x > 0", "return result") is sent to your chosen LLM provider for translation. This is completely optional and can be disabled anytime.

    API Key Security

    • Stored using VS Code's secure Secret Storage (encrypted at rest)
    • Never transmitted except to your selected LLM provider during API calls
    • Can be cleared instantly via settings
    • Not included in any logs or diagnostic reports

    Contributing

    Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

    If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

    1. Fork the Project
    2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
    3. Commit your Changes (git commit -m 'Add some AmazingFeature')
    4. Push to the Branch (git push origin feature/AmazingFeature)
    5. Open a Pull Request

    Development Setup

    # Clone the repository
    git clone https://github.com/DucPhamNgoc08/CodeVisualizer.git
    
    # Install dependencies
    npm install
    
    # Open in VS Code
    code .
    
    # Press F5 to launch Extension Development Host
    

    Top contributors:

    License

    Distributed under the MIT License. See LICENSE.txt for more information.

    Contact

    Duc Pham Ngoc - [email protected]

    Project Link: https://github.com/DucPhamNgoc08/CodeVisualizer

    Support: