suggested extensions (#9526)
Follow-up from #9138 Release Notes: - Adds suggested extensions for some filetypes ([#7096](https://github.com/zed-industries/zed/issues/7096)). --------- Co-authored-by: Felix Zeller <felixazeller@gmail.com>
This commit is contained in:
parent
7573f35e8e
commit
d6b7f14b51
11 changed files with 318 additions and 37 deletions
|
@ -62,8 +62,8 @@ pub use buffer::Operation;
|
|||
pub use buffer::*;
|
||||
pub use diagnostic_set::DiagnosticEntry;
|
||||
pub use language_registry::{
|
||||
LanguageQueries, LanguageRegistry, LanguageServerBinaryStatus, PendingLanguageServer,
|
||||
QUERY_FILENAME_PREFIXES,
|
||||
LanguageNotFound, LanguageQueries, LanguageRegistry, LanguageServerBinaryStatus,
|
||||
PendingLanguageServer, QUERY_FILENAME_PREFIXES,
|
||||
};
|
||||
pub use lsp::LanguageServerId;
|
||||
pub use outline::{Outline, OutlineItem};
|
||||
|
|
|
@ -85,6 +85,15 @@ enum AvailableGrammar {
|
|||
Unloaded(PathBuf),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct LanguageNotFound;
|
||||
|
||||
impl std::fmt::Display for LanguageNotFound {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "language not found")
|
||||
}
|
||||
}
|
||||
|
||||
pub const QUERY_FILENAME_PREFIXES: &[(
|
||||
&str,
|
||||
fn(&mut LanguageQueries) -> &mut Option<Cow<'static, str>>,
|
||||
|
@ -471,7 +480,7 @@ impl LanguageRegistry {
|
|||
.max_by_key(|e| e.1)
|
||||
.clone()
|
||||
else {
|
||||
let _ = tx.send(Err(anyhow!("language not found")));
|
||||
let _ = tx.send(Err(anyhow!(LanguageNotFound)));
|
||||
return rx;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue