MCPcopy Create free account
hub / github.com/concensure/Semantic / initialize

Method initialize

semantic_rust/src/rust_analyzer.rs:116–140  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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);

Callers 2

workspace_symbol_searchFunction · 0.80
document_symbol_searchFunction · 0.80

Calls 3

path_to_file_uriFunction · 0.85
requestMethod · 0.80
notifyMethod · 0.80

Tested by

no test coverage detected