Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>代码行数统计 (Statistics of Code Lines)New to Visual Studio Code? Get it now.
代码行数统计 (Statistics of Code Lines)

代码行数统计 (Statistics of Code Lines)

哎哟兔

|
2 installs
| (1) | Free
统计工作目录各编程语言代码行数 | Count code lines by programming language in workspace
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

代码行数统计 (Statistics of Code Lines)

统计工作目录各编程语言代码行数

Count code lines by programming language in workspace

主要功能 | Main Features

  • 📊 详细的代码统计信息(文件数量、总行数)
  • 🎨 美观的用户界面,现代化设计
  • 📤 一键导出静态HTML格式报告
  • ⚙️ 灵活的配置选项,支持自定义语言和扩展名
  • 🔍 智能二进制文件过滤
  • ⚡ 高性能扫描,支持大型项目

🔍 智能扫描 | Smart Scanning

  • 递归扫描工作目录及所有子目录
  • 自动识别80+种编程语言
  • 支持自定义语言和文件扩展名
  • 智能排除非源码文件和二进制文件
  • 异步处理,不阻塞UI
  • 支持大型代码库

安装使用 | Installation & Usage

使用方法 | Usage

方法一:命令面板 | Method 1: Command Palette

  1. 按 Ctrl+Shift+P 打开命令面板
  2. 输入 "统计代码行数" 或 "Count Code Lines"
  3. 选择相应命令执行

方法二:右键菜单 | Method 2: Context Menu

  1. 在资源管理器中右键点击文件夹
  2. 选择 "统计代码行数 | Count Code Lines"

方法三:编辑器右键 | Method 3: Editor Context Menu

  1. 在编辑器中右键点击
  2. 选择 "统计当前文件 | Count Current File"

配置选项 | Configuration

基本设置 | Basic Settings

{
  "codeStats.includeExtensions": [],
  "codeStats.excludeExtensions": [".log", ".tmp", ".cache", ".bak", ".txt"],
  "codeStats.excludePatterns": [
    "**/node_modules/**",
    "**/.git/**",
    "**/dist/**",
    "**/build/**",
    "**/out/**",
    "**/.vscode/**"
  ],
  "codeStats.maxFileSize": "2MB",
  "codeStats.useBuiltinLanguages": true,
  "codeStats.skipBinaryFiles": true,
  "codeStats.customLanguages": {}
}

配置说明 | Configuration Description

配置项 说明 默认值
includeExtensions 额外包含的文件扩展名 []
excludeExtensions 要排除的文件扩展名 [".log", ".tmp", ".cache", ".bak", ".txt"]
excludePatterns 要排除的文件夹模式 ["**/node_modules/**", "**/.git/**", ...]
maxFileSize 最大文件大小限制 "2MB"
useBuiltinLanguages 使用内置语言定义 true
skipBinaryFiles 跳过二进制文件 true
customLanguages 自定义语言映射 {}

文件大小限制选项 | File Size Limit Options

  • "1MB" - 1兆字节
  • "2MB" - 2兆字节(默认)
  • "5MB" - 5兆字节
  • "unlimited" - 无限制

命令列表 | Commands

命令 说明
codeStats.scanWorkspace 统计代码行数 | Count Code Lines
codeStats.scanCurrentFile 统计当前文件 | Count Current File
codeStats.showResults 显示统计结果 | Show Statistics Results
codeStats.exportHtml 导出HTML报告 | Export HTML Report
codeStats.refreshStats 刷新统计 | Refresh Statistics

支持 | Support

如果这个扩展对你有帮助,请给个⭐️!

If this extension helps you, please give it a ⭐️!

赞赏支持


享受编码统计的乐趣!| Enjoy coding statistics! 🚀

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