diff --git a/CHANGELOG.md b/CHANGELOG.md index cc2eb0f..ad41d79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fixed + +- **LSP Workspace Symbols**: Fixed `lsp_workspace_symbols` return type to use + `Option` instead of `WorkspaceSymbolResult` for + consistency with other LSP tools + ### New Features - **Automatic Connection**: Added automatic connection feature with CLI support diff --git a/src/neovim/client.rs b/src/neovim/client.rs index 59ef30a..6e17d87 100644 --- a/src/neovim/client.rs +++ b/src/neovim/client.rs @@ -71,7 +71,7 @@ pub trait NeovimClientTrait: Sync { &self, client_name: &str, query: &str, - ) -> Result; + ) -> Result, NeovimError>; /// Get references for a symbol at a specific position async fn lsp_references( @@ -1011,14 +1011,6 @@ pub enum DocumentSymbolResult { Information(Vec), } -/// Result type for workspace symbols request -#[derive(Debug, serde::Deserialize, serde::Serialize)] -pub struct WorkspaceSymbolResult { - pub result: Option, - #[serde(flatten)] - pub unknowns: HashMap, -} - /// Prepare rename response variants #[derive(Debug, serde::Deserialize, serde::Serialize)] #[serde(untagged)] @@ -1639,7 +1631,7 @@ where &self, client_name: &str, query: &str, - ) -> Result { + ) -> Result, NeovimError> { let conn = self.connection.as_ref().ok_or_else(|| { NeovimError::Connection("Not connected to any Neovim instance".to_string()) })?; @@ -1662,7 +1654,7 @@ where .await { Ok(result) => { - match serde_json::from_str::>( + match serde_json::from_str::>>( result.as_str().unwrap(), ) { Ok(d) => d.into(),