diff --git a/crates/tabby-scheduler/src/index.rs b/crates/tabby-scheduler/src/index.rs index ef556dd..418782f 100644 --- a/crates/tabby-scheduler/src/index.rs +++ b/crates/tabby-scheduler/src/index.rs @@ -46,10 +46,12 @@ pub fn index_repositories(_config: &Config) -> Result<()> { continue; } } + + let language = reduce_language_if_needed(&doc.language); writer.add_document(doc!( field_git_url => doc.git_url.clone(), field_filepath => doc.filepath.clone(), - field_language => doc.language.clone(), + field_language => language, field_name => name, field_body => body, field_kind => tag.syntax_type_name, @@ -62,6 +64,14 @@ pub fn index_repositories(_config: &Config) -> Result<()> { Ok(()) } +fn reduce_language_if_needed(language: &str) -> &str { + if ["javascript", "jsx", "typescript", "tsx"].contains(&language) { + "javascript-typescript" + } else { + language + } +} + lazy_static! { static ref LANGUAGE_NAME_BLACKLIST: HashMap<&'static str, Vec<&'static str>> = HashMap::from([("python", vec!["__init__"])]);