Skip to content

Commit f4bd321

Browse files
authored
Merge pull request #32 from johnhuang316/refactor_indx
Refactor indx
2 parents dee1eef + 0c5c001 commit f4bd321

File tree

93 files changed

+3913
-19438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3913
-19438
lines changed

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The easiest way to get started with any MCP-compatible application:
4444

4545
2. **Restart your application**`uvx` automatically handles installation and execution
4646

47-
3. **Start using**:
47+
3. **Start using** (give these prompts to your AI assistant):
4848
```
4949
Set the project path to /Users/dev/my-react-app
5050
Find all TypeScript files in this project
@@ -62,13 +62,16 @@ The easiest way to get started with any MCP-compatible application:
6262
## Key Features
6363

6464
### 🔍 **Intelligent Search & Analysis**
65-
- **SCIP-Powered**: Industry-standard code intelligence format used by major IDEs
65+
- **Dual-Strategy Architecture**: Specialized tree-sitter parsing for 7 core languages, fallback strategy for 50+ file types
66+
- **Direct Tree-sitter Integration**: No regex fallbacks for specialized languages - fail fast with clear errors
6667
- **Advanced Search**: Auto-detects and uses the best available tool (ugrep, ripgrep, ag, or grep)
67-
- **Universal Understanding**: Single system comprehends all programming languages
68+
- **Universal File Support**: Comprehensive coverage from advanced AST parsing to basic file indexing
6869
- **File Analysis**: Deep insights into structure, imports, classes, methods, and complexity metrics
6970

7071
### 🗂️ **Multi-Language Support**
71-
- **50+ File Types**: Java, Python, JavaScript/TypeScript, C/C++, Go, Rust, C#, Swift, Kotlin, Ruby, PHP, and more
72+
- **7 Languages with Tree-sitter AST Parsing**: Python, JavaScript, TypeScript, Java, Go, Objective-C, Zig
73+
- **50+ File Types with Fallback Strategy**: C/C++, Rust, Ruby, PHP, and all other programming languages
74+
- **Document & Config Files**: Markdown, JSON, YAML, XML with appropriate handling
7275
- **Web Frontend**: Vue, React, Svelte, HTML, CSS, SCSS
7376
- **Database**: SQL variants, NoSQL, stored procedures, migrations
7477
- **Configuration**: JSON, YAML, XML, Markdown
@@ -81,36 +84,32 @@ The easiest way to get started with any MCP-compatible application:
8184
- **Rich Metadata**: Captures symbols, references, definitions, and relationships
8285

8386
### **Performance & Efficiency**
84-
- **SCIP Indexing**: Fast protobuf-based unified indexing system
87+
- **Tree-sitter AST Parsing**: Native syntax parsing for accurate symbol extraction
8588
- **Persistent Caching**: Stores indexes for lightning-fast subsequent access
8689
- **Smart Filtering**: Intelligent exclusion of build directories and temporary files
8790
- **Memory Efficient**: Optimized for large codebases
91+
- **Direct Dependencies**: No fallback mechanisms - fail fast with clear error messages
8892

8993
## Supported File Types
9094

9195
<details>
9296
<summary><strong>📁 Programming Languages (Click to expand)</strong></summary>
9397

94-
**System & Low-Level:**
95-
- C/C++ (`.c`, `.cpp`, `.h`, `.hpp`)
96-
- Rust (`.rs`)
97-
- Zig (`.zig`, `.zon`)
98-
- Go (`.go`)
99-
100-
**Object-Oriented:**
101-
- Java (`.java`)
102-
- C# (`.cs`)
103-
- Kotlin (`.kt`)
104-
- Scala (`.scala`)
105-
- Objective-C/C++ (`.m`, `.mm`)
106-
- Swift (`.swift`)
107-
108-
**Scripting & Dynamic:**
109-
- Python (`.py`)
110-
- JavaScript/TypeScript (`.js`, `.ts`, `.jsx`, `.tsx`, `.mjs`, `.cjs`)
111-
- Ruby (`.rb`)
112-
- PHP (`.php`)
113-
- Shell (`.sh`, `.bash`)
98+
**Languages with Specialized Tree-sitter Strategies:**
99+
- **Python** (`.py`, `.pyw`) - Full AST analysis with class/method extraction and call tracking
100+
- **JavaScript** (`.js`, `.jsx`, `.mjs`, `.cjs`) - ES6+ class and function parsing with tree-sitter
101+
- **TypeScript** (`.ts`, `.tsx`) - Complete type-aware symbol extraction with interfaces
102+
- **Java** (`.java`) - Full class hierarchy, method signatures, and call relationships
103+
- **Go** (`.go`) - Struct methods, receiver types, and function analysis
104+
- **Objective-C** (`.m`, `.mm`) - Class/instance method distinction with +/- notation
105+
- **Zig** (`.zig`, `.zon`) - Function and struct parsing with tree-sitter AST
106+
107+
**All Other Programming Languages:**
108+
All other programming languages use the **FallbackParsingStrategy** which provides basic file indexing and metadata extraction. This includes:
109+
- **System & Low-Level:** C/C++ (`.c`, `.cpp`, `.h`, `.hpp`), Rust (`.rs`)
110+
- **Object-Oriented:** C# (`.cs`), Kotlin (`.kt`), Scala (`.scala`), Swift (`.swift`)
111+
- **Scripting & Dynamic:** Ruby (`.rb`), PHP (`.php`), Shell (`.sh`, `.bash`)
112+
- **And 40+ more file types** - All handled through the fallback strategy for basic indexing
114113

115114
</details>
116115

@@ -212,6 +211,7 @@ Then configure:
212211

213212
</details>
214213

214+
215215
## Available Tools
216216

217217
### 🏗️ **Project Management**

README_ja.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Code Index MCPは、AIモデルと複雑なコードベースの橋渡しをす
4444

4545
2. **アプリケーションを再起動**`uvx`がインストールと実行を自動処理
4646

47-
3. **使用開始**
47+
3. **使用開始**(AIアシスタントにこれらのプロンプトを与える)
4848
```
4949
プロジェクトパスを/Users/dev/my-react-appに設定
5050
このプロジェクトのすべてのTypeScriptファイルを検索
@@ -62,13 +62,16 @@ Code Index MCPは、AIモデルと複雑なコードベースの橋渡しをす
6262
## 主な機能
6363

6464
### 🔍 **インテリジェント検索・解析**
65-
- **SCIPパワー**:主要IDEで使用される業界標準コードインテリジェンスフォーマット
65+
- **二重戦略アーキテクチャ**:7つのコア言語に特化したTree-sitter解析、50+ファイルタイプにフォールバック戦略
66+
- **直接Tree-sitter統合**:特化言語で正規表現フォールバックなし - 明確なエラーメッセージで高速フェイル
6667
- **高度な検索**:最適なツール(ugrep、ripgrep、ag、grep)を自動検出・使用
67-
- **汎用理解**単一システムですべてのプログラミング言語を理解
68+
- **汎用ファイルサポート**高度なAST解析から基本ファイルインデックスまでの包括的カバレッジ
6869
- **ファイル解析**:構造、インポート、クラス、メソッド、複雑度メトリクスへの深い洞察
6970

7071
### 🗂️ **多言語サポート**
71-
- **50+ファイルタイプ**:Java、Python、JavaScript/TypeScript、C/C++、Go、Rust、C#、Swift、Kotlin、Ruby、PHPなど
72+
- **7言語でTree-sitter AST解析**:Python、JavaScript、TypeScript、Java、Go、Objective-C、Zig
73+
- **50+ファイルタイプでフォールバック戦略**:C/C++、Rust、Ruby、PHPおよびすべての他のプログラミング言語
74+
- **文書・設定ファイル**:Markdown、JSON、YAML、XML適切な処理
7275
- **Webフロントエンド**:Vue、React、Svelte、HTML、CSS、SCSS
7376
- **データベース**:SQLバリアント、NoSQL、ストアドプロシージャ、マイグレーション
7477
- **設定ファイル**:JSON、YAML、XML、Markdown
@@ -81,36 +84,32 @@ Code Index MCPは、AIモデルと複雑なコードベースの橋渡しをす
8184
- **豊富なメタデータ**:シンボル、参照、定義、関連性をキャプチャ
8285

8386
### **パフォーマンス・効率性**
84-
- **スマートインデックス作成**ビルドディレクトリをインテリジェントにフィルタリングしながら再帰的スキャン
87+
- **Tree-sitter AST解析**正確なシンボル抽出のためのネイティブ構文解析
8588
- **永続キャッシュ**:超高速な後続アクセスのためのインデックス保存
86-
- **遅延ロード**:最適化された起動のため必要時のみツール検出
87-
- **メモリ効率**:大規模コードベース向けのインテリジェントキャッシュ戦略
89+
- **スマートフィルタリング**:ビルドディレクトリと一時ファイルのインテリジェント除外
90+
- **メモリ効率**:大規模コードベース向けに最適化
91+
- **直接依存関係**:フォールバック機構なし - 明確なエラーメッセージで高速フェイル
8892

8993
## サポートされているファイルタイプ
9094

9195
<details>
9296
<summary><strong>📁 プログラミング言語(クリックで展開)</strong></summary>
9397

94-
**システム・低レベル言語:**
95-
- C/C++ (`.c`, `.cpp`, `.h`, `.hpp`)
96-
- Rust (`.rs`)
97-
- Zig (`.zig`)
98-
- Go (`.go`)
99-
100-
**オブジェクト指向言語:**
101-
- Java (`.java`)
102-
- C# (`.cs`)
103-
- Kotlin (`.kt`)
104-
- Scala (`.scala`)
105-
- Objective-C/C++ (`.m`, `.mm`)
106-
- Swift (`.swift`)
107-
108-
**スクリプト・動的言語:**
109-
- Python (`.py`)
110-
- JavaScript/TypeScript (`.js`, `.ts`, `.jsx`, `.tsx`, `.mjs`, `.cjs`)
111-
- Ruby (`.rb`)
112-
- PHP (`.php`)
113-
- Shell (`.sh`, `.bash`)
98+
**特化Tree-sitter戦略言語:**
99+
- **Python** (`.py`, `.pyw`) - クラス/メソッド抽出と呼び出し追跡を含む完全AST解析
100+
- **JavaScript** (`.js`, `.jsx`, `.mjs`, `.cjs`) - Tree-sitterを使用したES6+クラスと関数解析
101+
- **TypeScript** (`.ts`, `.tsx`) - インターフェースを含む完全な型認識シンボル抽出
102+
- **Java** (`.java`) - 完全なクラス階層、メソッドシグネチャ、呼び出し関係
103+
- **Go** (`.go`) - 構造体メソッド、レシーバータイプ、関数解析
104+
- **Objective-C** (`.m`, `.mm`) - +/-記法を使用したクラス/インスタンスメソッド区別
105+
- **Zig** (`.zig`, `.zon`) - Tree-sitter ASTを使用した関数と構造体解析
106+
107+
**すべての他のプログラミング言語:**
108+
すべての他のプログラミング言語は**フォールバック解析戦略**を使用し、基本ファイルインデックスとメタデータ抽出を提供します。これには以下が含まれます:
109+
- **システム・低レベル言語:** C/C++ (`.c`, `.cpp`, `.h`, `.hpp`)、Rust (`.rs`)
110+
- **オブジェクト指向言語:** C# (`.cs`)、Kotlin (`.kt`)、Scala (`.scala`)、Swift (`.swift`)
111+
- **スクリプト・動的言語:** Ruby (`.rb`)、PHP (`.php`)、Shell (`.sh`, `.bash`)
112+
- **および40+ファイルタイプ** - すべてフォールバック戦略による基本インデックス処理
114113

115114
</details>
116115

@@ -234,6 +233,7 @@ pip install code-index-mcp
234233

235234
</details>
236235

236+
237237
## 利用可能なツール
238238

239239
### 🏗️ **プロジェクト管理**

README_zh.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
2. **重新啟動應用程式**`uvx` 會自動處理安裝和執行
4646

47-
3. **開始使用**
47+
3. **開始使用**(向您的 AI 助理提供這些提示)
4848
```
4949
設定專案路徑為 /Users/dev/my-react-app
5050
在這個專案中找到所有 TypeScript 檔案
@@ -62,13 +62,16 @@
6262
## 主要特性
6363

6464
### 🔍 **智慧搜尋與分析**
65-
- **SCIP 驅動**:業界標準程式碼智能格式,被主流 IDE 採用
65+
- **雙策略架構**:7 種核心語言使用專業化 Tree-sitter 解析,50+ 種檔案類型使用備用策略
66+
- **直接 Tree-sitter 整合**:專業化語言無正則表達式備用 - 快速失敗並提供清晰錯誤訊息
6667
- **進階搜尋**:自動偵測並使用最佳工具(ugrep、ripgrep、ag 或 grep)
67-
- **通用理解**單一系統理解所有程式語言
68+
- **通用檔案支援**從進階 AST 解析到基本檔案索引的全面覆蓋
6869
- **檔案分析**:深入了解結構、匯入、類別、方法和複雜度指標
6970

7071
### 🗂️ **多語言支援**
71-
- **50+ 種檔案類型**:Java、Python、JavaScript/TypeScript、C/C++、Go、Rust、C#、Swift、Kotlin、Ruby、PHP 等
72+
- **7 種語言使用 Tree-sitter AST 解析**:Python、JavaScript、TypeScript、Java、Go、Objective-C、Zig
73+
- **50+ 種檔案類型使用備用策略**:C/C++、Rust、Ruby、PHP 和所有其他程式語言
74+
- **文件與配置檔案**:Markdown、JSON、YAML、XML 適當處理
7275
- **網頁前端**:Vue、React、Svelte、HTML、CSS、SCSS
7376
- **資料庫**:SQL 變體、NoSQL、存儲過程、遷移腳本
7477
- **配置檔案**:JSON、YAML、XML、Markdown
@@ -81,36 +84,32 @@
8184
- **豐富元資料**:捕獲符號、引用、定義和關聯性
8285

8386
### **效能與效率**
84-
- **智慧索引**遞迴掃描並智慧篩選建構目錄
87+
- **Tree-sitter AST 解析**原生語法解析以實現準確的符號提取
8588
- **持久快取**:儲存索引以實現超快速的後續存取
86-
- **延遲載入**:僅在需要時偵測工具以優化啟動速度
87-
- **記憶體高效**:針對大型程式碼庫的智慧快取策略
89+
- **智慧篩選**:智能排除建構目錄和暫存檔案
90+
- **記憶體高效**:針對大型程式碼庫優化
91+
- **直接依賴**:無備用機制 - 快速失敗並提供清晰錯誤訊息
8892

8993
## 支援的檔案類型
9094

9195
<details>
9296
<summary><strong>📁 程式語言(點擊展開)</strong></summary>
9397

94-
**系統與低階語言:**
95-
- C/C++ (`.c`, `.cpp`, `.h`, `.hpp`)
96-
- Rust (`.rs`)
97-
- Zig (`.zig`)
98-
- Go (`.go`)
99-
100-
**物件導向語言:**
101-
- Java (`.java`)
102-
- C# (`.cs`)
103-
- Kotlin (`.kt`)
104-
- Scala (`.scala`)
105-
- Objective-C/C++ (`.m`, `.mm`)
106-
- Swift (`.swift`)
107-
108-
**腳本與動態語言:**
109-
- Python (`.py`)
110-
- JavaScript/TypeScript (`.js`, `.ts`, `.jsx`, `.tsx`, `.mjs`, `.cjs`)
111-
- Ruby (`.rb`)
112-
- PHP (`.php`)
113-
- Shell (`.sh`, `.bash`)
98+
**專業化 Tree-sitter 策略語言:**
99+
- **Python** (`.py`, `.pyw`) - 完整 AST 分析,包含類別/方法提取和呼叫追蹤
100+
- **JavaScript** (`.js`, `.jsx`, `.mjs`, `.cjs`) - ES6+ 類別和函數解析使用 Tree-sitter
101+
- **TypeScript** (`.ts`, `.tsx`) - 完整類型感知符號提取,包含介面
102+
- **Java** (`.java`) - 完整類別階層、方法簽名和呼叫關係
103+
- **Go** (`.go`) - 結構方法、接收者類型和函數分析
104+
- **Objective-C** (`.m`, `.mm`) - 類別/實例方法區分,使用 +/- 標記法
105+
- **Zig** (`.zig`, `.zon`) - 函數和結構解析使用 Tree-sitter AST
106+
107+
**所有其他程式語言:**
108+
所有其他程式語言使用 **備用解析策略**,提供基本檔案索引和元資料提取。包括:
109+
- **系統與低階語言:** C/C++ (`.c`, `.cpp`, `.h`, `.hpp`)、Rust (`.rs`)
110+
- **物件導向語言:** C# (`.cs`)、Kotlin (`.kt`)、Scala (`.scala`)、Swift (`.swift`)
111+
- **腳本與動態語言:** Ruby (`.rb`)、PHP (`.php`)、Shell (`.sh`, `.bash`)
112+
- **以及 40+ 種檔案類型** - 全部通過備用策略處理進行基本索引
114113

115114
</details>
116115

@@ -234,6 +233,7 @@ pip install code-index-mcp
234233

235234
</details>
236235

236+
237237
## 可用工具
238238

239239
### 🏗️ **專案管理**

0 commit comments

Comments
 (0)