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

Method insert_position_for

src/completion/use_edit.rs:42–44  ·  view source on GitHub ↗

Compute the insertion `Position` for a new `use` statement that imports the given FQN, maintaining alphabetical order among the existing imports. If there are no existing imports, returns the fallback position (after `namespace` or `<?php`).

(&self, fqn: &str)

Source from the content-addressed store, hash-verified

40 /// If there are no existing imports, returns the fallback position
41 /// (after `namespace` or `<?php`).
42 pub(crate) fn insert_position_for(&self, fqn: &str) -> Position {
43 self.insert_position_for_key(&fqn.to_lowercase())
44 }
45
46 /// Like [`insert_position_for`](Self::insert_position_for) but
47 /// accepts a pre-computed sort key instead of deriving one from the

Callers 1

build_use_editFunction · 0.80

Calls 1

Tested by

no test coverage detected