[Github-comments] [geany/geany] Sync ctags with upstream so that most parsers can be copied from uctags (#2018)

Jiří Techet notifications at xxxxx
Mon Jan 14 17:12:10 UTC 2019


techee commented on this pull request.



> @@ -2742,8 +2793,12 @@ extern void anonGenerate (vString *buffer, const char *prefix, int kind)
 
 	vStringCopyS(buffer, prefix);
 
-	unsigned int uHash = anonHash((const unsigned char *)getInputFileName());
-	sprintf(szNum,"%08x%02x%02x",uHash,lang -> anonumousIdentiferId, kind);
+/* GEANY DIFF */
+/*	unsigned int uHash = anonHash((const unsigned char *)getInputFileName());
+	sprintf(szNum,"%08x%02x%02x",uHash,lang -> anonumousIdentiferId, kind); */
+	sprintf(szNum,"%u", lang -> anonumousIdentiferId);

The problem with it is that in the symbol tree you'll see anonymous types like:

```
anon_enum_162324ab457c
anon_enum_8734cb98f023
anon_enum_fc820958ba67
```

instead of

```
anon_enum_1
anon_enum_2
anon_enum_3
```

and the latter is nicer for users.

We already detect whether a tag is anonymous in tm_tag_is_anon() and don't perform autocompletion for it so there's no problem with the same anonymous names from different files.

Even this is not perfect - `anonumousIdentiferId` is used for all anonymous types so we'll get things like

```
anon_enum_1
anon_struct_2
anon_enum_3
```

and it would be nicer to have

```
anon_enum_1
anon_struct_1
anon_enum_2
```

But in the new cxx parser the anonymous name isn't different for individual types and the above would be

```
Anonymous1
Anonymous2
Anonymous3
```

so at least for C and C++ this problem will disappear.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2018#discussion_r247578452
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190114/da085c4e/attachment.html>


More information about the Github-comments mailing list