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
@@ -33,6 +33,10 @@ tree-sitter = "0.23.0"
|
|||||||
tree-sitter-rust = "0.23.0"
|
tree-sitter-rust = "0.23.0"
|
||||||
tree-sitter-typescript = "0.23.0"
|
tree-sitter-typescript = "0.23.0"
|
||||||
tree-sitter-python = "0.23.0"
|
tree-sitter-python = "0.23.0"
|
||||||
|
tree-sitter-java = "0.23.5"
|
||||||
|
tree-sitter-c = "0.24.2"
|
||||||
|
tree-sitter-cpp = "0.23.4"
|
||||||
|
tree-sitter-go = "0.25.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
chrono = "0.4.45"
|
chrono = "0.4.45"
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ impl McpTool for ReadFileSkeletonHandler {
|
|||||||
"rs" => tree_sitter_rust::LANGUAGE,
|
"rs" => tree_sitter_rust::LANGUAGE,
|
||||||
"ts" | "tsx" | "js" | "jsx" => tree_sitter_typescript::LANGUAGE_TYPESCRIPT,
|
"ts" | "tsx" | "js" | "jsx" => tree_sitter_typescript::LANGUAGE_TYPESCRIPT,
|
||||||
"py" => tree_sitter_python::LANGUAGE,
|
"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),
|
_ => return Ok(code),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -140,6 +144,10 @@ impl McpTool for ReplaceAstNodeHandler {
|
|||||||
"rs" => tree_sitter_rust::LANGUAGE,
|
"rs" => tree_sitter_rust::LANGUAGE,
|
||||||
"ts" | "tsx" | "js" | "jsx" => tree_sitter_typescript::LANGUAGE_TYPESCRIPT,
|
"ts" | "tsx" | "js" | "jsx" => tree_sitter_typescript::LANGUAGE_TYPESCRIPT,
|
||||||
"py" => tree_sitter_python::LANGUAGE,
|
"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)),
|
_ => return Err(format!("Unsupported language for AST replacement: {}", ext)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user