(&mut self)
| 114 | } |
| 115 | |
| 116 | fn initialize(&mut self) -> Result<()> { |
| 117 | let root_uri = path_to_file_uri(&self.repo_root); |
| 118 | let workspace_name = self |
| 119 | .repo_root |
| 120 | .file_name() |
| 121 | .and_then(|value| value.to_str()) |
| 122 | .unwrap_or("workspace") |
| 123 | .to_string(); |
| 124 | let _ = self.request( |
| 125 | "initialize", |
| 126 | json!({ |
| 127 | "processId": null, |
| 128 | "rootUri": root_uri, |
| 129 | "capabilities": {}, |
| 130 | "clientInfo": {"name": "semantic", "version": env!("CARGO_PKG_VERSION")}, |
| 131 | "workspaceFolders": [{"uri": root_uri, "name": workspace_name}], |
| 132 | "initializationOptions": { |
| 133 | "cargo": {"buildScripts": {"enable": true}}, |
| 134 | "procMacro": {"enable": true} |
| 135 | } |
| 136 | }), |
| 137 | )?; |
| 138 | self.notify("initialized", json!({}))?; |
| 139 | Ok(()) |
| 140 | } |
| 141 | |
| 142 | fn shutdown(&mut self) -> Result<()> { |
| 143 | let _ = self.request("shutdown", Value::Null); |
no test coverage detected