There are several problems with how we handle anonymous tags which this pull request tries to resolve:
1. Anonymous tags are currently determined based on how these tags are named by ctags which may not be completely reliable and unnecessary. ctags now has XTAG_ANONYMOUS flag we can query and determine whether a tag is anonymous or not based on that. Our fortran parser didn't report XTAG_ANONYMOUS so it has been updated to do so. 2. In order to store the information about anonymous tags, this pull request renames the unused `pointerOrder` member of TMTag (see the corresponding commit about more details to `flags` and uses one bit to indicate whether a tag is anonymous. This is technically a API change but since pointerOrder always contained 0 and was unused (or maybe used by some super-old parser 15 years back), it doesn't really matter (no g-p plugin uses this field). 3. With the introduction of the new cxx parser, anonymous tags are reported as `__anonNUM` - before they were reported as e.g `anon_struct_NUM` - i.e. they contained information about the type in their name which made them easier to identify in the symbol tree. This pull request adds back this naming. 4. In addition to (3), the NUM in the previous parser was global for all types - i.e. tags were named as `anon_enum_1`, `anon_struct_2`, `anon_enum_3` which is a bit strange as it suggests there are 3 enums but there are 2 instead. This pull request makes these numbers per-type so the above becomes `anon_enum_1`, `anon_struct_1`, `anon_enum_2`. 5. This pull request sets the name of anonymous tag if it's followed by the corresponding typedef tag and the typedef tag is removed. For instance, for `typedef struct{int a} Foo;` you would previously get an anonymous tag for the struct under which `a` would be shown and then separately tag `Foo` as a typedef. After this patch, you get a tag `Foo` for the struct with `a` as its member and the anonymous name is dropped which makes things much clearer in the sidebar.
And finally, thanks to the fact that we do renaming of anonymous tags ourselves now, the last diff against ctags main can be dropped so we can use the upstream version without any modifications and the patch file isn't necessary any more. Hurray!!! You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3059
-- Commit Summary --
* Rename pointerOrder TMtag member to flags * Use XTAG_ANONYMOUS in Fortran parser * Add a flag representing anonymous tags * Determine anonymous tags based on name only when necessary * Consistently rename anonymous tags and drop the last ctags diff * Add type information to anonymous tags * Rename anon types based on the typedef name if present
-- File Changes --
D ctags/ctags_changes.patch (24) M ctags/main/parse.c (6) M ctags/parsers/geany_fortran.c (6) M src/editor.c (6) M src/tagmanager/tm_ctags.c (147) M src/tagmanager/tm_parser.c (22) M src/tagmanager/tm_parser.h (2) M src/tagmanager/tm_source_file.c (23) M src/tagmanager/tm_tag.c (16) M src/tagmanager/tm_tag.h (13) M src/tagmanager/tm_workspace.c (6)
-- Patch Links --
https://github.com/geany/geany/pull/3059.patch https://github.com/geany/geany/pull/3059.diff
@techee pushed 2 commits.
532cd4634dd2dd8653b866cb8ad22dba3f856d6e Remove now unnecessary patching of ctags main by update-ctags.py 3d3e9c7f737fa5dabd976d9f27a350e24aa20c5c Update unit tests with the anonymous tag changes
This is technically a API change but since pointerOrder always contained 0 and was unused (or maybe used by some super-old parser 15 years back), it doesn't really matter (no g-p plugin uses this field).
Its an API addition so bump it, increasing APIs is no problem, the previous field was uncommented so it _should_ not have been used by plugins and its not an ABI change so long as it remains the same field type.
@techee pushed 1 commit.
04b7b272858520113ccba8342696be08778884ce Bump API for the pointerOrder change to flags
Its an API addition so bump it, increasing APIs is no problem, the previous field was uncommented so it should not have been used by plugins and its not an ABI change so long as it remains the same field type.
Good point, done.
I havn't looked at the details yet.
But points 1 and 2 sound sane.
Points 3 and 4 sound useful so long as the kind[^1] is right.
Point 5 would be a good improvement, the disconnect between the struct and the typedef was annoying. What happens with this if a declaration that has both the struct name and the typedef?
[^1]: using "kind" in the common type theory meaning of "classification system for types" eg "struct" "class" etc
@kugel- requested changes on this pull request.
@@ -818,6 +818,28 @@ void tm_parser_verify_type_mappings(void)
}
+/* determine anonymous tags from tag names only when corresponding + * ctags information is not available */ +gboolean tm_parser_is_anon_name(TMParserType lang, gchar *name) +{ + guint i; + char dummy; + + if (lang == TM_PARSER_C || lang == TM_PARSER_CPP) + { + return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1 ||
Does sscanf really understand regexes? This is also new over the old code in `tm_tag_is_anon()`
@@ -695,7 +695,7 @@ static void fill_find_tags_array_prefix(GPtrArray *dst, const GPtrArray *src,
for (i = 0; i < count && num < max_num; ++i) { if (tm_parser_langs_compatible(lang, (*tag)->lang) && - !tm_tag_is_anon(*tag) && + !((*tag)->flags & tm_tag_flag_anon_t) &&
IMO the this is not an improvement. Might keep `tm_tag_is_anon()` and reduce its implementation to just test the flag
@@ -51,6 +51,3 @@
main_diff = set(main_src_files) - set(main_dst_files) if main_diff: print('Files added to main: ' + str(main_diff)) - -os.chdir(dstdir) -os.system('patch -p1 <ctags_changes.patch')
yay
@@ -120,7 +120,15 @@ static gboolean init_tag(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag
tag->name = g_strdup(tag_entry->name); tag->type = type; tag->local = tag_entry->isFileScope; - tag->pointerOrder = 0; /* backward compatibility (use var_type instead) */ + tag->flags = tm_tag_flag_none_t; + if (isTagExtraBitMarked(tag_entry, XTAG_ANONYMOUS)) + { + tag->flags |= tm_tag_flag_anon_t; + /* Temporarily store kind letter for anon name generation to flags + * as we don't have any other place where to store it. This will + * be cleared later in rename_anon_tags() */ + tag->flags |= (guint)kind_letter << 16;
Can't you just add a member to `TMTag` instead of this workaround?
/* set the name of the original anon tag and pretend
+ * it wasn't a anon tag */ + tag->name = g_strdup(typedef_tag->name); + tag->flags &= ~tm_tag_flag_anon_t; + new_name = tag->name; + /* the typedef tag will be removed */ + g_ptr_array_add(removed_typedefs, GUINT_TO_POINTER(j)); + } + } + } + + /* there's no typedef name for the anon tag so let's generate one */ + if (!new_name) + { + gchar buf[50]; + guint anon_counter = GPOINTER_TO_UINT(g_hash_table_lookup(anon_counter_table, kind_name));
I think a hash_table is a overweight here. Since `kind` is in the range 0...255 a simple array would sufficie
guint anon_counter = anon_counter_table[kind]++;
Alternatively, you could use a hash table that uses `kind` as the key and not a more expensive hash of `kind_name`
if (nested_scope_len <= scope_len)
+ break; + + pos = strstr(nested_tag->scope, orig_name); + /* We found the parent name in the nested tag scope - replace it + * with the new name. Note: anonymous tag names generated by + * ctags are unique enough that we don't have to check for + * scope separators here. */ + if (pos) + { + gchar *str = g_malloc(nested_scope_len + 50); + guint prefix_len = pos - nested_tag->scope; + + strncpy(str, nested_tag->scope, prefix_len); + strcpy(str + prefix_len, new_name); + strcpy(str + prefix_len + new_name_len, pos + orig_name_len);
Such string building could use `asprintf()` (not requesting a change here; also I see that GLIB only provides `g_vasprintf()` but not `g_asprintf()`, very strange)
@@ -11,6 +9,8 @@ Named5
Named6�2�Constants�0 Named7�2�Constants�0 a�4�Enum#1�0 +anon_enum_1�2�Constants�1 +anon_enum_2�2�Constants�1
I wonder if the new naming is really appreciated by Fortran users? I guess we'll see ;-)
+{
+ guint i; + char dummy; + + if (lang == TM_PARSER_C || lang == TM_PARSER_CPP) + { + return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1 || + sscanf(name, "__anon%u%c", &i, &dummy) == 1; + } + else if (lang == TM_PARSER_FORTRAN || lang == TM_PARSER_F77) + { + return sscanf(name, "Structure#%u%c", &i, &dummy) == 1 || + sscanf(name, "Interface#%u%c", &i, &dummy) == 1 || + sscanf(name, "Enum#%u%c", &i, &dummy) == 1; + } + return FALSE;
The unit test files for java script indicate that the naming is changed. Why is that not handled here (I know it also wasn't in the old `tm_tag_is_anon()` but I would like to understand why)?
@elextr commented on this pull request.
@@ -818,6 +818,28 @@ void tm_parser_verify_type_mappings(void)
}
+/* determine anonymous tags from tag names only when corresponding + * ctags information is not available */ +gboolean tm_parser_is_anon_name(TMParserType lang, gchar *name) +{ + guint i; + char dummy; + + if (lang == TM_PARSER_C || lang == TM_PARSER_CPP) + { + return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1 ||
Yes on [Linux](https://man7.org/linux/man-pages/man3/scanf.3.html) but IIUC its not portable, especially `a-z` meaning lower case ASCII alphabetic, see [here](https://en.cppreference.com/w/c/io/fscanf)
Points 3 and 4 sound useful so long as the kind1 is right.
This in fact is the ctags 'kind' but it should be the kind as ordinary humans understand it. For instance, when you check the cxx parser here in the 3rd column, it is what you would expect to see:
https://github.com/geany/geany/blob/5ea3e3ec77eaa87ff709f003743dbb80285e3b6f...
Point 5 would be a good improvement, the disconnect between the struct and the typedef was annoying. What happens with this if a declaration that has both the struct name and the typedef?
Both will be kept. This pull request addresses just the anonymous tags and in this case the struct isn't anonymous.
@kugel- Thanks for the review! I'll go through the points now.
@techee commented on this pull request.
@@ -818,6 +818,28 @@ void tm_parser_verify_type_mappings(void)
}
+/* determine anonymous tags from tag names only when corresponding + * ctags information is not available */ +gboolean tm_parser_is_anon_name(TMParserType lang, gchar *name) +{ + guint i; + char dummy; + + if (lang == TM_PARSER_C || lang == TM_PARSER_CPP) + { + return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1 ||
This code actually was there before the new cxx parser was merged. In the cxx pull request I changed it to `__anon` detection only but then thought there might be some old tag files around so better to use the previous checks too (plus now we get anonymous tags in this format again). Since it worked before, I guess it's OK.
@techee commented on this pull request.
@@ -695,7 +695,7 @@ static void fill_find_tags_array_prefix(GPtrArray *dst, const GPtrArray *src,
for (i = 0; i < count && num < max_num; ++i) { if (tm_parser_langs_compatible(lang, (*tag)->lang) && - !tm_tag_is_anon(*tag) && + !((*tag)->flags & tm_tag_flag_anon_t) &&
Yeah, you are right, looking at it now side by side, this is much less readable. Will fix.
@techee commented on this pull request.
@@ -120,7 +120,15 @@ static gboolean init_tag(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag
tag->name = g_strdup(tag_entry->name); tag->type = type; tag->local = tag_entry->isFileScope; - tag->pointerOrder = 0; /* backward compatibility (use var_type instead) */ + tag->flags = tm_tag_flag_none_t; + if (isTagExtraBitMarked(tag_entry, XTAG_ANONYMOUS)) + { + tag->flags |= tm_tag_flag_anon_t; + /* Temporarily store kind letter for anon name generation to flags + * as we don't have any other place where to store it. This will + * be cleared later in rename_anon_tags() */ + tag->flags |= (guint)kind_letter << 16;
I wasn't sure if it was OK to add new members to TMTag when it's exposed to plugins. I guess ABI should be bumped in this case?
But I think having the original ctags kind letter would be useful to have in TMTag because once we map it to our `TMTagType` representation, there's no way back to get the original kind. This might be needed if we decide to generate tags files in the ctags format.
@kugel- commented on this pull request.
@@ -120,7 +120,15 @@ static gboolean init_tag(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag
tag->name = g_strdup(tag_entry->name); tag->type = type; tag->local = tag_entry->isFileScope; - tag->pointerOrder = 0; /* backward compatibility (use var_type instead) */ + tag->flags = tm_tag_flag_none_t; + if (isTagExtraBitMarked(tag_entry, XTAG_ANONYMOUS)) + { + tag->flags |= tm_tag_flag_anon_t; + /* Temporarily store kind letter for anon name generation to flags + * as we don't have any other place where to store it. This will + * be cleared later in rename_anon_tags() */ + tag->flags |= (guint)kind_letter << 16;
I think it was discussed elsewhere, appending members is generally OK without bumping the ABI.
But I wouldn't fear ABI bumps anyway. For most users those go unnoticed because they just get their recompiled plugins from their distro, it's just a minor inconvenience for those who compile the plugins themselves.
@techee commented on this pull request.
/* set the name of the original anon tag and pretend
+ * it wasn't a anon tag */ + tag->name = g_strdup(typedef_tag->name); + tag->flags &= ~tm_tag_flag_anon_t; + new_name = tag->name; + /* the typedef tag will be removed */ + g_ptr_array_add(removed_typedefs, GUINT_TO_POINTER(j)); + } + } + } + + /* there's no typedef name for the anon tag so let's generate one */ + if (!new_name) + { + gchar buf[50]; + guint anon_counter = GPOINTER_TO_UINT(g_hash_table_lookup(anon_counter_table, kind_name));
Good point, will change. I was also thinking I could allocate the `removed_typedefs` GPtrArray lazily if needed so it isn't allocated every time (and unnecessarily for most languages).
@techee commented on this pull request.
@@ -11,6 +9,8 @@ Named5
Named6�2�Constants�0 Named7�2�Constants�0 a�4�Enum#1�0 +anon_enum_1�2�Constants�1 +anon_enum_2�2�Constants�1
Yeah. But the new naming is now universal for all languages and we won't need to handle each of them separately. Hopefully none of the 2 users who use Geany for Fortran coding will complain ;-).
@techee commented on this pull request.
+{
+ guint i; + char dummy; + + if (lang == TM_PARSER_C || lang == TM_PARSER_CPP) + { + return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1 || + sscanf(name, "__anon%u%c", &i, &dummy) == 1; + } + else if (lang == TM_PARSER_FORTRAN || lang == TM_PARSER_F77) + { + return sscanf(name, "Structure#%u%c", &i, &dummy) == 1 || + sscanf(name, "Interface#%u%c", &i, &dummy) == 1 || + sscanf(name, "Enum#%u%c", &i, &dummy) == 1; + } + return FALSE;
Basically we should now always get the anon flag in our tags file (notice the `1` at the end) so it should be needed only for legacy tags files. But it's true we should probably check for the `__anon` name in case we read tags in the ctags file format and this file is generated without the `E` field.
@techee pushed 4 commits.
19ed47dcc2f89dede001e8767c428cd7e8203e02 Use ordinary array instead of hash table for anon_counter_table 97fb288576ba078dd55a9f69eda2a2a6a0e3a9f6 Allocate removed_typedefs only if needed b21bcde78a4ba2bebed2cb9b4be714ee5dcb8762 Add kind_letter to TMTag and use it in rename_anon_tags() daef7bc742101bb80c66e885bd3c2d27a94db18c Re-introduce tm_tag_is_anon() as it's easier to read than checking the flags
@techee pushed 1 commit.
0cc156fe1d6fb2a7342fe75c844dd48e3fee5375 Detect anonymous tags based on __anon name for all languages
@kugel- commented on this pull request.
if (!removed_typedefs)
+ removed_typedefs = g_ptr_array_new(); + g_ptr_array_add(removed_typedefs, GUINT_TO_POINTER(j)); + } + } + } + + /* there's no typedef name for the anon tag so let's generate one */ + if (!new_name) + { + gchar buf[50]; + guint anon_counter; + const gchar *kind_name = tm_ctags_get_kind_name(kind, tag->lang); + + if (!anon_counter_table) + anon_counter_table = g_new0(gchar, 256);
Err, well, I thought of simply placing the array on the stack (at the function begin). I'm also not sure if 8 bit counter will suit everyone. I think generated sources (from a large vala file or someting like that) could easily overflow 256 anon structs.
I think a `gint anon_counter_table[256]` should work.
@@ -818,6 +818,28 @@ void tm_parser_verify_type_mappings(void)
}
+/* determine anonymous tags from tag names only when corresponding + * ctags information is not available */ +gboolean tm_parser_is_anon_name(TMParserType lang, gchar *name) +{ + guint i; + char dummy; + + if (lang == TM_PARSER_C || lang == TM_PARSER_CPP) + { + return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1 ||
Agree
@@ -11,6 +9,8 @@ Named5
Named6�2�Constants�0 Named7�2�Constants�0 a�4�Enum#1�0 +anon_enum_1�2�Constants�1 +anon_enum_2�2�Constants�1
Yea, lets see if there's any (negative) feedback.
+{
+ guint i; + char dummy; + + if (lang == TM_PARSER_C || lang == TM_PARSER_CPP) + { + return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1 || + sscanf(name, "__anon%u%c", &i, &dummy) == 1; + } + else if (lang == TM_PARSER_FORTRAN || lang == TM_PARSER_F77) + { + return sscanf(name, "Structure#%u%c", &i, &dummy) == 1 || + sscanf(name, "Interface#%u%c", &i, &dummy) == 1 || + sscanf(name, "Enum#%u%c", &i, &dummy) == 1; + } + return FALSE;
But what about existing tag files for java script? ```diff -AnonymousFunction2�16�(n)�class3.c3m1�0 +anon_function_1�16�()�class2.c2m1�1 ```
@techee commented on this pull request.
if (!removed_typedefs)
+ removed_typedefs = g_ptr_array_new(); + g_ptr_array_add(removed_typedefs, GUINT_TO_POINTER(j)); + } + } + } + + /* there's no typedef name for the anon tag so let's generate one */ + if (!new_name) + { + gchar buf[50]; + guint anon_counter; + const gchar *kind_name = tm_ctags_get_kind_name(kind, tag->lang); + + if (!anon_counter_table) + anon_counter_table = g_new0(gchar, 256);
Yes, but then you have to zero it manually (which will be very fast but you will have to do it every time instead of lazily like now). No problem changing it but I think it's about the same like the current code.
The `gchar` is definitely my error, I got confused by that 256 value, will correct that.
But what about existing tag files for java script?
I would maybe just keep it unhandled - this bug has been there for some time already and nobody has noticed. In addition, I think PHP parser also generates anonymous tags (they just aren't captured by our unit tests) and we didn't detect them either.
@kugel- commented on this pull request.
if (!removed_typedefs)
+ removed_typedefs = g_ptr_array_new(); + g_ptr_array_add(removed_typedefs, GUINT_TO_POINTER(j)); + } + } + } + + /* there's no typedef name for the anon tag so let's generate one */ + if (!new_name) + { + gchar buf[50]; + guint anon_counter; + const gchar *kind_name = tm_ctags_get_kind_name(kind, tag->lang); + + if (!anon_counter_table) + anon_counter_table = g_new0(gchar, 256);
I don't feel strong about array vs. g_new0, do as you chose (hint: zero-initialization of arrays: `gint foo[N] = {0}`)
But what about existing tag files for java script?
I would maybe just keep it unhandled - this bug has been there for some time already and nobody has noticed. In addition, I think PHP parser also generates anonymous tags (they just aren't captured by our unit tests) and we didn't detect them either.
I think I can go with that. What happens if we read such tag files? Some symbols might not be marked as anonymous, anything else?
@techee pushed 1 commit.
5f079a77af54308d304409eb168ec2b2000cbb91 Change anon_counter_table from gchar to gint to allow storing larger numbers
Some symbols might not be marked as anonymous
That's pretty much it. The biggest problem this can cause is that they'll appear in the autocompletion popup where they shouldn't be normally shown because this name doesn't really exist in the code.
@kugel- commented on this pull request.
@@ -94,14 +101,15 @@ typedef struct TMTag
TMSourceFile *file; /**< File in which the tag occurs; NULL for global tags */ gulong line; /**< Line number of the tag */ gboolean local; /**< Is the tag of local scope */ - guint pointerOrder; + guint flags; /**< Additional flags */
This adds Doxygen documentation for the member, which traditionally approves it for plugin use. Is that your intention? Otherwise I would add a simple comment (like with kind_letter) until someone officially requests this member to be part of the API.
@@ -836,7 +836,7 @@ find_scope_members (const GPtrArray *tags_array, const gchar *name, TMSourceFile
/* anonymous type defined in a different file than the variable - * this isn't the type we are looking for */ - if (tm_tag_is_anon(test_tag) && (file != test_tag->file || test_tag->file == NULL)) + if (tm_tag_is_anon(tag) && (file != test_tag->file || test_tag->file == NULL))
This confuses me and Github draws the indentation strangely.
Anyway, I seems wrong to do s/test_tag/tag/, don't you think?
@techee commented on this pull request.
@@ -836,7 +836,7 @@ find_scope_members (const GPtrArray *tags_array, const gchar *name, TMSourceFile
/* anonymous type defined in a different file than the variable - * this isn't the type we are looking for */ - if (tm_tag_is_anon(test_tag) && (file != test_tag->file || test_tag->file == NULL)) + if (tm_tag_is_anon(tag) && (file != test_tag->file || test_tag->file == NULL))
Dammit, I should stop coding today, I start making errors. Sure thing, this is wrong.
@techee commented on this pull request.
@@ -94,14 +101,15 @@ typedef struct TMTag
TMSourceFile *file; /**< File in which the tag occurs; NULL for global tags */ gulong line; /**< Line number of the tag */ gboolean local; /**< Is the tag of local scope */ - guint pointerOrder; + guint flags; /**< Additional flags */
This was intentional - plugins should know if a tag is anonymous (I currently don't do it right in my ProjectOrganizer plugin but in Find Tag where you can find a tag by name I should ignore anonymous tags).
I didn't do this with the kind_letter because there I really don't see much reason why plugins should look at it (and in addition, it may not always be present in the TMTag structure, for instance when the tag is read from our custom tag file format).
@techee pushed 1 commit.
921d40bdd060f635e2c9eb80978992a32b05d695 Fix incorrectly used variable ('tag' instead of 'test_tag')
Alright. I think some commits should be squashed but overall it looks good to me.
@kugel- approved this pull request.
General approval from my side but I think some later fixup commits could be squashed into the initial ones.
Alright. I think some commits should be squashed but overall it looks good to me.
Thanks a lot for your review Thomas, really appreciated!
I guess you were lucky, I usually don't find much spare time to review other people's valuable work (like yours) while working on my own topics. That's really tragical but that's life I think (with two young children).
I guess you were lucky, I usually don't find much spare time to review other people's valuable work (like yours) while working on my own topics. That's really tragical but that's life I think (with two young children).
Sadly, the same here, reviewing code just isn't much fun, especially when everyone finds something else interesting and worth the work. I should definitely contribute more in this area myself. (And I don't even have children so no excuses there.)
@elextr commented on this pull request.
@@ -120,7 +120,15 @@ static gboolean init_tag(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag
tag->name = g_strdup(tag_entry->name); tag->type = type; tag->local = tag_entry->isFileScope; - tag->pointerOrder = 0; /* backward compatibility (use var_type instead) */ + tag->flags = tm_tag_flag_none_t; + if (isTagExtraBitMarked(tag_entry, XTAG_ANONYMOUS)) + { + tag->flags |= tm_tag_flag_anon_t; + /* Temporarily store kind letter for anon name generation to flags + * as we don't have any other place where to store it. This will + * be cleared later in rename_anon_tags() */ + tag->flags |= (guint)kind_letter << 16;
@kugel- is right, add the members to the end and its not necessary to bump the ABI.
The ABI problem really only manifests itself when a distro releases Geany with a new ABI, but not the plugins at the same time (Debian has done that before).
@kugel- commented on this pull request.
@@ -120,7 +120,15 @@ static gboolean init_tag(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag
tag->name = g_strdup(tag_entry->name); tag->type = type; tag->local = tag_entry->isFileScope; - tag->pointerOrder = 0; /* backward compatibility (use var_type instead) */ + tag->flags = tm_tag_flag_none_t; + if (isTagExtraBitMarked(tag_entry, XTAG_ANONYMOUS)) + { + tag->flags |= tm_tag_flag_anon_t; + /* Temporarily store kind letter for anon name generation to flags + * as we don't have any other place where to store it. This will + * be cleared later in rename_anon_tags() */ + tag->flags |= (guint)kind_letter << 16;
Since then the Debian package implements a technical barrier, where plugins depend on the exact ABI version (so in practice its not possible to update the geany package to a conflicting version, without also updating the plugins).
This in fact is the ctags 'kind' but it should be the kind as ordinary humans understand it. For instance, when you check the cxx parser here in the 3rd column, it is what you would expect to see:
So long as it also includes `g_aCXXCPPKinds` for C++?
So long as it also includes g_aCXXCPPKinds for C++?
Yes, those are used for C++ (and for all other languages they are listed usually at the beginning of the parser).
@techee pushed 1 commit.
fc607a160b1abceda630deb8e13f654f43b30b90 Merge branch 'master' into anon4
@techee Can you cleanup the commits so it can be merged?
@techee pushed 6 commits.
9cfd7ebbf9b6f61abc874f105b926831cd55d3a2 Rename pointerOrder TMtag member to flags 8805f56bbe14b218356c3ce4c2c3e318aecef251 Use XTAG_ANONYMOUS in Fortran parser b4afb8e75bda1a648020bdea731316bf0d162b20 Add a flag representing anonymous tags ea660f8b1fab4c0da5a399db79487e56b59dc7da Determine anonymous tags based on name only when necessary dbd0ebc914d5ac56baef3fe1c28acda9d7ff3e09 Consistently rename anonymous tags and drop the last ctags diff 6f6261678fb91100269521ad5952d441d184c849 Update unit tests with the anonymous tag changes
@techee Can you cleanup the commits so it can be merged?
Done.
Merged #3059 into master.
@kugel- Yay, thanks!
github-comments@lists.geany.org