grepai-languages
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGrepAI Supported Languages
GrepAI支持的编程语言
This skill covers the programming languages supported by GrepAI for indexing and call graph analysis.
此技能涵盖GrepAI用于索引和调用图分析的编程语言。
When to Use This Skill
何时使用此技能
- Checking if your language is supported
- Configuring language-specific settings
- Understanding trace capabilities per language
- Troubleshooting language-related issues
- 检查你的语言是否受支持
- 配置特定语言的设置
- 了解各语言的追踪能力
- 排查与语言相关的问题
Supported Languages Overview
支持的编程语言概述
GrepAI supports indexing for all text-based files, but has enhanced support for specific programming languages.
GrepAI支持对所有基于文本的文件进行索引,但对特定编程语言有增强支持。
Full Support (Index + Trace)
完全支持(索引+追踪)
| Language | Extensions | Index | Trace |
|---|---|---|---|
| Go | | ✅ | ✅ |
| JavaScript | | ✅ | ✅ |
| TypeScript | | ✅ | ✅ |
| Python | | ✅ | ✅ |
| PHP | | ✅ | ✅ |
| C | | ✅ | ✅ |
| C++ | | ✅ | ✅ |
| Rust | | ✅ | ✅ |
| Zig | | ✅ | ✅ |
| C# | | ✅ | ✅ |
| Java | | ✅ | ✅ |
| Pascal/Delphi | | ✅ | ✅ |
| 语言 | 扩展名 | 索引 | 追踪 |
|---|---|---|---|
| Go | | ✅ | ✅ |
| JavaScript | | ✅ | ✅ |
| TypeScript | | ✅ | ✅ |
| Python | | ✅ | ✅ |
| PHP | | ✅ | ✅ |
| C | | ✅ | ✅ |
| C++ | | ✅ | ✅ |
| Rust | | ✅ | ✅ |
| Zig | | ✅ | ✅ |
| C# | | ✅ | ✅ |
| Java | | ✅ | ✅ |
| Pascal/Delphi | | ✅ | ✅ |
Index Only (No Trace)
仅索引(无追踪)
| Language | Extensions | Index | Trace |
|---|---|---|---|
| Ruby | | ✅ | ❌ |
| Swift | | ✅ | ❌ |
| Kotlin | | ✅ | ❌ |
| Scala | | ✅ | ❌ |
| Lua | | ✅ | ❌ |
| Shell | | ✅ | ❌ |
| SQL | | ✅ | ❌ |
| HTML | | ✅ | ❌ |
| CSS | | ✅ | ❌ |
| Markdown | | ✅ | ❌ |
| YAML | | ✅ | ❌ |
| JSON | | ✅ | ❌ |
| TOML | | ✅ | ❌ |
| XML | | ✅ | ❌ |
| 语言 | 扩展名 | 索引 | 追踪 |
|---|---|---|---|
| Ruby | | ✅ | ❌ |
| Swift | | ✅ | ❌ |
| Kotlin | | ✅ | ❌ |
| Scala | | ✅ | ❌ |
| Lua | | ✅ | ❌ |
| Shell | | ✅ | ❌ |
| SQL | | ✅ | ❌ |
| HTML | | ✅ | ❌ |
| CSS | | ✅ | ❌ |
| Markdown | | ✅ | ❌ |
| YAML | | ✅ | ❌ |
| JSON | | ✅ | ❌ |
| TOML | | ✅ | ❌ |
| XML | | ✅ | ❌ |
Language Configuration
语言配置
Enabling/Disabling Languages for Trace
启用/禁用追踪语言
yaml
undefinedyaml
undefined.grepai/config.yaml
.grepai/config.yaml
trace:
enabled_languages:
- .go
- .js
- .ts
- .jsx
- .tsx
- .py
- .php
- .rs
- .c
- .cpp
- .cs
- .java
undefinedtrace:
enabled_languages:
- .go
- .js
- .ts
- .jsx
- .tsx
- .py
- .php
- .rs
- .c
- .cpp
- .cs
- .java
undefinedExcluding Certain Extensions
排除特定扩展名
yaml
trace:
enabled_languages:
- .go
# Exclude JavaScript intentionally
# - .js
exclude_patterns:
- "*_test.go"
- "*.spec.ts"yaml
trace:
enabled_languages:
- .go
# 有意排除JavaScript
# - .js
exclude_patterns:
- "*_test.go"
- "*.spec.ts"Language-Specific Tips
特定语言提示
Go
Go
yaml
trace:
enabled_languages:
- .go
exclude_patterns:
- "*_test.go"
- "mock_*.go"
- "*_mock.go"Trace accuracy: Excellent. Go's explicit syntax makes tracing very reliable.
yaml
trace:
enabled_languages:
- .go
exclude_patterns:
- "*_test.go"
- "mock_*.go"
- "*_mock.go"追踪准确性: 极佳。Go的显式语法使追踪非常可靠。
JavaScript/TypeScript
JavaScript/TypeScript
yaml
trace:
enabled_languages:
- .js
- .jsx
- .ts
- .tsx
exclude_patterns:
- "*.test.js"
- "*.spec.ts"
- "*.d.ts" # Type declarationsTrace accuracy: Good. Some dynamic patterns may be missed.
yaml
trace:
enabled_languages:
- .js
- .jsx
- .ts
- .tsx
exclude_patterns:
- "*.test.js"
- "*.spec.ts"
- "*.d.ts" # 类型声明追踪准确性: 良好。某些动态模式可能会被遗漏。
Python
Python
yaml
trace:
enabled_languages:
- .py
exclude_patterns:
- "test_*.py"
- "*_test.py"
- "conftest.py"Trace accuracy: Good. Dynamic imports and decorators may be missed.
yaml
trace:
enabled_languages:
- .py
exclude_patterns:
- "test_*.py"
- "*_test.py"
- "conftest.py"追踪准确性: 良好。动态导入和装饰器可能会被遗漏。
C/C++
C/C++
yaml
trace:
enabled_languages:
- .c
- .h
- .cpp
- .hpp
- .cc
- .cxx
exclude_patterns:
- "*_test.cpp"Trace accuracy: Good. Macros and templates may affect accuracy.
yaml
trace:
enabled_languages:
- .c
- .h
- .cpp
- .hpp
- .cc
- .cxx
exclude_patterns:
- "*_test.cpp"追踪准确性: 良好。宏和模板可能会影响准确性。
Rust
Rust
yaml
trace:
enabled_languages:
- .rs
exclude_patterns:
- "**/tests/**"
- "**/benches/**"Trace accuracy: Excellent. Rust's explicit syntax aids accurate tracing.
yaml
trace:
enabled_languages:
- .rs
exclude_patterns:
- "**/tests/**"
- "**/benches/**"追踪准确性: 极佳。Rust的显式语法有助于准确追踪。
PHP
PHP
yaml
trace:
enabled_languages:
- .php
exclude_patterns:
- "*Test.php"
- "**/tests/**"Trace accuracy: Good. Magic methods may not be fully traced.
yaml
trace:
enabled_languages:
- .php
exclude_patterns:
- "*Test.php"
- "**/tests/**"追踪准确性: 良好。魔术方法可能无法被完全追踪。
Java
Java
yaml
trace:
enabled_languages:
- .java
exclude_patterns:
- "*Test.java"
- "**/test/**"Trace accuracy: Good. Reflection-based calls may be missed.
yaml
trace:
enabled_languages:
- .java
exclude_patterns:
- "*Test.java"
- "**/test/**"追踪准确性: 良好。基于反射的调用可能会被遗漏。
C#
C#
yaml
trace:
enabled_languages:
- .cs
exclude_patterns:
- "*Tests.cs"
- "**/Tests/**"Trace accuracy: Good. Delegates and events may be partially traced.
yaml
trace:
enabled_languages:
- .cs
exclude_patterns:
- "*Tests.cs"
- "**/Tests/**"追踪准确性: 良好。委托和事件可能会被部分追踪。
Multi-Language Projects
多语言项目
For projects with multiple languages:
yaml
trace:
enabled_languages:
# Backend (Go)
- .go
# Frontend (TypeScript)
- .ts
- .tsx
# Shared (SQL, etc.)
- .sql # Index only
exclude_patterns:
- "*_test.go"
- "*.spec.ts"对于包含多种语言的项目:
yaml
trace:
enabled_languages:
# 后端(Go)
- .go
# 前端(TypeScript)
- .ts
- .tsx
# 共享(SQL等)
- .sql # 仅索引
exclude_patterns:
- "*_test.go"
- "*.spec.ts"Index vs Trace Explained
索引与追踪说明
Index (Semantic Search)
索引(语义搜索)
- Works on any text file
- Code is chunked and embedded
- Enables semantic search
- No language-specific parsing required
- 适用于任何文本文件
- 代码会被分块并嵌入
- 支持语义搜索
- 无需特定语言解析
Trace (Call Graphs)
追踪(调用图)
- Requires language-specific parsing
- Extracts function definitions and calls
- Builds caller/callee relationships
- Uses regex (fast) or tree-sitter (precise)
- 需要特定语言解析
- 提取函数定义和调用关系
- 构建调用者/被调用者关系
- 使用正则表达式(快速)或tree-sitter(精确)
Trace Modes by Language
按语言划分的追踪模式
| Language | Fast Mode | Precise Mode |
|---|---|---|
| Go | ✅ | ✅ |
| JavaScript | ✅ | ✅ |
| TypeScript | ✅ | ✅ |
| Python | ✅ | ✅ |
| PHP | ✅ | ✅ |
| C/C++ | ✅ | ✅ |
| Rust | ✅ | ✅ |
| Zig | ✅ | ✅ |
| C# | ✅ | ✅ |
| Java | ✅ | ✅ |
| Pascal | ✅ | ⚠️ Limited |
| 语言 | 快速模式 | 精确模式 |
|---|---|---|
| Go | ✅ | ✅ |
| JavaScript | ✅ | ✅ |
| TypeScript | ✅ | ✅ |
| Python | ✅ | ✅ |
| PHP | ✅ | ✅ |
| C/C++ | ✅ | ✅ |
| Rust | ✅ | ✅ |
| Zig | ✅ | ✅ |
| C# | ✅ | ✅ |
| Java | ✅ | ✅ |
| Pascal | ✅ | ⚠️ 有限 |
Adding Custom Extensions
添加自定义扩展名
If you have non-standard extensions, they'll be indexed but not traced:
yaml
undefined如果你有非标准扩展名,它们会被索引但不会被追踪:
yaml
undefinedCustom extension files will be indexed
自定义扩展名文件会被索引
ignore:
Only add patterns for files you DON'T want indexed
- "*.generated.go"
undefinedignore:
仅添加你不想被索引的文件模式
- "*.generated.go"
undefinedFile Type Detection
文件类型检测
GrepAI uses file extensions for detection. It does NOT use:
- Shebangs ()
#!/usr/bin/env python - File content analysis
- .editorconfig
GrepAI使用文件扩展名进行检测。它不使用:
- Shebang()
#!/usr/bin/env python - 文件内容分析
- .editorconfig
Unsupported Languages (Index Works, No Trace)
不支持追踪的语言(索引可用)
These languages can be indexed for semantic search but don't have trace support:
- Ruby
- Swift
- Kotlin
- Scala
- Elixir
- Clojure
- Haskell
- OCaml
- F#
- Erlang
- R
- Julia
- Perl
- Groovy
Workaround: Use semantic search to find code, then manually trace.
这些语言可被索引用于语义搜索,但没有追踪支持:
- Ruby
- Swift
- Kotlin
- Scala
- Elixir
- Clojure
- Haskell
- OCaml
- F#
- Erlang
- R
- Julia
- Perl
- Groovy
解决方法: 使用语义搜索查找代码,然后手动追踪。
Best Practices
最佳实践
- Enable only needed languages: Faster trace building
- Exclude test files: Cleaner trace results
- Use precise mode for accuracy: When trace results seem incomplete
- Match your tech stack: Configure based on your actual languages
- 仅启用需要的语言: 加快追踪构建速度
- 排除测试文件: 获得更清晰的追踪结果
- 使用精确模式提高准确性: 当追踪结果不完整时
- 匹配你的技术栈: 根据实际使用的语言进行配置
Checking Language Support
检查语言支持
bash
undefinedbash
undefinedCheck what's being indexed
检查正在索引的内容
grepai status
grepai status
Will show file counts by type
会按类型显示文件数量
undefinedundefinedCommon Issues
常见问题
❌ Problem: Files not being indexed
✅ Solution: Check file isn't in ignore patterns
❌ Problem: Trace missing for language
✅ Solution: Ensure language is in
enabled_languages❌ Problem: Wrong language detected
✅ Solution: GrepAI uses extensions only; rename files if needed
❌ 问题: 文件未被索引
✅ 解决方案: 检查文件是否在忽略模式中
❌ 问题: 语言的追踪缺失
✅ 解决方案: 确保语言在中
enabled_languages❌ 问题: 检测到错误的语言
✅ 解决方案: GrepAI仅使用扩展名;如有需要请重命名文件
Output Format
输出格式
Language support summary:
📚 GrepAI Language Support
Full Support (Index + Trace):
- Go (.go)
- JavaScript (.js, .jsx)
- TypeScript (.ts, .tsx)
- Python (.py)
- PHP (.php)
- C/C++ (.c, .cpp, .h, .hpp)
- Rust (.rs)
- Zig (.zig)
- C# (.cs)
- Java (.java)
- Pascal (.pas, .dpr)
Index Only (No Trace):
- Ruby, Swift, Kotlin, Scala
- Shell scripts, SQL, HTML, CSS
- Config files (YAML, JSON, TOML)
- Documentation (Markdown)
Your config enables trace for:
- .go, .js, .ts, .py语言支持摘要:
📚 GrepAI Language Support
Full Support (Index + Trace):
- Go (.go)
- JavaScript (.js, .jsx)
- TypeScript (.ts, .tsx)
- Python (.py)
- PHP (.php)
- C/C++ (.c, .cpp, .h, .hpp)
- Rust (.rs)
- Zig (.zig)
- C# (.cs)
- Java (.java)
- Pascal (.pas, .dpr)
Index Only (No Trace):
- Ruby, Swift, Kotlin, Scala
- Shell scripts, SQL, HTML, CSS
- Config files (YAML, JSON, TOML)
- Documentation (Markdown)
Your config enables trace for:
- .go, .js, .ts, .py