Similarly to function prototypes, it shows the tooltip in a language specific way. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2036
-- Commit Summary --
* Show variable type in a tooltip in symbol tree
-- File Changes --
M src/symbols.c (12)
-- Patch Links --
https://github.com/geany/geany/pull/2036.patch https://github.com/geany/geany/pull/2036.diff
We do this for functions already and showing type for variables as well can be useful.
b4n commented on this pull request.
@@ -908,6 +908,18 @@ static gchar *get_symbol_tooltip(GeanyDocument *doc, const TMTag *tag)
{ gchar *utf8_name = editor_get_calltip_text(doc->editor, tag);
+ if (!utf8_name && tag->var_type && + tag->type & (tm_tag_member_t | tm_tag_variable_t | tm_tag_externvar_t))
Is the type check guarding against actual issues, or is it just being careful? I can imagine it might be a problem with typedefs, but it might erroneously omit `tm_tag_field_t` (not 100% sure what that is, but it's used by several parsers, and I believe for Vala it's variable members). Not a blocker though, we can amend this as needed.
techee commented on this pull request.
@@ -908,6 +908,18 @@ static gchar *get_symbol_tooltip(GeanyDocument *doc, const TMTag *tag)
{ gchar *utf8_name = editor_get_calltip_text(doc->editor, tag);
+ if (!utf8_name && tag->var_type && + tag->type & (tm_tag_member_t | tm_tag_variable_t | tm_tag_externvar_t))
Yeah, this was to make sure these are only variable-like tags but I forgot tm_tag_field_t which I've just added. Maybe these checks aren't completely necessary because varType won't be set for anything else than functions and variables but if anything else, it makes it more clear in the code what we are doing.
Merged #2036 into master.
github-comments@lists.geany.org