Allow formatting selections via LSP (#18752)
Release Notes: - Added a new `editor: format selections` action that allows formatting only the currently selected text via the primary language server. --------- Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
parent
eb76065ad3
commit
84df3a0cad
9 changed files with 322 additions and 159 deletions
|
@ -2505,10 +2505,11 @@ impl Project {
|
|||
buffers: HashSet<Model<Buffer>>,
|
||||
push_to_history: bool,
|
||||
trigger: lsp_store::FormatTrigger,
|
||||
target: lsp_store::FormatTarget,
|
||||
cx: &mut ModelContext<Project>,
|
||||
) -> Task<anyhow::Result<ProjectTransaction>> {
|
||||
self.lsp_store.update(cx, |lsp_store, cx| {
|
||||
lsp_store.format(buffers, push_to_history, trigger, cx)
|
||||
lsp_store.format(buffers, push_to_history, trigger, target, cx)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue