[gnome-builder] langserv: don't submit results if op was cancelled



commit d1e8ce7da1b5bc71042b436ab6349c9da1fde7a9
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jan 13 18:56:03 2018 -0800

    langserv: don't submit results if op was cancelled
    
    If the operation was cancelled, then the context is not expecting us to
    submit our results. Short cirtcuit immediately when we detect this.

 src/libide/langserv/ide-langserv-completion-provider.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/langserv/ide-langserv-completion-provider.c 
b/src/libide/langserv/ide-langserv-completion-provider.c
index f258819c9..8b0be2d6c 100644
--- a/src/libide/langserv/ide-langserv-completion-provider.c
+++ b/src/libide/langserv/ide-langserv-completion-provider.c
@@ -244,8 +244,12 @@ ide_langserv_completion_provider_complete_cb (GObject      *object,
 
   if (!ide_langserv_client_call_finish (client, result, &return_value, &error))
     {
-      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
-        g_message ("%s", error->message);
+      /* If we were cancelled, we shouldn't report anything to the context,
+       * as it is no longer the active contenxt for completion.
+       */
+      if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+        IDE_EXIT;
+      g_debug ("%s", error->message);
       IDE_GOTO (failure);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]