tree-sitter-analyzer 1.5.0__py3-none-any.whl → 1.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tree-sitter-analyzer might be problematic. Click here for more details.
- tree_sitter_analyzer/__init__.py +1 -1
- tree_sitter_analyzer/cli_main.py +3 -1
- tree_sitter_analyzer/formatters/python_formatter.py +161 -20
- tree_sitter_analyzer/languages/python_plugin.py +581 -148
- tree_sitter_analyzer/mcp/server.py +17 -2
- tree_sitter_analyzer/mcp/tools/table_format_tool.py +106 -4
- tree_sitter_analyzer/mcp/utils/file_output_manager.py +257 -0
- tree_sitter_analyzer/models.py +8 -0
- tree_sitter_analyzer/queries/python.py +617 -58
- tree_sitter_analyzer/table_formatter.py +26 -2
- tree_sitter_analyzer-1.6.1.dist-info/METADATA +845 -0
- {tree_sitter_analyzer-1.5.0.dist-info → tree_sitter_analyzer-1.6.1.dist-info}/RECORD +14 -13
- tree_sitter_analyzer-1.5.0.dist-info/METADATA +0 -1229
- {tree_sitter_analyzer-1.5.0.dist-info → tree_sitter_analyzer-1.6.1.dist-info}/WHEEL +0 -0
- {tree_sitter_analyzer-1.5.0.dist-info → tree_sitter_analyzer-1.6.1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tree-sitter-analyzer
|
|
3
|
+
Version: 1.6.1
|
|
4
|
+
Summary: Extensible multi-language code analyzer framework using Tree-sitter with dynamic plugin architecture
|
|
5
|
+
Project-URL: Homepage, https://github.com/aimasteracc/tree-sitter-analyzer
|
|
6
|
+
Project-URL: Documentation, https://github.com/aimasteracc/tree-sitter-analyzer#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/aimasteracc/tree-sitter-analyzer.git
|
|
8
|
+
Project-URL: Issues, https://github.com/aimasteracc/tree-sitter-analyzer/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/aimasteracc/tree-sitter-analyzer/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Bug Reports, https://github.com/aimasteracc/tree-sitter-analyzer/issues
|
|
11
|
+
Project-URL: Source Code, https://github.com/aimasteracc/tree-sitter-analyzer
|
|
12
|
+
Author-email: "aisheng.yu" <aimasteracc@gmail.com>
|
|
13
|
+
Maintainer-email: "aisheng.yu" <aimasteracc@gmail.com>
|
|
14
|
+
License: MIT
|
|
15
|
+
Keywords: ai-tools,ast,code-analysis,mcp,mcp-server,model-context-protocol,multi-language,parsing,static-analysis,tree-sitter
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Framework :: AsyncIO
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Topic :: Communications
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
28
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
29
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
30
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
31
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
32
|
+
Classifier: Typing :: Typed
|
|
33
|
+
Requires-Python: >=3.10
|
|
34
|
+
Requires-Dist: cachetools>=5.0.0
|
|
35
|
+
Requires-Dist: chardet>=5.0.0
|
|
36
|
+
Requires-Dist: mcp>=1.12.3
|
|
37
|
+
Requires-Dist: tree-sitter-cpp<0.25.0,>=0.23.4
|
|
38
|
+
Requires-Dist: tree-sitter-java<0.25.0,>=0.23.5
|
|
39
|
+
Requires-Dist: tree-sitter-javascript<0.25.0,>=0.23.1
|
|
40
|
+
Requires-Dist: tree-sitter-python<0.25.0,>=0.23.6
|
|
41
|
+
Requires-Dist: tree-sitter==0.24.0
|
|
42
|
+
Provides-Extra: all
|
|
43
|
+
Requires-Dist: anyio>=4.0.0; extra == 'all'
|
|
44
|
+
Requires-Dist: black>=24.0.0; extra == 'all'
|
|
45
|
+
Requires-Dist: httpx<1.0.0,>=0.27.0; extra == 'all'
|
|
46
|
+
Requires-Dist: isort>=5.13.0; extra == 'all'
|
|
47
|
+
Requires-Dist: mcp>=1.12.2; extra == 'all'
|
|
48
|
+
Requires-Dist: memory-profiler>=0.61.0; extra == 'all'
|
|
49
|
+
Requires-Dist: mypy>=1.17.0; extra == 'all'
|
|
50
|
+
Requires-Dist: pre-commit>=3.0.0; extra == 'all'
|
|
51
|
+
Requires-Dist: psutil<6,>=5.9.6; extra == 'all'
|
|
52
|
+
Requires-Dist: pydantic-settings>=2.2.1; extra == 'all'
|
|
53
|
+
Requires-Dist: pydantic>=2.5.0; extra == 'all'
|
|
54
|
+
Requires-Dist: pytest-asyncio>=1.1.0; extra == 'all'
|
|
55
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'all'
|
|
56
|
+
Requires-Dist: pytest-mock>=3.14.1; extra == 'all'
|
|
57
|
+
Requires-Dist: pytest>=8.4.1; extra == 'all'
|
|
58
|
+
Requires-Dist: ruff>=0.5.0; extra == 'all'
|
|
59
|
+
Requires-Dist: tree-sitter-c<0.25.0,>=0.20.0; extra == 'all'
|
|
60
|
+
Requires-Dist: tree-sitter-cpp<0.25.0,>=0.23.4; extra == 'all'
|
|
61
|
+
Requires-Dist: tree-sitter-go<0.25.0,>=0.20.0; extra == 'all'
|
|
62
|
+
Requires-Dist: tree-sitter-java<0.25.0,>=0.23.5; extra == 'all'
|
|
63
|
+
Requires-Dist: tree-sitter-javascript<0.25.0,>=0.23.1; extra == 'all'
|
|
64
|
+
Requires-Dist: tree-sitter-python<0.25.0,>=0.23.0; extra == 'all'
|
|
65
|
+
Requires-Dist: tree-sitter-rust<0.25.0,>=0.20.0; extra == 'all'
|
|
66
|
+
Requires-Dist: tree-sitter-typescript<0.25.0,>=0.20.0; extra == 'all'
|
|
67
|
+
Requires-Dist: types-psutil>=5.9.0; extra == 'all'
|
|
68
|
+
Provides-Extra: all-languages
|
|
69
|
+
Requires-Dist: tree-sitter-c<0.25.0,>=0.20.0; extra == 'all-languages'
|
|
70
|
+
Requires-Dist: tree-sitter-cpp<0.25.0,>=0.23.4; extra == 'all-languages'
|
|
71
|
+
Requires-Dist: tree-sitter-go<0.25.0,>=0.20.0; extra == 'all-languages'
|
|
72
|
+
Requires-Dist: tree-sitter-java<0.25.0,>=0.23.5; extra == 'all-languages'
|
|
73
|
+
Requires-Dist: tree-sitter-javascript<0.25.0,>=0.23.1; extra == 'all-languages'
|
|
74
|
+
Requires-Dist: tree-sitter-python<0.25.0,>=0.23.0; extra == 'all-languages'
|
|
75
|
+
Requires-Dist: tree-sitter-rust<0.25.0,>=0.20.0; extra == 'all-languages'
|
|
76
|
+
Requires-Dist: tree-sitter-typescript<0.25.0,>=0.20.0; extra == 'all-languages'
|
|
77
|
+
Provides-Extra: c
|
|
78
|
+
Requires-Dist: tree-sitter-c<0.25.0,>=0.20.0; extra == 'c'
|
|
79
|
+
Provides-Extra: cpp
|
|
80
|
+
Requires-Dist: tree-sitter-cpp<0.25.0,>=0.23.4; extra == 'cpp'
|
|
81
|
+
Provides-Extra: dev
|
|
82
|
+
Requires-Dist: black>=24.0.0; extra == 'dev'
|
|
83
|
+
Requires-Dist: isort>=5.13.0; extra == 'dev'
|
|
84
|
+
Requires-Dist: memory-profiler>=0.61.0; extra == 'dev'
|
|
85
|
+
Requires-Dist: mypy>=1.17.0; extra == 'dev'
|
|
86
|
+
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
|
|
87
|
+
Requires-Dist: psutil<6,>=5.9.6; extra == 'dev'
|
|
88
|
+
Requires-Dist: pytest-asyncio>=1.1.0; extra == 'dev'
|
|
89
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
90
|
+
Requires-Dist: pytest-mock>=3.14.1; extra == 'dev'
|
|
91
|
+
Requires-Dist: pytest>=8.4.1; extra == 'dev'
|
|
92
|
+
Requires-Dist: ruff>=0.5.0; extra == 'dev'
|
|
93
|
+
Requires-Dist: types-psutil>=5.9.0; extra == 'dev'
|
|
94
|
+
Provides-Extra: full
|
|
95
|
+
Requires-Dist: anyio>=4.0.0; extra == 'full'
|
|
96
|
+
Requires-Dist: black>=24.0.0; extra == 'full'
|
|
97
|
+
Requires-Dist: httpx<1.0.0,>=0.27.0; extra == 'full'
|
|
98
|
+
Requires-Dist: isort>=5.13.0; extra == 'full'
|
|
99
|
+
Requires-Dist: mcp>=1.12.2; extra == 'full'
|
|
100
|
+
Requires-Dist: memory-profiler>=0.61.0; extra == 'full'
|
|
101
|
+
Requires-Dist: mypy>=1.17.0; extra == 'full'
|
|
102
|
+
Requires-Dist: pre-commit>=3.0.0; extra == 'full'
|
|
103
|
+
Requires-Dist: psutil<6,>=5.9.6; extra == 'full'
|
|
104
|
+
Requires-Dist: pydantic-settings>=2.2.1; extra == 'full'
|
|
105
|
+
Requires-Dist: pydantic>=2.5.0; extra == 'full'
|
|
106
|
+
Requires-Dist: pytest-asyncio>=1.1.0; extra == 'full'
|
|
107
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'full'
|
|
108
|
+
Requires-Dist: pytest-mock>=3.14.1; extra == 'full'
|
|
109
|
+
Requires-Dist: pytest>=8.4.1; extra == 'full'
|
|
110
|
+
Requires-Dist: ruff>=0.5.0; extra == 'full'
|
|
111
|
+
Requires-Dist: tree-sitter-c<0.25.0,>=0.20.0; extra == 'full'
|
|
112
|
+
Requires-Dist: tree-sitter-cpp<0.25.0,>=0.23.4; extra == 'full'
|
|
113
|
+
Requires-Dist: tree-sitter-go<0.25.0,>=0.20.0; extra == 'full'
|
|
114
|
+
Requires-Dist: tree-sitter-java<0.25.0,>=0.23.5; extra == 'full'
|
|
115
|
+
Requires-Dist: tree-sitter-javascript<0.25.0,>=0.23.1; extra == 'full'
|
|
116
|
+
Requires-Dist: tree-sitter-python<0.25.0,>=0.23.0; extra == 'full'
|
|
117
|
+
Requires-Dist: tree-sitter-rust<0.25.0,>=0.20.0; extra == 'full'
|
|
118
|
+
Requires-Dist: tree-sitter-typescript<0.25.0,>=0.20.0; extra == 'full'
|
|
119
|
+
Requires-Dist: types-psutil>=5.9.0; extra == 'full'
|
|
120
|
+
Provides-Extra: go
|
|
121
|
+
Requires-Dist: tree-sitter-go<0.25.0,>=0.20.0; extra == 'go'
|
|
122
|
+
Provides-Extra: java
|
|
123
|
+
Requires-Dist: tree-sitter-java<0.25.0,>=0.23.5; extra == 'java'
|
|
124
|
+
Provides-Extra: javascript
|
|
125
|
+
Requires-Dist: tree-sitter-javascript<0.25.0,>=0.23.1; extra == 'javascript'
|
|
126
|
+
Provides-Extra: mcp
|
|
127
|
+
Requires-Dist: anyio>=4.0.0; extra == 'mcp'
|
|
128
|
+
Requires-Dist: httpx<1.0.0,>=0.27.0; extra == 'mcp'
|
|
129
|
+
Requires-Dist: mcp>=1.12.2; extra == 'mcp'
|
|
130
|
+
Requires-Dist: pydantic-settings>=2.2.1; extra == 'mcp'
|
|
131
|
+
Requires-Dist: pydantic>=2.5.0; extra == 'mcp'
|
|
132
|
+
Provides-Extra: popular
|
|
133
|
+
Requires-Dist: tree-sitter-java<0.25.0,>=0.23.5; extra == 'popular'
|
|
134
|
+
Requires-Dist: tree-sitter-javascript<0.25.0,>=0.23.1; extra == 'popular'
|
|
135
|
+
Requires-Dist: tree-sitter-python<0.25.0,>=0.23.0; extra == 'popular'
|
|
136
|
+
Requires-Dist: tree-sitter-typescript<0.25.0,>=0.20.0; extra == 'popular'
|
|
137
|
+
Provides-Extra: python
|
|
138
|
+
Requires-Dist: tree-sitter-python<0.25.0,>=0.23.0; extra == 'python'
|
|
139
|
+
Provides-Extra: rust
|
|
140
|
+
Requires-Dist: tree-sitter-rust<0.25.0,>=0.20.0; extra == 'rust'
|
|
141
|
+
Provides-Extra: systems
|
|
142
|
+
Requires-Dist: tree-sitter-c<0.25.0,>=0.20.0; extra == 'systems'
|
|
143
|
+
Requires-Dist: tree-sitter-cpp<0.25.0,>=0.23.4; extra == 'systems'
|
|
144
|
+
Requires-Dist: tree-sitter-go<0.25.0,>=0.20.0; extra == 'systems'
|
|
145
|
+
Requires-Dist: tree-sitter-rust<0.25.0,>=0.20.0; extra == 'systems'
|
|
146
|
+
Provides-Extra: test
|
|
147
|
+
Requires-Dist: pytest-asyncio>=1.1.0; extra == 'test'
|
|
148
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
|
|
149
|
+
Requires-Dist: pytest-mock>=3.14.1; extra == 'test'
|
|
150
|
+
Requires-Dist: pytest>=8.4.1; extra == 'test'
|
|
151
|
+
Requires-Dist: tree-sitter-cpp>=0.23.4; extra == 'test'
|
|
152
|
+
Requires-Dist: tree-sitter-java>=0.23.5; extra == 'test'
|
|
153
|
+
Requires-Dist: tree-sitter-javascript>=0.23.1; extra == 'test'
|
|
154
|
+
Requires-Dist: tree-sitter-python>=0.23.0; extra == 'test'
|
|
155
|
+
Provides-Extra: typescript
|
|
156
|
+
Requires-Dist: tree-sitter-typescript<0.25.0,>=0.20.0; extra == 'typescript'
|
|
157
|
+
Provides-Extra: web
|
|
158
|
+
Requires-Dist: tree-sitter-javascript<0.25.0,>=0.23.1; extra == 'web'
|
|
159
|
+
Requires-Dist: tree-sitter-typescript<0.25.0,>=0.20.0; extra == 'web'
|
|
160
|
+
Description-Content-Type: text/markdown
|
|
161
|
+
|
|
162
|
+
# Tree-sitter Analyzer
|
|
163
|
+
|
|
164
|
+
**English** | **[日本語](README_ja.md)** | **[简体中文](README_zh.md)**
|
|
165
|
+
|
|
166
|
+
[](https://python.org)
|
|
167
|
+
[](LICENSE)
|
|
168
|
+
[](#quality-assurance)
|
|
169
|
+
[](#quality-assurance)
|
|
170
|
+
[](#quality-assurance)
|
|
171
|
+
[](https://pypi.org/project/tree-sitter-analyzer/)
|
|
172
|
+
[](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
|
|
173
|
+
[](https://github.com/aimasteracc/tree-sitter-analyzer)
|
|
174
|
+
|
|
175
|
+
## 🚀 Enterprise-Grade Code Analysis Tool for the AI Era
|
|
176
|
+
|
|
177
|
+
> **Deep AI Integration · Powerful File Search · Multi-Language Support · Intelligent Code Analysis**
|
|
178
|
+
|
|
179
|
+
## 📋 Table of Contents
|
|
180
|
+
|
|
181
|
+
- [💡 Key Features](#-key-features)
|
|
182
|
+
- [📋 Prerequisites (Required for All Users)](#-prerequisites-required-for-all-users)
|
|
183
|
+
- [🚀 Quick Start](#-quick-start)
|
|
184
|
+
- [🤖 AI Users (Claude Desktop, Cursor, etc.)](#-ai-users-claude-desktop-cursor-etc)
|
|
185
|
+
- [💻 CLI Users (Command Line Tools)](#-cli-users-command-line-tools)
|
|
186
|
+
- [👨💻 Developers (Source Development)](#-developers-source-development)
|
|
187
|
+
- [📖 Usage Workflow & Examples](#-usage-workflow--examples)
|
|
188
|
+
- [🔄 AI Assistant SMART Workflow](#-ai-assistant-smart-workflow)
|
|
189
|
+
- [⚡ Complete CLI Commands](#-complete-cli-commands)
|
|
190
|
+
- [🛠️ Core Features](#️-core-features)
|
|
191
|
+
- [🏆 Quality Assurance](#-quality-assurance)
|
|
192
|
+
- [📚 Documentation & Support](#-documentation--support)
|
|
193
|
+
- [🤝 Contributing & License](#-contributing--license)
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 💡 Key Features
|
|
198
|
+
|
|
199
|
+
Tree-sitter Analyzer is an enterprise-grade code analysis tool designed for the AI era, providing:
|
|
200
|
+
|
|
201
|
+
### 🤖 Deep AI Integration
|
|
202
|
+
- **MCP Protocol Support** - Native support for Claude Desktop, Cursor, Roo Code, and other AI tools
|
|
203
|
+
- **SMART Workflow** - Systematic AI-assisted code analysis methodology
|
|
204
|
+
- **Break Token Limits** - Enable AI to understand code files of any size
|
|
205
|
+
- **Natural Language Interaction** - Complete complex code analysis tasks using natural language
|
|
206
|
+
|
|
207
|
+
### 🔍 Powerful Search Capabilities
|
|
208
|
+
- **Intelligent File Discovery** - High-performance file search based on fd with multiple filtering conditions
|
|
209
|
+
- **Precise Content Search** - Regular expression content search based on ripgrep
|
|
210
|
+
- **Two-Stage Search** - Combined workflow of finding files then searching content
|
|
211
|
+
- **Project Boundary Protection** - Automatic detection and respect for project boundaries to ensure security
|
|
212
|
+
|
|
213
|
+
### 📊 Intelligent Code Analysis
|
|
214
|
+
- **Fast Structure Analysis** - Understand code architecture without reading the entire file
|
|
215
|
+
- **Precise Code Extraction** - Support for extracting precise code snippets by line range
|
|
216
|
+
- **Complexity Analysis** - Cyclomatic complexity calculation and code quality metrics
|
|
217
|
+
- **Unified Element System** - Revolutionary unified code element management architecture
|
|
218
|
+
|
|
219
|
+
### 🌍 Enterprise-Grade Multi-Language Support
|
|
220
|
+
- **Java** - Full support (1103 lines of plugin code, 73% coverage), including Spring, JPA frameworks
|
|
221
|
+
- **Python** - Full support (584 lines of plugin code, 63% coverage), including type annotations, decorators
|
|
222
|
+
- **JavaScript** - Enterprise-grade support (1445 lines of plugin code, 68% coverage), including ES6+, React/Vue/Angular, JSX
|
|
223
|
+
- **TypeScript** - Query support (230 lines of query definitions, 74% coverage), including interfaces, types, decorators
|
|
224
|
+
- **More Languages** - Basic support for C/C++, Rust, Go
|
|
225
|
+
|
|
226
|
+
### 🏆 Production Ready
|
|
227
|
+
- **1,893 Tests** - 100% pass rate, enterprise-grade quality assurance
|
|
228
|
+
- **71.48% Coverage** - Comprehensive test suite
|
|
229
|
+
- **Cross-Platform Support** - Full compatibility with Windows, macOS, Linux
|
|
230
|
+
- **Continuous Maintenance** - Active development and community support
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 📋 Prerequisites (Required for All Users)
|
|
235
|
+
|
|
236
|
+
Whether you're an AI user, CLI user, or developer, you need to install the following tools first:
|
|
237
|
+
|
|
238
|
+
### 1️⃣ Install uv (Required - for running tools)
|
|
239
|
+
|
|
240
|
+
**uv** is a fast Python package manager used to run tree-sitter-analyzer.
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# macOS/Linux
|
|
244
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
245
|
+
|
|
246
|
+
# Windows PowerShell
|
|
247
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Verify installation:**
|
|
251
|
+
```bash
|
|
252
|
+
uv --version
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### 2️⃣ Install fd and ripgrep (Required for search functionality)
|
|
256
|
+
|
|
257
|
+
**fd** and **ripgrep** are high-performance file and content search tools used for advanced MCP features.
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# macOS
|
|
261
|
+
brew install fd ripgrep
|
|
262
|
+
|
|
263
|
+
# Windows (recommended using winget)
|
|
264
|
+
winget install sharkdp.fd BurntSushi.ripgrep.MSVC
|
|
265
|
+
|
|
266
|
+
# Windows (alternative methods)
|
|
267
|
+
# choco install fd ripgrep
|
|
268
|
+
# scoop install fd ripgrep
|
|
269
|
+
|
|
270
|
+
# Ubuntu/Debian
|
|
271
|
+
sudo apt install fd-find ripgrep
|
|
272
|
+
|
|
273
|
+
# CentOS/RHEL/Fedora
|
|
274
|
+
sudo dnf install fd-find ripgrep
|
|
275
|
+
|
|
276
|
+
# Arch Linux
|
|
277
|
+
sudo pacman -S fd ripgrep
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**Verify installation:**
|
|
281
|
+
```bash
|
|
282
|
+
fd --version
|
|
283
|
+
rg --version
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
> **⚠️ Important Note:**
|
|
287
|
+
> - **uv** is required for running all features
|
|
288
|
+
> - **fd** and **ripgrep** are required for using advanced file search and content analysis features
|
|
289
|
+
> - If fd and ripgrep are not installed, basic code analysis features will still work, but file search features will be unavailable
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 🚀 Quick Start
|
|
294
|
+
|
|
295
|
+
### 🤖 AI Users (Claude Desktop, Cursor, etc.)
|
|
296
|
+
|
|
297
|
+
**For:** Users who use AI assistants (such as Claude Desktop, Cursor) for code analysis
|
|
298
|
+
|
|
299
|
+
#### ⚙️ Configuration Steps
|
|
300
|
+
|
|
301
|
+
**Claude Desktop Configuration:**
|
|
302
|
+
|
|
303
|
+
1. Find the configuration file location:
|
|
304
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
305
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
306
|
+
- **Linux**: `~/.config/claude/claude_desktop_config.json`
|
|
307
|
+
|
|
308
|
+
2. Add the following configuration:
|
|
309
|
+
|
|
310
|
+
**Basic Configuration (Recommended - Auto-detect project path):**
|
|
311
|
+
```json
|
|
312
|
+
{
|
|
313
|
+
"mcpServers": {
|
|
314
|
+
"tree-sitter-analyzer": {
|
|
315
|
+
"command": "uv",
|
|
316
|
+
"args": [
|
|
317
|
+
"run", "--with", "tree-sitter-analyzer[mcp]",
|
|
318
|
+
"python", "-m", "tree_sitter_analyzer.mcp.server"
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Advanced Configuration (Manually specify project path):**
|
|
326
|
+
```json
|
|
327
|
+
{
|
|
328
|
+
"mcpServers": {
|
|
329
|
+
"tree-sitter-analyzer": {
|
|
330
|
+
"command": "uv",
|
|
331
|
+
"args": [
|
|
332
|
+
"run", "--with", "tree-sitter-analyzer[mcp]",
|
|
333
|
+
"python", "-m", "tree_sitter_analyzer.mcp.server"
|
|
334
|
+
],
|
|
335
|
+
"env": {
|
|
336
|
+
"TREE_SITTER_PROJECT_ROOT": "/absolute/path/to/your/project",
|
|
337
|
+
"TREE_SITTER_OUTPUT_PATH": "/absolute/path/to/output/directory"
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
3. Restart your AI client
|
|
345
|
+
|
|
346
|
+
4. Start using! Tell the AI:
|
|
347
|
+
```
|
|
348
|
+
Please set the project root directory to: /path/to/your/project
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Other AI Clients:**
|
|
352
|
+
- **Cursor**: Built-in MCP support, refer to Cursor documentation for configuration
|
|
353
|
+
- **Roo Code**: Supports MCP protocol, use the same configuration format
|
|
354
|
+
- **Other MCP-compatible clients**: Use the same server configuration
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
### 💻 CLI Users (Command Line Tools)
|
|
359
|
+
|
|
360
|
+
**For:** Developers who prefer using command-line tools
|
|
361
|
+
|
|
362
|
+
#### 📦 Installation
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
# Basic installation
|
|
366
|
+
uv add tree-sitter-analyzer
|
|
367
|
+
|
|
368
|
+
# Popular language pack (recommended)
|
|
369
|
+
uv add "tree-sitter-analyzer[popular]"
|
|
370
|
+
|
|
371
|
+
# Full installation (including MCP support)
|
|
372
|
+
uv add "tree-sitter-analyzer[all,mcp]"
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
#### ⚡ Quick Experience
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
# View help
|
|
379
|
+
uv run python -m tree_sitter_analyzer --help
|
|
380
|
+
|
|
381
|
+
# Analyze file size (1419 lines completed instantly)
|
|
382
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --advanced --output-format=text
|
|
383
|
+
|
|
384
|
+
# Generate detailed structure table
|
|
385
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --table=full
|
|
386
|
+
|
|
387
|
+
# Precise code extraction
|
|
388
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --partial-read --start-line 93 --end-line 106
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
### 👨💻 Developers (Source Development)
|
|
394
|
+
|
|
395
|
+
**For:** Developers who need to modify source code or contribute
|
|
396
|
+
|
|
397
|
+
#### 🛠️ Development Environment Setup
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
# Clone repository
|
|
401
|
+
git clone https://github.com/aimasteracc/tree-sitter-analyzer.git
|
|
402
|
+
cd tree-sitter-analyzer
|
|
403
|
+
|
|
404
|
+
# Install dependencies
|
|
405
|
+
uv sync --extra all --extra mcp
|
|
406
|
+
|
|
407
|
+
# Run tests
|
|
408
|
+
uv run pytest tests/ -v
|
|
409
|
+
|
|
410
|
+
# Generate coverage report
|
|
411
|
+
uv run pytest tests/ --cov=tree_sitter_analyzer --cov-report=html
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
#### 🔍 Code Quality Checks
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# AI-generated code check
|
|
418
|
+
uv run python llm_code_checker.py --check-all
|
|
419
|
+
|
|
420
|
+
# Quality check
|
|
421
|
+
uv run python check_quality.py --new-code-only
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## 📖 Usage Workflow & Examples
|
|
427
|
+
|
|
428
|
+
### 🔄 AI Assistant SMART Workflow
|
|
429
|
+
|
|
430
|
+
The SMART workflow is the recommended process for analyzing code using AI assistants. The following demonstrates the complete workflow using `examples/BigService.java` (a large service class with 1419 lines):
|
|
431
|
+
|
|
432
|
+
- **S** (Set): Set project root directory
|
|
433
|
+
- **M** (Map): Precisely map target files
|
|
434
|
+
- **A** (Analyze): Analyze core structure
|
|
435
|
+
- **R** (Retrieve): Retrieve key code
|
|
436
|
+
- **T** (Trace): Trace dependencies
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
#### **S - Set Project (First Step)**
|
|
441
|
+
|
|
442
|
+
**Tell the AI:**
|
|
443
|
+
```
|
|
444
|
+
Please set the project root directory to: C:\git-public\tree-sitter-analyzer
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**The AI will automatically call** the `set_project_path` tool.
|
|
448
|
+
|
|
449
|
+
> 💡 **Tip**: You can also pre-set this through the `TREE_SITTER_PROJECT_ROOT` environment variable in MCP configuration.
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
#### **M - Map Target Files (Find files to analyze)**
|
|
454
|
+
|
|
455
|
+
**Scenario 1: Don't know where the file is, search first**
|
|
456
|
+
|
|
457
|
+
```
|
|
458
|
+
Find all Java files containing "BigService" in the project
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
**The AI will call** the `find_and_grep` tool and return results showing 8 matches in BigService.java.
|
|
462
|
+
|
|
463
|
+
**Scenario 2: Known file path, use directly**
|
|
464
|
+
```
|
|
465
|
+
I want to analyze the file examples/BigService.java
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
470
|
+
#### **A - Analyze Core Structure (Understand file size and organization)**
|
|
471
|
+
|
|
472
|
+
**Tell the AI:**
|
|
473
|
+
```
|
|
474
|
+
Please analyze the structure of examples/BigService.java, I want to know how large this file is and what main components it contains
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
**The AI will call** the `analyze_code_structure` tool and return:
|
|
478
|
+
```json
|
|
479
|
+
{
|
|
480
|
+
"file_path": "examples/BigService.java",
|
|
481
|
+
"language": "java",
|
|
482
|
+
"metrics": {
|
|
483
|
+
"lines_total": 1419,
|
|
484
|
+
"lines_code": 906,
|
|
485
|
+
"lines_comment": 246,
|
|
486
|
+
"lines_blank": 267,
|
|
487
|
+
"elements": {
|
|
488
|
+
"classes": 1,
|
|
489
|
+
"methods": 66,
|
|
490
|
+
"fields": 9,
|
|
491
|
+
"imports": 8,
|
|
492
|
+
"packages": 1,
|
|
493
|
+
"total": 85
|
|
494
|
+
},
|
|
495
|
+
"complexity": {
|
|
496
|
+
"total": 348,
|
|
497
|
+
"average": 5.27,
|
|
498
|
+
"max": 15
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
**Key Information:**
|
|
505
|
+
|
|
506
|
+
- File has **1419 lines** total
|
|
507
|
+
- Contains **1 class**, **66 methods**, **9 fields**, **1 package**, **total of 85 elements**
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
#### **R - Retrieve Key Code (Deep dive into specific implementation)**
|
|
512
|
+
|
|
513
|
+
**Scenario 1: View complete structure table**
|
|
514
|
+
```
|
|
515
|
+
Please generate a detailed structure table for examples/BigService.java, I want to see a list of all methods
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
**The AI will generate a Markdown table containing:**
|
|
519
|
+
|
|
520
|
+
- Class information: package name, type, visibility, line range
|
|
521
|
+
- Field list: 9 fields (DEFAULT_ENCODING, MAX_RETRY_COUNT, etc.)
|
|
522
|
+
- Constructor: BigService()
|
|
523
|
+
- Public methods: 19 (authenticateUser, createSession, generateReport, etc.)
|
|
524
|
+
- Private methods: 47 (initializeService, checkMemoryUsage, etc.)
|
|
525
|
+
|
|
526
|
+
**Scenario 2: Extract specific code snippet**
|
|
527
|
+
```
|
|
528
|
+
Please extract lines 93-106 of examples/BigService.java, I want to see the specific implementation of memory checking
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
**The AI will call** the `extract_code_section` tool and return the checkMemoryUsage method code.
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
#### **T - Trace Dependencies (Understand code relationships)**
|
|
536
|
+
|
|
537
|
+
**Scenario 1: Find all authentication-related methods**
|
|
538
|
+
```
|
|
539
|
+
Find all methods related to authentication (auth) in examples/BigService.java
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
**The AI will call query filtering** and return the authenticateUser method (lines 141-172).
|
|
543
|
+
|
|
544
|
+
**Scenario 2: Find entry point**
|
|
545
|
+
```
|
|
546
|
+
Where is the main method in this file? What does it do?
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
**The AI will locate:**
|
|
550
|
+
|
|
551
|
+
- **Location**: Lines 1385-1418
|
|
552
|
+
- **Function**: Demonstrates various features of BigService (authentication, sessions, customer management, report generation, performance monitoring, security checks)
|
|
553
|
+
|
|
554
|
+
**Scenario 3: Understand method call relationships**
|
|
555
|
+
```
|
|
556
|
+
Which methods call the authenticateUser method?
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
**The AI will search the code** and find the call in the `main` method:
|
|
560
|
+
```java
|
|
561
|
+
service.authenticateUser("testuser", "password123");
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
### 💡 SMART Workflow Best Practices
|
|
567
|
+
|
|
568
|
+
1. **Natural Language First**: Describe your needs in natural language, AI will automatically choose the appropriate tools
|
|
569
|
+
2. **Progressive Approach**: First understand the overall structure (A), then dive into specific code (R)
|
|
570
|
+
3. **Trace as Needed**: Only use tracing (T) when you need to understand complex relationships
|
|
571
|
+
4. **Combined Use**: You can combine multiple steps in one conversation
|
|
572
|
+
|
|
573
|
+
**Complete Example Conversation:**
|
|
574
|
+
```
|
|
575
|
+
I want to understand the large file examples/BigService.java:
|
|
576
|
+
1. How large is it? What main features does it contain?
|
|
577
|
+
2. How is the authentication feature implemented?
|
|
578
|
+
3. What public API methods are there?
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
The AI will automatically:
|
|
582
|
+
1. Analyze file structure (1419 lines, 66 methods)
|
|
583
|
+
2. Locate and extract the `authenticateUser` method (lines 141-172)
|
|
584
|
+
3. Generate a list of public methods (19 public methods)
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
588
|
+
### ⚡ Complete CLI Commands
|
|
589
|
+
|
|
590
|
+
#### 📊 Code Structure Analysis Commands
|
|
591
|
+
|
|
592
|
+
```bash
|
|
593
|
+
# Quick analysis (display summary information)
|
|
594
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --summary
|
|
595
|
+
|
|
596
|
+
# Detailed analysis (display complete structure)
|
|
597
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --structure
|
|
598
|
+
|
|
599
|
+
# Advanced analysis (including complexity metrics)
|
|
600
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --advanced
|
|
601
|
+
|
|
602
|
+
# Generate complete structure table
|
|
603
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --table=full
|
|
604
|
+
|
|
605
|
+
# Specify output format
|
|
606
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --advanced --output-format=json
|
|
607
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --advanced --output-format=text
|
|
608
|
+
|
|
609
|
+
# Precise code extraction
|
|
610
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --partial-read --start-line 93 --end-line 106
|
|
611
|
+
|
|
612
|
+
# Specify programming language
|
|
613
|
+
uv run python -m tree_sitter_analyzer script.py --language python --table=full
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
#### 🔍 Query and Filter Commands
|
|
617
|
+
|
|
618
|
+
```bash
|
|
619
|
+
# Query specific elements
|
|
620
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods
|
|
621
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key classes
|
|
622
|
+
|
|
623
|
+
# Filter query results
|
|
624
|
+
# Find specific method
|
|
625
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods --filter "name=main"
|
|
626
|
+
|
|
627
|
+
# Find authentication-related methods (pattern matching)
|
|
628
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods --filter "name=~auth*"
|
|
629
|
+
|
|
630
|
+
# Find public methods with no parameters (compound conditions)
|
|
631
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods --filter "params=0,public=true"
|
|
632
|
+
|
|
633
|
+
# Find static methods
|
|
634
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods --filter "static=true"
|
|
635
|
+
|
|
636
|
+
# View filter syntax help
|
|
637
|
+
uv run python -m tree_sitter_analyzer --filter-help
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
#### 📁 File System Operation Commands
|
|
641
|
+
|
|
642
|
+
```bash
|
|
643
|
+
# List files
|
|
644
|
+
uv run list-files . --extensions java
|
|
645
|
+
uv run list-files . --pattern "test_*" --extensions java --types f
|
|
646
|
+
uv run list-files . --types f --size "+1k" --changed-within "1week"
|
|
647
|
+
|
|
648
|
+
# Search content
|
|
649
|
+
uv run search-content --roots . --query "class.*extends" --include-globs "*.java"
|
|
650
|
+
uv run search-content --roots tests --query "TODO|FIXME" --context-before 2 --context-after 2
|
|
651
|
+
uv run search-content --files examples/BigService.java examples/Sample.java --query "public.*method" --case insensitive
|
|
652
|
+
|
|
653
|
+
# Two-stage search (find files first, then search content)
|
|
654
|
+
uv run find-and-grep --roots . --query "@SpringBootApplication" --extensions java
|
|
655
|
+
uv run find-and-grep --roots examples --query "import.*SQLException" --extensions java --file-limit 10 --max-count 5
|
|
656
|
+
uv run find-and-grep --roots . --query "public.*static.*void" --extensions java --types f --size "+1k" --output-format json
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
#### ℹ️ Information Query Commands
|
|
660
|
+
|
|
661
|
+
```bash
|
|
662
|
+
# View help
|
|
663
|
+
uv run python -m tree_sitter_analyzer --help
|
|
664
|
+
|
|
665
|
+
# List supported query keys
|
|
666
|
+
uv run python -m tree_sitter_analyzer --list-queries
|
|
667
|
+
|
|
668
|
+
# Display supported languages
|
|
669
|
+
uv run python -m tree_sitter_analyzer --show-supported-languages
|
|
670
|
+
|
|
671
|
+
# Display supported extensions
|
|
672
|
+
uv run python -m tree_sitter_analyzer --show-supported-extensions
|
|
673
|
+
|
|
674
|
+
# Display common queries
|
|
675
|
+
uv run python -m tree_sitter_analyzer --show-common-queries
|
|
676
|
+
|
|
677
|
+
# Display query language support
|
|
678
|
+
uv run python -m tree_sitter_analyzer --show-query-languages
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
## 🛠️ Core Features
|
|
684
|
+
|
|
685
|
+
### 📊 Code Structure Analysis
|
|
686
|
+
- Class, method, field statistics
|
|
687
|
+
- Package information and import dependencies
|
|
688
|
+
- Complexity metrics (cyclomatic complexity)
|
|
689
|
+
- Precise line number positioning
|
|
690
|
+
|
|
691
|
+
### ✂️ Intelligent Code Extraction
|
|
692
|
+
- Precise extraction by line range
|
|
693
|
+
- Preserve original formatting and indentation
|
|
694
|
+
- Include position metadata
|
|
695
|
+
- Efficient handling of large files
|
|
696
|
+
|
|
697
|
+
### 🔍 Advanced Query Filtering
|
|
698
|
+
- **Exact Match**: `--filter "name=main"`
|
|
699
|
+
- **Pattern Match**: `--filter "name=~auth*"`
|
|
700
|
+
- **Parameter Filter**: `--filter "params=2"`
|
|
701
|
+
- **Modifier Filter**: `--filter "static=true,public=true"`
|
|
702
|
+
- **Compound Conditions**: Combine multiple conditions for precise queries
|
|
703
|
+
|
|
704
|
+
### 🔗 AI Assistant Integration
|
|
705
|
+
- **Claude Desktop** - Full MCP support
|
|
706
|
+
- **Cursor IDE** - Built-in MCP integration
|
|
707
|
+
- **Roo Code** - MCP protocol support
|
|
708
|
+
- **Other MCP-compatible tools** - Universal MCP server
|
|
709
|
+
|
|
710
|
+
### 🌍 Multi-Language Support
|
|
711
|
+
- **Java** - Full support (1103 lines of plugin), including Spring, JPA frameworks
|
|
712
|
+
- **Python** - Full support (584 lines of plugin), including type annotations, decorators
|
|
713
|
+
- **JavaScript** - Enterprise-grade support (1445 lines of plugin), including ES6+, React/Vue/Angular, JSX
|
|
714
|
+
- **TypeScript** - Query support (230 lines of queries), including interfaces, types, decorators
|
|
715
|
+
- **C/C++, Rust, Go** - Basic support
|
|
716
|
+
|
|
717
|
+
### 📁 Advanced File Search
|
|
718
|
+
Powerful file discovery and content search based on fd and ripgrep:
|
|
719
|
+
- **ListFilesTool** - Intelligent file discovery with multiple filtering conditions
|
|
720
|
+
- **SearchContentTool** - Intelligent content search with regular expressions
|
|
721
|
+
- **FindAndGrepTool** - Combined discovery and search, two-stage workflow
|
|
722
|
+
|
|
723
|
+
### 🏗️ Unified Element System
|
|
724
|
+
- **Single Element List** - Unified management of all code elements (classes, methods, fields, imports, packages)
|
|
725
|
+
- **Consistent Element Types** - Each element has an `element_type` attribute
|
|
726
|
+
- **Simplified API** - Clearer interfaces and reduced complexity
|
|
727
|
+
- **Better Maintainability** - Single source of truth for all code elements
|
|
728
|
+
|
|
729
|
+
---
|
|
730
|
+
|
|
731
|
+
## 🏆 Quality Assurance
|
|
732
|
+
|
|
733
|
+
### 📊 Quality Metrics
|
|
734
|
+
- **1,893 Tests** - 100% pass rate ✅
|
|
735
|
+
- **71.48% Code Coverage** - Comprehensive test suite
|
|
736
|
+
- **Zero Test Failures** - Production ready
|
|
737
|
+
- **Cross-Platform Support** - Windows, macOS, Linux
|
|
738
|
+
|
|
739
|
+
### ⚡ Latest Quality Achievements (v1.6.0)
|
|
740
|
+
- ✅ **Cross-Platform Path Compatibility** - Fixed Windows short path names and macOS symlink differences
|
|
741
|
+
- ✅ **Enterprise-Grade Reliability** - 50+ comprehensive test cases ensure stability
|
|
742
|
+
- ✅ **GitFlow Implementation** - Professional development/release branch strategy
|
|
743
|
+
- ✅ **AI Collaboration Optimization** - Specialized quality control for AI-assisted development
|
|
744
|
+
|
|
745
|
+
### ⚙️ Running Tests
|
|
746
|
+
```bash
|
|
747
|
+
# Run all tests
|
|
748
|
+
uv run pytest tests/ -v
|
|
749
|
+
|
|
750
|
+
# Generate coverage report
|
|
751
|
+
uv run pytest tests/ --cov=tree_sitter_analyzer --cov-report=html --cov-report=term-missing
|
|
752
|
+
|
|
753
|
+
# Run specific tests
|
|
754
|
+
uv run pytest tests/test_mcp_server_initialization.py -v
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
### 📈 Test Coverage Details
|
|
758
|
+
|
|
759
|
+
**Core Modules:**
|
|
760
|
+
- **Language Detector**: 98.41% (Excellent) - Automatic programming language recognition
|
|
761
|
+
- **CLI Main Entry**: 94.36% (Excellent) - Command-line interface
|
|
762
|
+
- **Query Filter System**: 96.06% (Excellent) - Code query and filtering
|
|
763
|
+
- **Query Service**: 86.25% (Good) - Query execution engine
|
|
764
|
+
- **MCP Error Handling**: 82.76% (Good) - AI assistant integration error handling
|
|
765
|
+
|
|
766
|
+
**Language Plugins:**
|
|
767
|
+
- **Java Plugin**: 73.00% (Good) - 1103 lines of code, full enterprise-grade support
|
|
768
|
+
- **JavaScript Plugin**: 68.31% (Good) - 1445 lines of code, modern ES6+ feature support
|
|
769
|
+
- **Python Plugin**: 63.26% (Good) - 584 lines of code, full type annotation support
|
|
770
|
+
|
|
771
|
+
**MCP Tools:**
|
|
772
|
+
- **File Search Tool**: 88.77% (Excellent) - fd/ripgrep integration
|
|
773
|
+
- **Content Search Tool**: 92.70% (Excellent) - Regular expression search
|
|
774
|
+
- **Combined Search Tool**: 91.57% (Excellent) - Two-stage search
|
|
775
|
+
|
|
776
|
+
### ✅ Documentation Verification Status
|
|
777
|
+
|
|
778
|
+
**All content in this README has been verified:**
|
|
779
|
+
- ✅ **All Commands Tested** - Every CLI command has been run and verified in a real environment
|
|
780
|
+
- ✅ **All Data Authentic** - Coverage rates, test counts, and other data come directly from test reports
|
|
781
|
+
- ✅ **SMART Workflow Authentic** - Demonstrated based on actual BigService.java (1419 lines)
|
|
782
|
+
- ✅ **Cross-Platform Verified** - Tested on Windows, macOS, Linux environments
|
|
783
|
+
|
|
784
|
+
**Verification Environment:**
|
|
785
|
+
- Operating Systems: Windows 10, macOS, Linux
|
|
786
|
+
- Python Version: 3.10+
|
|
787
|
+
- Project Version: tree-sitter-analyzer v1.6.0
|
|
788
|
+
- Test Files: BigService.java (1419 lines), sample.py (256 lines), MultiClass.java (54 lines)
|
|
789
|
+
|
|
790
|
+
---
|
|
791
|
+
|
|
792
|
+
## 📚 Documentation & Support
|
|
793
|
+
|
|
794
|
+
### 📖 Complete Documentation
|
|
795
|
+
- **[User MCP Setup Guide](MCP_SETUP_USERS.md)** - Simple configuration guide
|
|
796
|
+
- **[Developer MCP Setup Guide](MCP_SETUP_DEVELOPERS.md)** - Local development configuration
|
|
797
|
+
- **[Project Root Configuration](PROJECT_ROOT_CONFIG.md)** - Complete configuration reference
|
|
798
|
+
- **[API Documentation](docs/api.md)** - Detailed API reference
|
|
799
|
+
- **[Contributing Guide](CONTRIBUTING.md)** - How to contribute code
|
|
800
|
+
- **[Onboarding & Training Guide](training/README.md)** - System onboarding materials for new members/maintainers
|
|
801
|
+
|
|
802
|
+
### 🤖 AI Collaboration Support
|
|
803
|
+
This project supports AI-assisted development with specialized quality control:
|
|
804
|
+
|
|
805
|
+
```bash
|
|
806
|
+
# Pre-generation checks for AI systems
|
|
807
|
+
uv run python check_quality.py --new-code-only
|
|
808
|
+
uv run python llm_code_checker.py --check-all
|
|
809
|
+
```
|
|
810
|
+
|
|
811
|
+
📖 **Detailed Guides**:
|
|
812
|
+
- [AI Collaboration Guide](AI_COLLABORATION_GUIDE.md)
|
|
813
|
+
- [LLM Coding Guidelines](LLM_CODING_GUIDELINES.md)
|
|
814
|
+
|
|
815
|
+
### 💝 Sponsors & Acknowledgments
|
|
816
|
+
|
|
817
|
+
**[@o93](https://github.com/o93)** - *Primary Sponsor & Supporter*
|
|
818
|
+
- 🚀 **MCP Tool Enhancement**: Sponsored comprehensive MCP fd/ripgrep tool development
|
|
819
|
+
- 🧪 **Test Infrastructure**: Implemented enterprise-grade test coverage (50+ comprehensive test cases)
|
|
820
|
+
- 🔧 **Quality Assurance**: Supported bug fixes and performance improvements
|
|
821
|
+
- 💡 **Innovation Support**: Enabled early release of advanced file search and content analysis features
|
|
822
|
+
|
|
823
|
+
**[💖 Sponsor this project](https://github.com/sponsors/aimasteracc)** to help us continue building excellent tools for the developer community!
|
|
824
|
+
|
|
825
|
+
---
|
|
826
|
+
|
|
827
|
+
## 🤝 Contributing & License
|
|
828
|
+
|
|
829
|
+
### 🤝 Contributing Guide
|
|
830
|
+
|
|
831
|
+
We welcome contributions of all kinds! Please check the [Contributing Guide](CONTRIBUTING.md) for details.
|
|
832
|
+
|
|
833
|
+
### ⭐ Give us a Star!
|
|
834
|
+
|
|
835
|
+
If this project helps you, please give us a ⭐ on GitHub - it's the greatest support for us!
|
|
836
|
+
|
|
837
|
+
### 📄 License
|
|
838
|
+
|
|
839
|
+
MIT License - See [LICENSE](LICENSE) file for details.
|
|
840
|
+
|
|
841
|
+
---
|
|
842
|
+
|
|
843
|
+
**🎯 Built for developers handling large codebases and AI assistants**
|
|
844
|
+
|
|
845
|
+
*Let every line of code be understood by AI, let every project break through token limits*
|