Capabilities for LSP extensions (#1340)

Clients sending textDocument/build to a server that doesn't support
it may receive an error.  In a multi-server setup, users expect to
send the message only to servers that support it.  Add a capability
to enable this use case.

Closes #1328
This commit is contained in:
Johannes Altmanninger 2025-02-12 17:55:33 +01:00 committed by GitHub
parent 29bdb931e8
commit 1f2c9d7c47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,6 +23,7 @@ use notify_debouncer_full::{DebouncedEvent, Debouncer, RecommendedCache};
use parking_lot::{Mutex, RwLock};
use rustc_hash::FxHashSet;
use serde::{de::DeserializeOwned, Serialize};
use serde_json::{Map, Value};
use threadpool::ThreadPool;
use crate::{
@ -174,6 +175,13 @@ impl Server {
..Default::default()
}),
inlay_hint_provider: Some(OneOf::Left(true)),
experimental: Some(Value::Object(Map::from_iter(
[
("textDocumentBuild".to_string(), Value::Bool(true)),
("textDocumentForwardSearch".to_string(), Value::Bool(true)),
]
.into_iter(),
))),
..ServerCapabilities::default()
}
}