Fixed proc macro server error
This commit is contained in:
@@ -103,7 +103,8 @@ impl RustAnalyzer {
|
|||||||
pub fn new(
|
pub fn new(
|
||||||
notification_tx: tokio::sync::mpsc::UnboundedSender<Value>,
|
notification_tx: tokio::sync::mpsc::UnboundedSender<Value>,
|
||||||
) -> Result<Self, Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<Self, Box<dyn std::error::Error + Send + Sync>> {
|
||||||
let mut child = tokio::process::Command::new("rust-analyzer")
|
let mut child = tokio::process::Command::new("rustup")
|
||||||
|
.args(["run", "stable", "rust-analyzer"])
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.stderr(Stdio::piped())
|
.stderr(Stdio::piped())
|
||||||
@@ -129,7 +130,10 @@ impl RustAnalyzer {
|
|||||||
match stderr.read(&mut buf).await {
|
match stderr.read(&mut buf).await {
|
||||||
Ok(0) => break,
|
Ok(0) => break,
|
||||||
Ok(n) => {
|
Ok(n) => {
|
||||||
eprintln!("[ra-stderr] {}", String::from_utf8_lossy(&buf[..n]).trim_end());
|
eprintln!(
|
||||||
|
"[ra-stderr] {}",
|
||||||
|
String::from_utf8_lossy(&buf[..n]).trim_end()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("[ra-stderr] read error: {e}");
|
eprintln!("[ra-stderr] read error: {e}");
|
||||||
@@ -323,11 +327,8 @@ impl RustAnalyzer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn initialized(&mut self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
pub async fn initialized(&mut self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
self.notify(
|
self.notify(<Initialized as Notification>::METHOD, InitializedParams {})
|
||||||
<Initialized as Notification>::METHOD,
|
.await?;
|
||||||
InitializedParams {},
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user