This happens with erlang files, just erlang files
Im on 1.37. If im not wrong, this didnt happened on 1.36...
It looks (erlang file): ![Screenshot_2020-11-09_09-55-08](https://user-images.githubusercontent.com/8375315/98543800-c2378780-2271-11e...)
It should look (python file): ![Screenshot_2020-11-09_09-55-25](https://user-images.githubusercontent.com/8375315/98543814-c794d200-2271-11e...)
This also happens with 1.36. The reason seems that modules are not shown in the symbols tree, and then the hierarchy is displayed directly in the tag name.
Could you try the patch below and see if it's better for you? ```diff diff --git a/src/symbols.c b/src/symbols.c index a54b6ef4c..a6192f04b 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -818,9 +818,10 @@ static void add_top_level_items(GeanyDocument *doc) break; } case GEANY_FILETYPES_D: + case GEANY_FILETYPES_ERLANG: default: { - if (ft_id == GEANY_FILETYPES_D) + if (ft_id == GEANY_FILETYPES_D || ft_id == GEANY_FILETYPES_ERLANG) tag_list_add_groups(tag_store, &(tv_iters.tag_namespace), _("Module"), ICON_NONE, NULL); else diff --git a/src/tagmanager/tm_parser.c b/src/tagmanager/tm_parser.c index 7d008e5f6..0edf5c92b 100644 --- a/src/tagmanager/tm_parser.c +++ b/src/tagmanager/tm_parser.c @@ -194,7 +194,7 @@ static TMParserMapEntry map_DOCBOOK[] = { static TMParserMapEntry map_ERLANG[] = { {'d', tm_tag_macro_t}, {'f', tm_tag_function_t}, - {'m', tm_tag_undef_t}, + {'m', tm_tag_namespace_t}, {'r', tm_tag_struct_t}, {'t', tm_tag_typedef_t}, }; ``` Gives me (with *transitive.erl* from http://www1.erlang.org/examples/examples-2.0.html): ![Erlang symbols list](https://user-images.githubusercontent.com/793526/98553719-35f08900-22a0-11eb...)
It works for me. Tried many files, same good result.
The glitch was there in 1.36 and 1.35 too, I was just used to it until I changed the desktop theme... The patch works in these 3 versions.
Just a minor observation. Erlang doesnt support module namespaces within a file, like Ocaml does, for example. Even though it is a nice 'feature' to view pseudo code for several modules in the same file. I like it
![Screenshot_2020-11-10_03-55-13](https://user-images.githubusercontent.com/8375315/98642634-869dcb80-230c-11e...)
the patch posted by @b4n is not compatible anymore.
For the record Im posting a new patch which works with geany 2
``` --- a/ctags/parsers/erlang.c +++ b/ctags/parsers/erlang.c @@ -112,7 +112,7 @@ { vString *const identifier = vStringNew (); parseIdentifier (cp, identifier); - makeMemberTag (identifier, K_FUNCTION, module); + makeMemberTag (identifier, K_FUNCTION, NULL); vStringDelete (identifier); }
```
Im not an expert in geany codebase can someone verify Im not breaking something with that patch?
@fbrau Your suggestion above will remove the module prefix, but will just remove the module from being the parent of its content. See #3837 for an equivalent to my initial suggestion I failed to actually integrate despite your testing -- sorry about that.
If really the information that a symbol is part of a module is bad *per se*, then your change makes sense, but should be carried over to universal-ctags. If it's semantically OK, but you really don't want to see it at all (unlike in my patch), then we'll need to add support for this, but I'd rather not :)
Closed #2650 as completed via #3837.
github-comments@lists.geany.org