2829: Log client info if present r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
bors[bot] 2020-01-13 21:44:20 +00:00 committed by GitHub
commit d8d8c20077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,10 @@ fn run_server() -> Result<()> {
let initialize_params = connection.initialize(server_capabilities)?;
let initialize_params: lsp_types::InitializeParams = serde_json::from_value(initialize_params)?;
if let Some(client_info) = initialize_params.client_info {
log::info!("Client '{}' {}", client_info.name, client_info.version.unwrap_or_default());
}
let cwd = std::env::current_dir()?;
let root = initialize_params.root_uri.and_then(|it| it.to_file_path().ok()).unwrap_or(cwd);