MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / initialize

Method initialize

crates/opencode-lsp/src/lib.rs:250–271  ·  view source on GitHub ↗
(&mut self, initialization_options: Option<Value>)

Source from the content-addressed store, hash-verified

248 }
249
250 async fn initialize(&mut self, initialization_options: Option<Value>) -> Result<(), LspError> {
251 let workspace_uri = path_to_uri(&self.root)?;
252
253 let params = InitializeParams {
254 initialization_options,
255 workspace_folders: Some(vec![WorkspaceFolder {
256 uri: workspace_uri,
257 name: "workspace".to_string(),
258 }]),
259 capabilities: ClientCapabilities::default(),
260 ..Default::default()
261 };
262
263 let result = self
264 .request("initialize", serde_json::to_value(params)?)
265 .await?;
266 debug!(?result, "LSP initialized");
267
268 self.notify("initialized", Value::Null).await?;
269
270 Ok(())
271 }
272
273 async fn next_id(&self) -> u64 {
274 let mut id = self.request_id.lock().await;

Callers 1

startMethod · 0.45

Calls 3

path_to_uriFunction · 0.85
requestMethod · 0.80
notifyMethod · 0.80

Tested by

no test coverage detected