mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Item up and down movers
This commit is contained in:
parent
d704750ba9
commit
7d60458495
11 changed files with 536 additions and 1 deletions
|
@ -37,6 +37,7 @@ mod hover;
|
|||
mod inlay_hints;
|
||||
mod join_lines;
|
||||
mod matching_brace;
|
||||
mod move_item;
|
||||
mod parent_module;
|
||||
mod references;
|
||||
mod fn_references;
|
||||
|
@ -76,6 +77,7 @@ pub use crate::{
|
|||
hover::{HoverAction, HoverConfig, HoverGotoTypeData, HoverResult},
|
||||
inlay_hints::{InlayHint, InlayHintsConfig, InlayKind},
|
||||
markup::Markup,
|
||||
move_item::Direction,
|
||||
prime_caches::PrimeCachesProgress,
|
||||
references::{rename::RenameError, ReferenceSearchResult},
|
||||
runnables::{Runnable, RunnableKind, TestId},
|
||||
|
@ -583,6 +585,14 @@ impl Analysis {
|
|||
self.with_db(|db| annotations::resolve_annotation(db, annotation))
|
||||
}
|
||||
|
||||
pub fn move_item(
|
||||
&self,
|
||||
range: FileRange,
|
||||
direction: Direction,
|
||||
) -> Cancelable<Option<TextEdit>> {
|
||||
self.with_db(|db| move_item::move_item(db, range, direction))
|
||||
}
|
||||
|
||||
/// Performs an operation on that may be Canceled.
|
||||
fn with_db<F, T>(&self, f: F) -> Cancelable<T>
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue