diff options
| author | Pierre-Marie Pédrot | 2019-04-29 14:55:51 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-01-16 22:11:31 +0100 |
| commit | 3cc91ec4d768bffa4b1d3920d7066aafc48e3e5a (patch) | |
| tree | 66c4e681720cb59c09a8767d904afeff35d6214f | |
| parent | 025dcd0766c8801a85d5708cc96b729b513eea60 (diff) | |
Better handling of asynchronous completion.
| -rw-r--r-- | ide/wg_Completion.ml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ide/wg_Completion.ml b/ide/wg_Completion.ml index 21d794ce6e..396939cfcc 100644 --- a/ide/wg_Completion.ml +++ b/ide/wg_Completion.ml @@ -109,9 +109,11 @@ class completion_provider coqtop = let props = self#update_proposals w in self#add_proposals ctx props else + let cancel = ref false in + let _ = ctx#connect#cancelled ~callback:(fun () -> cancel := true) in let update props = let () = cache <- (start_offset, w, props) in - self#add_proposals ctx props; + if not !cancel then self#add_proposals ctx props in (* If not in the cache, we recompute it: first syntactic *) let synt = get_syntactic_completion buffer w Proposals.empty in |
