-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fluyt/code_ops): add languages to chunker and range for chunk si…
…ze (#334) * feat(fluyt/code_ops): add more treesitter languages * fix: clippy + fmt * feat(fluyt/code_ops): implement builder and support range * feat(fluyt/code_ops): implement range limits for code chunking * feat(fluyt/indexing): code chunking supports size
- Loading branch information
Showing
5 changed files
with
161 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
mod code_parser; | ||
mod code_splitter; | ||
|
||
pub use {code_parser::CodeParser, code_splitter::CodeSplitter}; | ||
use infrastructure::SupportedLanguages; | ||
use tree_sitter::Language; | ||
pub use {code_parser::CodeParser, code_splitter::ChunkSize, code_splitter::CodeSplitter}; | ||
|
||
pub(crate) fn supported_language_to_tree_sitter(language: &SupportedLanguages) -> Language { | ||
match language { | ||
SupportedLanguages::Rust => tree_sitter_rust::language(), | ||
SupportedLanguages::Python => tree_sitter_python::language(), | ||
SupportedLanguages::Typescript => tree_sitter_typescript::language_typescript(), | ||
SupportedLanguages::Javascript => tree_sitter_javascript::language(), | ||
SupportedLanguages::Ruby => tree_sitter_ruby::language(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters