aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src/client.rs
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-19 05:02:12 +0000
committerNathan Vegdahl2021-07-19 05:02:12 +0000
commite462f32723bb61899a390f438d7d856d87fb7614 (patch)
treee97a9afbf07e2735ba96d62dd5e8f71e1a241fe1 /helix-lsp/src/client.rs
parent6c038bb0151c6aeb43fc94bd2dc3d516a71d346c (diff)
parent5292fe0f7df9f1a420744007aa9dd67e7a5a6610 (diff)
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
Diffstat (limited to 'helix-lsp/src/client.rs')
-rw-r--r--helix-lsp/src/client.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs
index 7f136fe8..1c2a49b5 100644
--- a/helix-lsp/src/client.rs
+++ b/helix-lsp/src/client.rs
@@ -24,12 +24,14 @@ pub struct Client {
request_counter: AtomicU64,
capabilities: Option<lsp::ServerCapabilities>,
offset_encoding: OffsetEncoding,
+ config: Option<Value>,
}
impl Client {
pub fn start(
cmd: &str,
args: &[String],
+ config: Option<Value>,
id: usize,
) -> Result<(Self, UnboundedReceiver<(usize, Call)>)> {
let process = Command::new(cmd)
@@ -57,6 +59,7 @@ impl Client {
request_counter: AtomicU64::new(0),
capabilities: None,
offset_encoding: OffsetEncoding::Utf8,
+ config,
};
// TODO: async client.initialize()
@@ -214,13 +217,17 @@ impl Client {
// TODO: delay any requests that are triggered prior to initialize
let root = find_root(None).and_then(|root| lsp::Url::from_file_path(root).ok());
+ if self.config.is_some() {
+ log::info!("Using custom LSP config: {}", self.config.as_ref().unwrap());
+ }
+
#[allow(deprecated)]
let params = lsp::InitializeParams {
process_id: Some(std::process::id()),
// root_path is obsolete, use root_uri
root_path: None,
root_uri: root,
- initialization_options: None,
+ initialization_options: self.config.clone(),
capabilities: lsp::ClientCapabilities {
text_document: Some(lsp::TextDocumentClientCapabilities {
completion: Some(lsp::CompletionClientCapabilities {