Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions refact-agent/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ tree-sitter = "0.25"
tree-sitter-cpp = "0.23"
tree-sitter-java = "0.23"
tree-sitter-javascript = "0.23"
tree-sitter-kotlin-ng = "1.1.0"
tree-sitter-python = "0.23"
tree-sitter-rust = "0.23"
tree-sitter-typescript = "0.23"
Expand Down
1 change: 1 addition & 0 deletions refact-agent/engine/src/ast/treesitter/language_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ impl From<Language> for LanguageId {
lang if lang == tree_sitter_cpp::LANGUAGE.into() => Self::Cpp,
lang if lang == tree_sitter_python::LANGUAGE.into() => Self::Python,
lang if lang == tree_sitter_java::LANGUAGE.into() => Self::Java,
lang if lang == tree_sitter_kotlin_ng::LANGUAGE.into() => Self::Kotlin,
lang if lang == tree_sitter_javascript::LANGUAGE.into() => Self::JavaScript,
lang if lang == tree_sitter_rust::LANGUAGE.into() => Self::Rust,
lang if lang == tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into() => Self::TypeScript,
Expand Down
6 changes: 6 additions & 0 deletions refact-agent/engine/src/ast/treesitter/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub(crate) mod rust;
mod tests;
mod utils;
mod java;
mod kotlin;
mod cpp;
mod ts;
mod js;
Expand Down Expand Up @@ -49,6 +50,10 @@ pub(crate) fn get_ast_parser(language_id: LanguageId) -> Result<Box<dyn AstLangu
let parser = java::JavaParser::new()?;
Ok(Box::new(parser))
}
LanguageId::Kotlin => {
let parser = kotlin::KotlinParser::new()?;
Ok(Box::new(parser))
}
LanguageId::Cpp => {
let parser = cpp::CppParser::new()?;
Ok(Box::new(parser))
Expand Down Expand Up @@ -91,6 +96,7 @@ pub fn get_language_id_by_filename(filename: &PathBuf) -> Option<LanguageId> {
"inl" | "inc" | "tpp" | "tpl" => Some(LanguageId::Cpp),
"py" | "py3" | "pyx" => Some(LanguageId::Python),
"java" => Some(LanguageId::Java),
"kt" | "kts" => Some(LanguageId::Kotlin),
"js" | "jsx" => Some(LanguageId::JavaScript),
"rs" => Some(LanguageId::Rust),
"ts" => Some(LanguageId::TypeScript),
Expand Down
Loading