Skip to content

Commit 7f177ee

Browse files
committed
Merge PR #9: add HCL/Terraform language support
2 parents 98412f0 + 677556c commit 7f177ee

15 files changed

Lines changed: 213 additions & 9 deletions

File tree

.claude/CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
MCP Server für persistentes Code-Indexing. Ermöglicht Claude Code schnelle, präzise Suchen statt Grep/Glob.
44

5-
**Version:** 1.17.0 | **Sprachen:** 11 | **Repo:** https://github.com/CSCSoftware/AiDex
5+
**Version:** 1.17.0 | **Sprachen:** 12 | **Repo:** https://github.com/CSCSoftware/AiDex
66

77
## Build & Run
88

@@ -106,7 +106,7 @@ Actions: `init` (Server starten) → `query` (Logs abfragen) → `free` (Server
106106

107107
## Sprachen
108108

109-
C# · TypeScript · JavaScript · Rust · Python · C · C++ · Java · Go · PHP · Ruby
109+
C# · TypeScript · JavaScript · Rust · Python · C · C++ · Java · Go · PHP · Ruby · HCL/Terraform
110110

111111
## Architektur
112112

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to AiDex will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
- **HCL/Terraform support**: Indexes `.tf`, `.tfvars`, and `.hcl` files
9+
- Blocks (`resource`, `module`, `variable`, `output`, `data`, `locals`, `provider`, ...) → types with dotted names (e.g. `resource.aws_instance.web`)
10+
- Function calls → methods
11+
- Attributes → properties
12+
- Uses `@tree-sitter-grammars/tree-sitter-hcl` grammar
13+
714
### Changed
815
- **tree-sitter upgrade**: Bumped `tree-sitter` from 0.21 to 0.25 and all grammar packages to latest — enables support for newer grammar packages requiring tree-sitter ^0.25.0
916

MCP-API-REFERENCE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,7 @@ Used by `aidex_query` parameters `modified_since` and `modified_before`:
11671167
| Go | `.go` | tree-sitter-go |
11681168
| PHP | `.php` | tree-sitter-php |
11691169
| Ruby | `.rb`, `.rake` | tree-sitter-ruby |
1170+
| HCL/Terraform | `.tf`, `.tfvars`, `.hcl` | @tree-sitter-grammars/tree-sitter-hcl |
11701171

11711172
---
11721173

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ AiDex is an MCP server that gives AI coding assistants instant access to your en
3535
| **Screenshots** | `screenshot`, `windows` | Cross-platform screen capture with LLM optimization — scale + color reduction saves up to 95% tokens |
3636
| **Viewer** | `viewer` | Interactive browser UI with file tree, signatures, tasks, logs, and live reload |
3737

38-
**11 languages** — C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby
38+
**12 languages** — C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby, HCL/Terraform
3939

4040
<details>
4141
<summary><strong>Quick Examples</strong> — see it in action</summary>
@@ -181,6 +181,7 @@ The index lives in `.aidex/index.db` (SQLite) - fast, portable, no external depe
181181
| Go | `.go` |
182182
| PHP | `.php` |
183183
| Ruby | `.rb`, `.rake` |
184+
| HCL/Terraform | `.tf`, `.tfvars`, `.hcl` |
184185

185186
## Quick Start
186187

@@ -327,7 +328,7 @@ Do I want to search code?
327328
| Screenshots | `aidex_screenshot`, `aidex_windows` | Screen capture with LLM optimization (scale + color reduction, no index needed) |
328329
| Viewer | `aidex_viewer` | Interactive browser UI with file tree, signatures, tasks, and live logs |
329330
330-
**11 languages:** C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby
331+
**12 languages:** C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby, HCL/Terraform
331332
332333
### Session Notes
333334

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"license": "MIT",
6363
"dependencies": {
6464
"@modelcontextprotocol/sdk": "^1.0.0",
65+
"@tree-sitter-grammars/tree-sitter-hcl": "^1.2.0",
6566
"better-sqlite3": "^11.0.0",
6667
"chokidar": "^5.0.0",
6768
"express": "^4.22.1",

src/commands/global/global-init.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ const PROJECT_MARKERS = [
9090
'composer.json',
9191
// C/C++
9292
'CMakeLists.txt', 'Makefile', 'meson.build',
93+
// HCL/Terraform
94+
'*.tf', '.terraform.lock.hcl',
9395
];
9496

9597
/** Glob-style markers that need directory listing (e.g., *.sln) */
@@ -416,6 +418,7 @@ const CODE_EXTS = new Set([
416418
'.cs', '.rs', '.py', '.pyw',
417419
'.c', '.h', '.cpp', '.cc', '.cxx', '.hpp', '.hxx',
418420
'.java', '.go', '.php', '.rb', '.rake',
421+
'.tf', '.tfvars', '.hcl',
419422
]);
420423

421424
function estimateFileCount(dirPath: string): number {

src/commands/init.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export const DEFAULT_EXCLUDE = [
8787
'**/.next/**', // Next.js
8888
'**/coverage/**', // Test coverage
8989
'**/tmp/**', // Ruby, temp files
90+
'**/.terraform/**', // Terraform downloaded modules + state cache
9091
// Generated files
9192
'**/*.min.js',
9293
'**/*.generated.*',
@@ -127,7 +128,8 @@ const CODE_EXTENSIONS = new Set([
127128
'.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs',
128129
'.cs', '.rs', '.py', '.pyw',
129130
'.c', '.h', '.cpp', '.cc', '.cxx', '.hpp', '.hxx',
130-
'.java', '.go', '.php', '.rb', '.rake'
131+
'.java', '.go', '.php', '.rb', '.rake',
132+
'.tf', '.tfvars', '.hcl',
131133
]);
132134

133135
const CONFIG_EXTENSIONS = new Set([

src/commands/summary.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ function detectLanguages(queries: ReturnType<typeof createQueries>): string[] {
234234
'.go': 'Go',
235235
'.php': 'PHP',
236236
'.rb': 'Ruby',
237+
'.tf': 'HCL/Terraform',
238+
'.tfvars': 'HCL/Terraform',
239+
'.hcl': 'HCL/Terraform',
237240
};
238241

239242
const languages = new Set<string>();

src/db/global-database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ export function readProjectStats(projectPath: string): ProjectStats | null {
482482
'.rs': 'Rust', '.py': 'Python', '.pyw': 'Python',
483483
'.c': 'C', '.h': 'C', '.cpp': 'C++', '.cc': 'C++', '.cxx': 'C++', '.hpp': 'C++', '.hxx': 'C++',
484484
'.java': 'Java', '.go': 'Go', '.php': 'PHP', '.rb': 'Ruby', '.rake': 'Ruby',
485+
'.tf': 'HCL/Terraform', '.tfvars': 'HCL/Terraform', '.hcl': 'HCL/Terraform',
485486
};
486487

487488
const languages = [...new Set(

0 commit comments

Comments
 (0)