Check whether `name` is a `@template` parameter in scope at `cursor_offset` and, if so, produce a hover showing the template name and its upper bound.
(
&self,
uri: &str,
name: &str,
cursor_offset: u32,
)
| 1062 | /// `cursor_offset` and, if so, produce a hover showing the template |
| 1063 | /// name and its upper bound. |
| 1064 | fn find_template_def_for_hover( |
| 1065 | &self, |
| 1066 | uri: &str, |
| 1067 | name: &str, |
| 1068 | cursor_offset: u32, |
| 1069 | ) -> Option<Hover> { |
| 1070 | let maps = self.symbol_maps.read(); |
| 1071 | let map = maps.get(uri)?; |
| 1072 | let def = map.find_template_def(name, cursor_offset)?; |
| 1073 | |
| 1074 | let bound_display = if let Some(ref bound) = def.bound { |
| 1075 | format!(" of `{}`", bound) |
| 1076 | } else { |
| 1077 | String::new() |
| 1078 | }; |
| 1079 | |
| 1080 | Some(make_hover(format!( |
| 1081 | "**{}** `{}`{}", |
| 1082 | def.variance.tag_name(), |
| 1083 | def.name, |
| 1084 | bound_display |
| 1085 | ))) |
| 1086 | } |
| 1087 | |
| 1088 | /// Produce hover information for a function call. |
| 1089 | fn hover_function_call( |
no test coverage detected