Skip to content

Commit

Permalink
Remove symbols when sentence deleted.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtetley committed Jul 12, 2024
1 parent 29f1f95 commit a3e8b67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion language-server/dm/document.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ let remove_sentence parsed id =
| Some sentence ->
let sentences_by_id = SM.remove id parsed.sentences_by_id in
let sentences_by_end = LM.remove sentence.stop parsed.sentences_by_end in
let outline = List.filter (fun (e : outline_element) -> e.id != id) parsed.outline in
(* TODO clean up the schedule and free cached states *)
{ parsed with sentences_by_id; sentences_by_end; }
{ parsed with sentences_by_id; sentences_by_end; outline }

let sentences parsed =
List.map snd @@ SM.bindings parsed.sentences_by_id
Expand Down
4 changes: 2 additions & 2 deletions language-server/vscoqtop/lspManager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ let documentSymbol id params =
let Lsp.Types.DocumentSymbolParams.{ textDocument = {uri}} = params in
match Hashtbl.find_opt states (DocumentUri.to_path uri) with
| None -> log @@ "[documentSymbol] ignoring event on non existant document"; Error("Document does not exist"), []
| Some st -> log @@ "[documentSymbol] getting symbols";
let symbols = Dm.DocumentManager.get_document_symbols st in
| Some tab -> log @@ "[documentSymbol] getting symbols";
let symbols = Dm.DocumentManager.get_document_symbols tab.st in
Ok(Some (`DocumentSymbol symbols)), []

let coqtopResetCoq id params =
Expand Down

0 comments on commit a3e8b67

Please sign in to comment.