|
1 | | -# CodeCount |
| 1 | +# CodeCount - VS Code Extension |
| 2 | + |
| 3 | +<!-- Badges --> |
| 4 | +[](https://opensource.org/licenses/MIT) |
| 5 | +[](https://code.visualstudio.com/) |
| 6 | +[](https://www.typescriptlang.org/) |
| 7 | + |
| 8 | +> Quickly analyze your project's codebase by counting lines of code, comments, and get insights organized by file types. |
2 | 9 |
|
3 | 10 | ## Overview |
4 | 11 |
|
5 | | -CodeCount is a VS Code extension that counts lines of code in your workspace and shows stats in a dedicated view. |
| 12 | +**CodeCount** is a powerful VS Code extension that provides comprehensive code metrics for your projects. Instantly see how many lines of code, comments, and blank lines your workspace contains. Get detailed breakdowns by file type, understand code distribution, and track your project's scale. |
| 13 | + |
| 14 | +Perfect for developers, project managers, and teams who need quick insights into codebase size and complexity. |
6 | 15 |
|
7 | 16 | ## Features |
8 | 17 |
|
9 | | -- Count total lines of code in the workspace. |
10 | | -- Count lines per file and by file extension. |
11 | | -- Refreshable stats view in the Activity Bar. |
| 18 | +- **Workspace Analysis** - Get total line counts for your entire project |
| 19 | +- **File-by-File Breakdown** - See statistics for individual files |
| 20 | +- **Extension-Based Statistics** - Analyze code distribution across file types (TypeScript, JavaScript, Python, etc.) |
| 21 | +- **Comment Detection** - Identify and count comment lines separately |
| 22 | +- **Real-Time Refresh** - Update stats anytime with a single click |
| 23 | +- **Sidebar Integration** - Dedicated panel in VS Code's Activity Bar |
| 24 | +- **Gitignore Support** - Respects your `.gitignore` patterns automatically |
| 25 | +- **⏱Performance Optimized** - Fast analysis even for large projects |
| 26 | + |
| 27 | +## 📋 Commands |
| 28 | + |
| 29 | +Access CodeCount commands via the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`): |
| 30 | + |
| 31 | +| Command | Description | |
| 32 | +|---------|-------------| |
| 33 | +| `CodeCount: Count Lines of Code` | Analyze the current active file | |
| 34 | +| `CodeCount: Count Lines of Code in All Files` | Analyze entire workspace | |
| 35 | +| `CodeCount: Count Lines of Code by Extension` | Get breakdown by file type | |
| 36 | +| `CodeCount: Refresh CodeCount Stats` | Refresh sidebar statistics | |
| 37 | + |
| 38 | +## 📦 Requirements |
| 39 | + |
| 40 | +- **VS Code:** 1.108.2 or newer |
| 41 | +- **Git:** Required for repository recognition (optional, but recommended) |
| 42 | + |
| 43 | +## 🚀 Quick Start |
| 44 | + |
| 45 | +### Installation |
| 46 | + |
| 47 | +1. Open VS Code |
| 48 | +2. Go to Extensions (`Ctrl+Shift+X` / `Cmd+Shift+X`) |
| 49 | +3. Search for "CodeCount" |
| 50 | +4. Click **Install** |
| 51 | +5. Reload VS Code if prompted |
| 52 | + |
| 53 | +### Usage |
| 54 | + |
| 55 | +#### Method 1: Using Commands |
| 56 | +- Open Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`) |
| 57 | +- Type "CodeCount" to see available commands |
| 58 | +- Select the command you want to run |
| 59 | + |
| 60 | +#### Method 2: Using Sidebar |
| 61 | +- Click the **CodeCount** icon in the Activity Bar (left sidebar) |
| 62 | +- View current statistics |
| 63 | +- Click the refresh button to update |
| 64 | + |
| 65 | +#### Example Output |
| 66 | +``` |
| 67 | +Total lines in workspace (145 files): 25,847 |
| 68 | +Comment lines: 3,421 |
| 69 | +``` |
| 70 | + |
| 71 | +## 🛠️ Development |
| 72 | + |
| 73 | +### Prerequisites |
| 74 | +- Node.js 18+ |
| 75 | +- pnpm (recommended) or npm |
| 76 | + |
| 77 | +### Setup |
| 78 | + |
| 79 | +## 📚 Configuration |
| 80 | + |
| 81 | +CodeCount respects your project's `.gitignore` file, automatically excluding: |
| 82 | +- `node_modules/` |
| 83 | +- `dist/` and `build/` |
| 84 | +- `.git/` directories |
| 85 | +- And any patterns defined in `.gitignore` |
| 86 | + |
| 87 | +## 🤝 Contributing |
| 88 | + |
| 89 | +We welcome contributions! Here's how to help: |
| 90 | + |
| 91 | +### Getting Started |
| 92 | +1. **Fork** the repository |
| 93 | +2. **Create** a feature branch: `git checkout -b feature/amazing-feature` |
| 94 | +3. **Make** your changes |
| 95 | +4. **Test** thoroughly |
| 96 | +5. **Commit** with clear messages: `git commit -m 'Add amazing feature'` |
| 97 | +6. **Push** to your branch: `git push origin feature/amazing-feature` |
| 98 | +7. **Open** a Pull Request |
| 99 | + |
| 100 | +### Development Guidelines |
| 101 | +- Follow TypeScript best practices |
| 102 | +- Keep code clean and well-documented |
| 103 | +- Run `pnpm run lint` before committing |
| 104 | +- Write meaningful commit messages |
| 105 | +- Test changes in the Extension Development Host |
| 106 | + |
| 107 | +### Code Style |
| 108 | +- Use TypeScript with strict mode enabled |
| 109 | +- Follow ESLint rules (run `pnpm run lint`) |
| 110 | +- Use descriptive variable and function names |
| 111 | +- Add comments for complex logic |
| 112 | + |
| 113 | +## License |
| 114 | + |
| 115 | +This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details. |
| 116 | + |
| 117 | +## Bug Reports & Feature Requests |
12 | 118 |
|
13 | | -## Commands |
| 119 | +Have a bug to report or feature to suggest? |
14 | 120 |
|
15 | | -- `CodeCount: Count Lines of Code` |
16 | | -- `CodeCount: Count Lines of Code in All Files` |
17 | | -- `CodeCount: Count Lines of Code by Extension` |
18 | | -- `CodeCount: Refresh CodeCount Stats` |
| 121 | +- **Issues:** [GitHub Issues](https://github.com/KebanFiru/CodeCount/issues) |
| 122 | +- **Discussions:** [GitHub Discussions](https://github.com/KebanFiru/CodeCount/discussions) |
19 | 123 |
|
20 | | -## Requirements |
| 124 | +Please include: |
| 125 | +- Clear description of the issue/feature |
| 126 | +- Steps to reproduce (for bugs) |
| 127 | +- Expected vs actual behavior |
| 128 | +- VS Code version and OS |
21 | 129 |
|
22 | | -- VS Code 1.108.2 or newer. |
| 130 | +## 📊Project Statistics |
23 | 131 |
|
24 | | -## Usage |
| 132 | +- **Language:** TypeScript |
| 133 | +- **VS Code API:** 1.108.2+ |
| 134 | +- **License:** MIT |
| 135 | +- **Status:** Active Development |
25 | 136 |
|
26 | | -1. Open the Command Palette. |
27 | | -2. Run one of the CodeCount commands. |
28 | | -3. Open the CodeCount view in the Activity Bar to see stats. |
| 137 | +## 💬 Questions? |
29 | 138 |
|
30 | | -## Contribution Guidelines |
| 139 | +Have questions? Feel free to: |
| 140 | +- Open a [Discussion](https://github.com/KebanFiru/CodeCount/discussions) |
| 141 | +- Check the [Issues](https://github.com/KebanFiru/CodeCount/issues) page |
| 142 | +- Create an Issue with the `question` label |
31 | 143 |
|
32 | | -Thanks for taking the time to contribute! To keep changes consistent, please follow these steps: |
| 144 | +--- |
33 | 145 |
|
34 | | -1. Fork the repository and create a feature branch. |
35 | | -2. Install dependencies with `npm install`. |
36 | | -3. Build or watch the extension during development: |
37 | | - - `npm run compile` for a one-time build |
38 | | - - Press `F5` on [extension.ts](src/extension.ts) to launch the Extension Development Host. |
39 | | -4. Run checks before opening a pull request: |
40 | | - - `npm run lint` |
41 | | -5. Open a pull request with a clear description of the change and any testing notes. |
42 | 146 |
|
43 | 147 |
|
0 commit comments