anjuta r4556 - in trunk: . plugins/sourceview plugins/symbol-db



Author: mcora
Date: Fri Jan  9 20:04:45 2009
New Revision: 4556
URL: http://svn.gnome.org/viewvc/anjuta?rev=4556&view=rev

Log:
	* plugins/symbol-db/plugin.c (goto_file_tag):
	fixed #567058 â Goto Implementation can't jump to struct or typedef types
	fixed #566690 â Goto declaration menu item should go to implementation if 
	there's no delcaration

	* plugins/symbol-db/symbol-db-engine-core.c (sdb_engine_finalize),
	(symbol_db_engine_close_db):
	fixed #567067 â Anjuta hangs if I close project while scanning symbols

	* plugins/sourceview/sourceview.c (wordcharacters_contains):
	fixed #567049 â Goto Definition fails for symbols ending in a digit


Modified:
   trunk/ChangeLog
   trunk/plugins/sourceview/sourceview.c
   trunk/plugins/symbol-db/plugin.c
   trunk/plugins/symbol-db/symbol-db-engine-core.c

Modified: trunk/plugins/sourceview/sourceview.c
==============================================================================
--- trunk/plugins/sourceview/sourceview.c	(original)
+++ trunk/plugins/sourceview/sourceview.c	Fri Jan  9 20:04:45 2009
@@ -918,7 +918,7 @@
 wordcharacters_contains (gchar c)
 {
 	const gchar* wordcharacters =
-		"_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+		"_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 	gint pos;
 	
 	for (pos = 0; pos < strlen(wordcharacters); pos++)

Modified: trunk/plugins/symbol-db/plugin.c
==============================================================================
--- trunk/plugins/symbol-db/plugin.c	(original)
+++ trunk/plugins/symbol-db/plugin.c	Fri Jan  9 20:04:45 2009
@@ -119,38 +119,73 @@
 			   gboolean prefer_implementation)
 {
 	SymbolDBEngineIterator *iterator;	
+	gboolean found;
 	iterator = symbol_db_engine_find_symbol_by_name_pattern (sdb_plugin->sdbe_project, 
 															 word,
 															 SYMINFO_SIMPLE |
 											   				 SYMINFO_KIND |
 															 SYMINFO_FILE_PATH);
-	do {
-		const gchar *symbol_kind;
+	
+	if (iterator == NULL || symbol_db_engine_iterator_get_n_items (iterator) <= 0)
+	{
+		if (iterator)
+			g_object_unref (iterator);
+		return;
+	}
+	
+	found = FALSE;
+	
+	/* FIXME: namespaces are not handled here, but they should. */
+	
+	if (prefer_implementation == FALSE)
+	{
+		do 
+		{
+			const gchar *symbol_kind;
+			SymbolDBEngineIteratorNode *iter_node; 
+			iter_node = SYMBOL_DB_ENGINE_ITERATOR_NODE (iterator);			
+
+			/* not found or some error occurred */
+			if (iter_node == NULL)
+				break;
+
+			symbol_kind = symbol_db_engine_iterator_node_get_symbol_extra_string (
+						iter_node, SYMINFO_KIND);				
+		
+			if (g_strcmp0 (symbol_kind, "prototype") == 0)			
+			{
+				gint line = 
+					symbol_db_engine_iterator_node_get_symbol_file_pos (iter_node);
+				const gchar* file = 
+					symbol_db_engine_iterator_node_get_symbol_extra_string (iter_node,
+													SYMINFO_FILE_PATH);
+				goto_file_line (ANJUTA_PLUGIN (sdb_plugin), file, line);
+				found = TRUE;
+				break;
+			}
+		} while (symbol_db_engine_iterator_move_next (iterator) == TRUE);	
+	}
+	
+	/* still not found? Try with implementation (see bug #566690) */
+	if (found == FALSE)
+	{
+		/* reset iterator position. */
+		symbol_db_engine_iterator_first (iterator);
 		SymbolDBEngineIteratorNode *iter_node; 
 		iter_node = SYMBOL_DB_ENGINE_ITERATOR_NODE (iterator);			
 
 		/* not found or some error occurred */
-		if (iter_node == NULL)
-			break;
-
-		symbol_kind = symbol_db_engine_iterator_node_get_symbol_extra_string (
-					iter_node, SYMINFO_KIND);				
-		
-		if ((prefer_implementation == FALSE && g_strcmp0 (symbol_kind, "prototype") == 0) ||
-			(prefer_implementation == TRUE && g_strcmp0 (symbol_kind, "function") == 0) ||
-			(prefer_implementation == TRUE && g_strcmp0 (symbol_kind, "macro") == 0))
+		if (iter_node != NULL)
 		{
 			gint line = 
 				symbol_db_engine_iterator_node_get_symbol_file_pos (iter_node);
 			const gchar* file = 
 				symbol_db_engine_iterator_node_get_symbol_extra_string (iter_node,
-													SYMINFO_FILE_PATH);
+												SYMINFO_FILE_PATH);
 			goto_file_line (ANJUTA_PLUGIN (sdb_plugin), file, line);
-			break;
 		}
-
-	} while (symbol_db_engine_iterator_move_next (iterator) == TRUE);	
-	
+	}
+		
 	if (iterator)
 		g_object_unref (iterator);
 }

Modified: trunk/plugins/symbol-db/symbol-db-engine-core.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-engine-core.c	(original)
+++ trunk/plugins/symbol-db/symbol-db-engine-core.c	Fri Jan  9 20:04:45 2009
@@ -2405,7 +2405,7 @@
 	
 	if (priv->thread_pool)
 	{
-		g_thread_pool_free (priv->thread_pool, FALSE, TRUE);
+		g_thread_pool_free (priv->thread_pool, TRUE, TRUE);
 		priv->thread_pool = NULL;
 	}
 	
@@ -2883,7 +2883,7 @@
 	priv = dbe->priv;
 	
 	/* terminate threads, if ever they're running... */
-	g_thread_pool_free (priv->thread_pool, FALSE, TRUE);
+	g_thread_pool_free (priv->thread_pool, TRUE, TRUE);
 	priv->thread_pool = g_thread_pool_new (sdb_engine_ctags_output_thread,
 										   dbe, THREADS_MAX_CONCURRENT,
 										   FALSE, NULL);



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