Fix ast-grep supported languages list to match official documentation

Correct the ast-grep language support documentation to accurately reflect
the actual 25 languages supported according to ast-grep.github.io:

**Removed unsupported languages:**
- Dart (not actually supported by ast-grep)
- Vue, Svelte (framework-specific, not core languages)
- SCSS, SASS, LESS (CSS preprocessors not supported)
- TOML, XML (not in official support list)
- PowerShell, shell variants beyond bash
- OCaml and other languages incorrectly listed

**Corrected to official 25 languages:**
- System: C, C++, C#, Go, Rust
- Web: JavaScript (js/jsx), TypeScript (ts), TSX, HTML, CSS, PHP
- General: Python, Java, Kotlin, Ruby, Swift, Scala, Lua, Elixir, Haskell
- Config: JSON, YAML
- Other: Bash, Nix, Solidity

**Updated examples:**
- Use correct language aliases (js instead of javascript, ts instead of typescript)
- Align with actual ast-grep command patterns

This ensures accurate guidance for developers using ast-grep integration
and prevents errors from referencing unsupported language identifiers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steven
2025-08-25 18:51:04 -07:00
parent 0ec76d9e1b
commit 6fa8fea979

View File

@@ -20,17 +20,17 @@ ast-grep --pattern '$PATTERN' --lang $LANGUAGE $PATH
### Common Use Cases ### Common Use Cases
- **Find function calls:** - **Find function calls:**
`ast-grep --pattern 'functionName($$$)' --lang javascript .` `ast-grep --pattern 'functionName($$$)' --lang js .`
- **Find class definitions:** - **Find class definitions:**
`ast-grep --pattern 'class $NAME { $$$ }' --lang typescript .` `ast-grep --pattern 'class $NAME { $$$ }' --lang ts .`
- **Find variable assignments:** - **Find variable assignments:**
`ast-grep --pattern '$VAR = $$$' --lang ruby .` `ast-grep --pattern '$VAR = $$$' --lang ruby .`
- **Find import statements:** - **Find import statements:**
`ast-grep --pattern 'import { $$$ } from "$MODULE"' --lang javascript .` `ast-grep --pattern 'import { $$$ } from "$MODULE"' --lang js .`
- **Find method calls on objects:** - **Find method calls on objects:**
`ast-grep --pattern '$OBJ.$METHOD($$$)' --lang typescript .` `ast-grep --pattern '$OBJ.$METHOD($$$)' --lang ts .`
- **Find React hooks:** - **Find React hooks:**
`ast-grep --pattern 'const [$STATE, $SETTER] = useState($$$)' --lang typescript .` `ast-grep --pattern 'const [$STATE, $SETTER] = useState($$$)' --lang tsx .`
- **Find Ruby class definitions:** - **Find Ruby class definitions:**
`ast-grep --pattern 'class $NAME < $$$; $$$; end' --lang ruby .` `ast-grep --pattern 'class $NAME < $$$; $$$; end' --lang ruby .`
@@ -43,42 +43,44 @@ ast-grep --pattern '$PATTERN' --lang $LANGUAGE $PATH
## Supported Languages ## Supported Languages
**Primary Languages:** **Complete list of ast-grep supported languages** (25 total):
- **JavaScript/TypeScript**: `javascript`, `typescript`, `jsx`, `tsx`
- **Python**: `python` **System Programming:**
- **Java/Kotlin**: `java`, `kotlin` - **C**: `c`
- **C/C++**: `c`, `cpp`, `c++` - **C++**: `cpp`
- **C#**: `csharp`, `cs` - **C#**: `csharp`
- **Go**: `go` - **Go**: `go`
- **Rust**: `rust` - **Rust**: `rust`
- **Ruby**: `ruby`
- **PHP**: `php`
- **Swift**: `swift`
- **Dart**: `dart`
**Web & Markup:** **Web Development:**
- **JavaScript**: `javascript` (aliases: `js`, `jsx`)
- **TypeScript**: `typescript` (aliases: `ts`)
- **TSX**: `tsx`
- **HTML**: `html` - **HTML**: `html`
- **CSS**: `css`, `scss`, `sass`, `less` - **CSS**: `css`
- **Vue**: `vue` - **PHP**: `php`
- **Svelte**: `svelte`
**Configuration & Data:** **General Purpose:**
- **YAML**: `yaml`, `yml` - **Python**: `python`
- **JSON**: `json` - **Java**: `java`
- **TOML**: `toml` - **Kotlin**: `kotlin`
- **XML**: `xml` - **Ruby**: `ruby`
- **Swift**: `swift`
**Shell & Scripts:** - **Scala**: `scala`
- **Bash**: `bash`, `sh`
- **PowerShell**: `powershell`
**Others:**
- **Lua**: `lua` - **Lua**: `lua`
- **Elixir**: `elixir` - **Elixir**: `elixir`
- **Scala**: `scala`
- **Haskell**: `haskell` - **Haskell**: `haskell`
- **OCaml**: `ocaml`
- **And many more** - ast-grep supports 50+ languages **Configuration & Data:**
- **JSON**: `json`
- **YAML**: `yaml`
**Other:**
- **Bash**: `bash`
- **Nix**: `nix`
- **Solidity**: `solidity`
> **Note**: Language aliases (like `js` for `javascript`) and file extension mappings can be customized using the `languageGlobs` configuration.
## Integration Workflow ## Integration Workflow