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:
parent
f6c85b28d5
commit
8d7f5eab79
21 changed files with 289 additions and 343 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue