Extract Ocaml language support into an extension (#10450)

Release Notes:

- Extracted Ocaml language support into an extension

---------

Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
Max Brunsfeld 2024-04-11 15:20:19 -07:00 committed by GitHub
parent f6c85b28d5
commit 8d7f5eab79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 289 additions and 343 deletions

View file

@ -9904,18 +9904,29 @@ async fn populate_labels_for_symbols(
) {
let mut symbols_by_language = HashMap::<Option<Arc<Language>>, Vec<CoreSymbol>>::default();
let mut unknown_path = None;
for symbol in symbols {
let language = language_registry
.language_for_file_path(&symbol.path.path)
.await
.log_err()
.or_else(|| default_language.clone());
.ok()
.or_else(|| {
unknown_path.get_or_insert(symbol.path.path.clone());
default_language.clone()
});
symbols_by_language
.entry(language)
.or_default()
.push(symbol);
}
if let Some(unknown_path) = unknown_path {
log::info!(
"no language found for symbol path {}",
unknown_path.display()
);
}
let mut label_params = Vec::new();
for (language, mut symbols) in symbols_by_language {
label_params.clear();