Use same arguments for LSP binary in haskell.rs
This commit is contained in:
parent
0576214be7
commit
faf7798577
1 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
use std::env::consts::ARCH;
|
use std::env::consts::ARCH;
|
||||||
|
use std::ffi::OsString;
|
||||||
use std::{any::Any, path::PathBuf};
|
use std::{any::Any, path::PathBuf};
|
||||||
|
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
|
@ -14,6 +15,10 @@ use util::async_maybe;
|
||||||
use util::github::latest_github_release;
|
use util::github::latest_github_release;
|
||||||
use util::{github::GitHubLspBinaryVersion, ResultExt};
|
use util::{github::GitHubLspBinaryVersion, ResultExt};
|
||||||
|
|
||||||
|
fn server_binary_arguments() -> Vec<OsString> {
|
||||||
|
vec!["--lsp".into()]
|
||||||
|
}
|
||||||
|
|
||||||
pub struct HaskellLspAdapter;
|
pub struct HaskellLspAdapter;
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
@ -80,7 +85,7 @@ impl LspAdapter for HaskellLspAdapter {
|
||||||
.await?;
|
.await?;
|
||||||
Ok(LanguageServerBinary {
|
Ok(LanguageServerBinary {
|
||||||
path: binary_path,
|
path: binary_path,
|
||||||
arguments: vec!["--lsp".into()],
|
arguments: server_binary_arguments(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +129,7 @@ async fn get_cached_server_binary(container_dir: PathBuf) -> Option<LanguageServ
|
||||||
if let Some(path) = last_binary_path {
|
if let Some(path) = last_binary_path {
|
||||||
Ok(LanguageServerBinary {
|
Ok(LanguageServerBinary {
|
||||||
path,
|
path,
|
||||||
arguments: Vec::new(),
|
arguments: server_binary_arguments(),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow!("no cached binary"))
|
Err(anyhow!("no cached binary"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue