lsp: Add support for clangd's inactiveRegions
extension (#26146)
Closes #13089 Here we use `experimental` to advertise our support for `inactiveRegions`. Note that clangd does not currently have a stable release that reads the `experimental` object (PR https://github.com/llvm/llvm-project/pull/116531), this can be tested with one of clangd's recent "unstable snapshots" in their [releases](https://github.com/clangd/clangd/releases). Release Notes: - Added support for clangd's `inactiveRegions` extension.  --------- Co-authored-by: Peter Tripp <peter@zed.dev> Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
parent
af5af9d7c5
commit
829ecda370
9 changed files with 174 additions and 82 deletions
|
@ -299,34 +299,6 @@ pub struct AdapterServerCapabilities {
|
|||
pub code_action_kinds: Option<Vec<CodeActionKind>>,
|
||||
}
|
||||
|
||||
/// Experimental: Informs the end user about the state of the server
|
||||
///
|
||||
/// [Rust Analyzer Specification](https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#server-status)
|
||||
#[derive(Debug)]
|
||||
pub enum ServerStatus {}
|
||||
|
||||
/// Other(String) variant to handle unknown values due to this still being experimental
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum ServerHealthStatus {
|
||||
Ok,
|
||||
Warning,
|
||||
Error,
|
||||
Other(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ServerStatusParams {
|
||||
pub health: ServerHealthStatus,
|
||||
pub message: Option<String>,
|
||||
}
|
||||
|
||||
impl lsp_types::notification::Notification for ServerStatus {
|
||||
type Params = ServerStatusParams;
|
||||
const METHOD: &'static str = "experimental/serverStatus";
|
||||
}
|
||||
|
||||
impl LanguageServer {
|
||||
/// Starts a language server process.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue