mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-03 05:12:55 +00:00
lsp: Rename components
Only handle rename requests when on the component name in the component definition. Handle exports/imports in the entire project as needed.
This commit is contained in:
parent
97cd00ffd8
commit
704cfff41f
8 changed files with 994 additions and 30 deletions
|
|
@ -10,6 +10,12 @@ use lsp_types::{TextEdit, Url, WorkspaceEdit};
|
|||
|
||||
use std::{collections::HashMap, path::PathBuf};
|
||||
|
||||
pub mod rename_component;
|
||||
#[cfg(test)]
|
||||
pub mod test;
|
||||
#[cfg(any(test, feature = "preview-engine"))]
|
||||
pub mod text_edit;
|
||||
|
||||
pub type Error = Box<dyn std::error::Error>;
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
pub type UrlVersion = Option<i32>;
|
||||
|
|
@ -258,7 +264,6 @@ pub fn create_workspace_edit_from_source_file(
|
|||
))
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "preview-external", feature = "preview-engine"))]
|
||||
pub fn create_workspace_edit_from_source_files(
|
||||
mut inputs: Vec<(SourceFile, TextEdit)>,
|
||||
) -> Option<WorkspaceEdit> {
|
||||
|
|
@ -274,6 +279,7 @@ pub fn create_workspace_edit_from_source_files(
|
|||
.entry((url, sf.version()))
|
||||
.and_modify(|v| v.push(edit.clone()))
|
||||
.or_insert_with(|| vec![edit]);
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue