Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pyrefly/lib/lsp/non_wasm/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2924,6 +2924,16 @@ impl Server {
if let Some(refactors) = transaction.push_members_down_code_actions(&handle, range) {
push_refactor_actions(refactors);
}
if let Some(refactors) =
transaction.move_module_member_code_actions(&handle, range, import_format)
{
push_refactor_actions(refactors);
}
if let Some(refactors) =
transaction.make_local_function_top_level_code_actions(&handle, range, import_format)
{
push_refactor_actions(refactors);
}
if actions.is_empty() {
None
} else {
Expand Down
28 changes: 28 additions & 0 deletions pyrefly/lib/state/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,34 @@ impl<'a> Transaction<'a> {
quick_fixes::move_members::push_members_down_code_actions(self, handle, selection)
}

pub fn move_module_member_code_actions(
&self,
handle: &Handle,
selection: TextRange,
import_format: ImportFormat,
) -> Option<Vec<LocalRefactorCodeAction>> {
quick_fixes::move_module::move_module_member_code_actions(
self,
handle,
selection,
import_format,
)
}

pub fn make_local_function_top_level_code_actions(
&self,
handle: &Handle,
selection: TextRange,
import_format: ImportFormat,
) -> Option<Vec<LocalRefactorCodeAction>> {
quick_fixes::move_module::make_local_function_top_level_code_actions(
self,
handle,
selection,
import_format,
)
}

/// Determines whether a module is a third-party package.
///
/// Checks if the module's path is located within any of the configured
Expand Down
1 change: 1 addition & 0 deletions pyrefly/lib/state/lsp/quick_fixes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ pub(crate) mod extract_function;
mod extract_shared;
pub(crate) mod extract_variable;
pub(crate) mod move_members;
pub(crate) mod move_module;
Loading
Loading