MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / find_template_def_for_hover

Method find_template_def_for_hover

src/hover/mod.rs:1064–1086  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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(

Callers 1

hover_class_referenceMethod · 0.80

Calls 3

make_hoverFunction · 0.85
find_template_defMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected