@eht16 What you do isn't the right approach. The problem is that you modify tag names of constructor_tags array which is obtained using tm_workspace_find so it points directly to the sorted tag manager array of tags. When you modify the tag name, the array isn't sorted any more which leads to unpredictable results.

But I think we don't have to modify the tags themselves, in this case we just need to modify the string we pass to the calltip. Something similar to this should work:

diff --git a/src/editor.c b/src/editor.c
index 7306418a8..c1a866616 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -1919,7 +1919,11 @@ static gchar *find_calltip(const gchar *word, GeanyFiletype *ft)
 
 		if (str == NULL)
 		{
-			gchar *f = tm_parser_format_function(tag->lang, tag->name,
+			const gchar *tag_name = tag->name;
+
+			if (constructor_method && g_strcmp0(constructor_method, tag->name) == 0)
+				tag_name = word;
+			gchar *f = tm_parser_format_function(tag->lang, tag_name,
 				tag->arglist, tag->var_type, tag->scope);
 			str = g_string_new(NULL);
 			if (calltip.tag_index > 0)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/3334/c1345672156@github.com>