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

Method locate_class_declaration

src/definition/implementation.rs:1113–1129  ·  view source on GitHub ↗

Find the location of a class declaration for an implementor.

(
        &self,
        cls: &ClassInfo,
        current_uri: &str,
        current_content: &str,
    )

Source from the content-addressed store, hash-verified

1111
1112 /// Find the location of a class declaration for an implementor.
1113 fn locate_class_declaration(
1114 &self,
1115 cls: &ClassInfo,
1116 current_uri: &str,
1117 current_content: &str,
1118 ) -> Option<Location> {
1119 let (class_uri, class_content) =
1120 self.find_class_file_content(&cls.name, current_uri, current_content)?;
1121
1122 if cls.keyword_offset == 0 {
1123 return None;
1124 }
1125 let position = crate::util::offset_to_position(&class_content, cls.keyword_offset as usize);
1126 let parsed_uri = Url::parse(&class_uri).ok()?;
1127
1128 Some(point_location(parsed_uri, position))
1129 }
1130}

Callers 1

Calls 3

offset_to_positionFunction · 0.85
point_locationFunction · 0.85

Tested by

no test coverage detected