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

Method hover_class_reference

src/hover/mod.rs:1003–1022  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

hover_from_symbolMethod · 0.80

Calls 2

hover_for_class_infoMethod · 0.80

Tested by

no test coverage detected