aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp
diff options
context:
space:
mode:
authorPiergiorgioZagaria2022-08-04 04:01:48 +0000
committerGitHub2022-08-04 04:01:48 +0000
commit219d2c25156a496ed2923d4cef256352bb1302e5 (patch)
tree54591f266245136d22a7895a8459814e41ecac26 /helix-lsp
parentc5f8a835f54b27c9f1c22c8321378a309d371309 (diff)
Change default formatter for any language (#2942)
* Change default formatter for any language * Fix clippy error * Close stdin for Stdio formatters * Better indentation and pattern matching * Return Result<Option<...>> for fn format instead of Option * Remove unwrap for stdin * Handle FormatterErrors instead of Result<Option<...>> * Use Transaction instead of LspFormatting * Use Transaction directly in Document::format * Perform stdin type formatting asynchronously * Rename formatter.type values to kebab-case * Debug format for displaying io::ErrorKind (msrv fix) * Solve conflict? * Use only stdio type formatters * Remove FormatterType enum * Remove old comment * Check if the formatter exited correctly * Add formatter configuration to the book * Avoid allocations when writing to stdin and formatting errors * Remove unused import Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
Diffstat (limited to 'helix-lsp')
-rw-r--r--helix-lsp/src/lib.rs16
1 files changed, 0 insertions, 16 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs
index b6e36423..79d9609e 100644
--- a/helix-lsp/src/lib.rs
+++ b/helix-lsp/src/lib.rs
@@ -213,22 +213,6 @@ pub mod util {
}),
)
}
-
- /// The result of asking the language server to format the document. This can be turned into a
- /// `Transaction`, but the advantage of not doing that straight away is that this one is
- /// `Send` and `Sync`.
- #[derive(Clone, Debug)]
- pub struct LspFormatting {
- pub doc: Rope,
- pub edits: Vec<lsp::TextEdit>,
- pub offset_encoding: OffsetEncoding,
- }
-
- impl From<LspFormatting> for Transaction {
- fn from(fmt: LspFormatting) -> Transaction {
- generate_transaction_from_edits(&fmt.doc, fmt.edits, fmt.offset_encoding)
- }
- }
}
#[derive(Debug, PartialEq, Clone)]