internal: add "Shuffle Crate Graph" command
This commit is contained in:
@@ -97,6 +97,11 @@ pub(crate) fn handle_memory_usage(state: &mut GlobalState, _: ()) -> Result<Stri
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
pub(crate) fn handle_shuffle_crate_graph(state: &mut GlobalState, _: ()) -> Result<()> {
|
||||
state.analysis_host.shuffle_crate_graph();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn handle_syntax_tree(
|
||||
snap: GlobalStateSnapshot,
|
||||
params: lsp_ext::SyntaxTreeParams,
|
||||
|
||||
@@ -31,6 +31,14 @@ impl Request for MemoryUsage {
|
||||
const METHOD: &'static str = "rust-analyzer/memoryUsage";
|
||||
}
|
||||
|
||||
pub enum ShuffleCrateGraph {}
|
||||
|
||||
impl Request for ShuffleCrateGraph {
|
||||
type Params = ();
|
||||
type Result = ();
|
||||
const METHOD: &'static str = "rust-analyzer/shuffleCrateGraph";
|
||||
}
|
||||
|
||||
pub enum ReloadWorkspace {}
|
||||
|
||||
impl Request for ReloadWorkspace {
|
||||
|
||||
@@ -567,6 +567,7 @@ impl GlobalState {
|
||||
Ok(())
|
||||
})?
|
||||
.on_sync_mut::<lsp_ext::MemoryUsage>(handlers::handle_memory_usage)?
|
||||
.on_sync_mut::<lsp_ext::ShuffleCrateGraph>(handlers::handle_shuffle_crate_graph)?
|
||||
.on_sync::<lsp_ext::JoinLines>(handlers::handle_join_lines)?
|
||||
.on_sync::<lsp_ext::OnEnter>(handlers::handle_on_enter)?
|
||||
.on_sync::<lsp_types::request::SelectionRangeRequest>(handlers::handle_selection_range)?
|
||||
|
||||
Reference in New Issue
Block a user