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

Function rename

src/rename/tests.rs:36–53  ·  view source on GitHub ↗

Helper: send a rename request and return the workspace edit.

(
    backend: &Backend,
    uri: &Url,
    line: u32,
    character: u32,
    new_name: &str,
)

Source from the content-addressed store, hash-verified

34
35/// Helper: send a rename request and return the workspace edit.
36async fn rename(
37 backend: &Backend,
38 uri: &Url,
39 line: u32,
40 character: u32,
41 new_name: &str,
42) -> Option<WorkspaceEdit> {
43 let params = RenameParams {
44 text_document_position: TextDocumentPositionParams {
45 text_document: TextDocumentIdentifier { uri: uri.clone() },
46 position: Position { line, character },
47 },
48 new_name: new_name.to_string(),
49 work_done_progress_params: WorkDoneProgressParams::default(),
50 };
51
52 backend.rename(params).await.unwrap()
53}
54
55/// Collect all text edits for a given URI from a WorkspaceEdit.
56fn edits_for_uri(edit: &WorkspaceEdit, uri: &Url) -> Vec<TextEdit> {

Callers 15

rename_class_same_fileFunction · 0.85
rename_methodFunction · 0.85
rename_static_methodFunction · 0.85
rename_functionFunction · 0.85
rename_class_constantFunction · 0.85
rename_class_cross_fileFunction · 0.85
rename_method_cross_fileFunction · 0.85

Calls 3

cloneMethod · 0.80
unwrapMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected