| 260 | |
| 261 | #[instrument] |
| 262 | fn on_did_open_text_document(&self, req: lsp_types::DidOpenTextDocumentParams) { |
| 263 | let uri = req.text_document.uri; |
| 264 | let source_text = req.text_document.text; |
| 265 | let mut doc = File::new(); |
| 266 | let mut rope = doc.content.clone(); |
| 267 | rope.remove(0..); |
| 268 | rope.insert(0, &source_text); |
| 269 | trace!("comitting new document {:?} {:?}", &uri, rope); |
| 270 | doc.commit(rope); |
| 271 | self.files.clone().insert(uri, doc); |
| 272 | } |
| 273 | |
| 274 | #[instrument] |
| 275 | fn on_did_change_text_document(&self, req: lsp_types::DidChangeTextDocumentParams) { |