-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a928034
commit 335ccba
Showing
5 changed files
with
100 additions
and
68 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,14 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use lsp_types::{HoverProviderCapability, InitializeResult, ServerCapabilities, ServerInfo}; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct InitalizeParams { | ||
client_info: Option<ClientInfo>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct ClientInfo { | ||
pub name: String, | ||
pub version: Option<String>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct InitializeResponse { | ||
capabilities: ServerCapabilities, | ||
server_info: ServerInfo, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ServerCapabilities { | ||
hover_provider: Option<bool>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ServerInfo { | ||
name: String, | ||
version: String, | ||
} | ||
|
||
pub fn handle_initialize() -> InitializeResponse { | ||
InitializeResponse { | ||
pub fn handle_initialize() -> InitializeResult { | ||
InitializeResult { | ||
capabilities: ServerCapabilities { | ||
hover_provider: Some(true), | ||
hover_provider: Some(HoverProviderCapability::Simple(true)), | ||
..Default::default() | ||
}, | ||
server_info: ServerInfo { | ||
server_info: Some(ServerInfo { | ||
name: "Son of Anton".to_string(), | ||
version: env!("CARGO_PKG_VERSION").to_string(), | ||
}, | ||
version: Some(env!("CARGO_PKG_VERSION").to_string()), | ||
}), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters