Produce hover information for a class reference.
(
&self,
name: &str,
uri: &str,
content: &str,
class_loader: &dyn Fn(&str) -> Option<Arc<ClassInfo>>,
cursor_offset: u32,
)
| 1001 | |
| 1002 | /// Produce hover information for a class reference. |
| 1003 | fn hover_class_reference( |
| 1004 | &self, |
| 1005 | name: &str, |
| 1006 | uri: &str, |
| 1007 | content: &str, |
| 1008 | class_loader: &dyn Fn(&str) -> Option<Arc<ClassInfo>>, |
| 1009 | cursor_offset: u32, |
| 1010 | ) -> Option<Hover> { |
| 1011 | let class_info = class_loader(name); |
| 1012 | |
| 1013 | if let Some(cls) = class_info { |
| 1014 | Some(self.hover_for_class_info(&cls, uri, content)) |
| 1015 | } else { |
| 1016 | // Check whether this is a template parameter in scope. |
| 1017 | if let Some(tpl) = self.find_template_def_for_hover(uri, name, cursor_offset) { |
| 1018 | return Some(tpl); |
| 1019 | } |
| 1020 | None |
| 1021 | } |
| 1022 | } |
| 1023 | |
| 1024 | /// Build a template-info line for a type string that might be a |
| 1025 | /// template parameter. Returns `None` when the type is not a |
no test coverage detected