Ignore empty hover contents, trim final hover label text

This commit is contained in:
Kirill Bulatov 2023-07-18 18:50:55 +03:00
parent 7cb5326ba0
commit 9aeb970f09
2 changed files with 120 additions and 2 deletions

View file

@ -425,6 +425,12 @@ pub struct Hover {
pub language: Option<Arc<Language>>,
}
impl Hover {
pub fn is_empty(&self) -> bool {
self.contents.iter().all(|block| block.text.is_empty())
}
}
#[derive(Default)]
pub struct ProjectTransaction(pub HashMap<ModelHandle<Buffer>, language::Transaction>);