feat(ast): Add tree-sitter bindings for Java, C, C++, and Go
This commit is contained in:
1 parent
9787af0f27
commit
1adc625fcf
2 files changed
+12
No files matched your search
@@ -40,6 +40,10 @@ impl McpTool for ReadFileSkeletonHandler {
|
||||
"rs" => tree_sitter_rust::LANGUAGE,
|
||||
"ts" | "tsx" | "js" | "jsx" => tree_sitter_typescript::LANGUAGE_TYPESCRIPT,
|
||||
"py" => tree_sitter_python::LANGUAGE,
|
||||
"java" => tree_sitter_java::LANGUAGE,
|
||||
"c" | "h" => tree_sitter_c::LANGUAGE,
|
||||
"cpp" | "cc" | "cxx" | "hpp" | "hxx" => tree_sitter_cpp::LANGUAGE,
|
||||
"go" => tree_sitter_go::LANGUAGE,
|
||||
_ => return Ok(code),
|
||||
};
|
||||
|
||||
@@ -140,6 +144,10 @@ impl McpTool for ReplaceAstNodeHandler {
|
||||
"rs" => tree_sitter_rust::LANGUAGE,
|
||||
"ts" | "tsx" | "js" | "jsx" => tree_sitter_typescript::LANGUAGE_TYPESCRIPT,
|
||||
"py" => tree_sitter_python::LANGUAGE,
|
||||
"java" => tree_sitter_java::LANGUAGE,
|
||||
"c" | "h" => tree_sitter_c::LANGUAGE,
|
||||
"cpp" | "cc" | "cxx" | "hpp" | "hxx" => tree_sitter_cpp::LANGUAGE,
|
||||
"go" => tree_sitter_go::LANGUAGE,
|
||||
_ => return Err(format!("Unsupported language for AST replacement: {}", ext)),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user