Skip to content
Merged
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/lsp-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ lsp-types = { version = "0.11.0", package = "gen-lsp-types", features = [
] }
ctrlc = "3.4.7"
anyhow.workspace = true
toolchain.workspace = true

[lints]
workspace = true
13 changes: 9 additions & 4 deletions lib/lsp-server/examples/minimal_lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
//! ```
//!

use std::{error::Error, io::Write};
use std::{
error::Error,
io::Write,
process::{Command, Stdio},
};

use lsp_types::{
CompletionItem, CompletionItemKind, CompletionOptions, CompletionRequest, CompletionResponse,
Expand All @@ -77,8 +81,6 @@ use lsp_types::{
ServerCapabilities, TextDocumentSync, TextEdit, Uri,
};
use rustc_hash::FxHashMap; // fast hash map
use std::process::Stdio;
use toolchain::command; // clippy-approved wrapper

#[allow(clippy::print_stderr, clippy::disallowed_types, clippy::disallowed_methods)]
use anyhow::{Context, Result, anyhow, bail};
Expand Down Expand Up @@ -276,12 +278,15 @@ fn publish_dummy_diag(conn: &Connection, uri: &Uri) -> Result<()> {

fn run_rustfmt(input: &str) -> Result<String> {
let cwd = std::env::current_dir().expect("can't determine CWD");
let mut child = command("rustfmt", &cwd, &FxHashMap::default())
#[allow(clippy::disallowed_methods)]
let mut child = Command::new("rustfmt")
.arg("--emit")
.arg("stdout")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.current_dir(&cwd)
.env("RUSTUP_AUTO_INSTALL", "0")
.spawn()
.context("failed to spawn rustfmt – is it installed?")?;

Expand Down
Loading