Since PR #3859 (2d1b3d5), specifically since baaed02, which merges [ctags#3471](universal-ctags/ctags#3471) and [#3473](universal-ctags/ctags#3473) (among others), Geany's tagmanager adds a "module" tag for *instances* of a module (in addition to the "instance" tag for the instance itself, which Geany didn't show in the tree view until #4039).
Example code: ```verilog module outer_module (input D, output Q); inner_module inst (D, Q); endmodule ```
| Before baaed02: | After baaed02: | |-----------------|----------------| | ![Geany_before_baaed02](https://github.com/user-attachments/assets/4bb53785-1444-46b7-b552-8e65cf380...) | ![Geany_after_baaed02](https://github.com/user-attachments/assets/6fa05358-c66d-4757-af37-0f2ad0eed...) |
For an analogy, this is like having the C code `struct inner_struct foo;` tag *both* `inner_struct` and `foo` as struct/variable declarations (but it's *not* defining a struct type, just using it).
This seems to be caused by ctags now creating a *reference tag* whenever it declares an instance, referencing the corresponding module, and Geany erroneously(?) interpreting that reference tag as a normal tag. But I don't know enough about ctags to know what's going on for sure, nor what's the proper way to handle it (other than refraining from creating a reference tag).
Is there a way to fix this? It looks like #3102 might be related to this kind of issue.
PS: To clarify, this isn't related to my recent PR #4039 (although that one makes the issue more notable, since now we have *both* `inner_module` and `inst`. We should only have `inst`.)
IMO it's because of the attached declaration roles here
https://github.com/universal-ctags/ctags/blob/45735bd0fe03acb4a6311a9187ac5e... https://github.com/universal-ctags/ctags/blob/45735bd0fe03acb4a6311a9187ac5e...
I think if you add a verilog and systemverilog case here
https://github.com/geany/geany/blob/4264d0c507abc32c4e9f13aebaaec53d0c9e376b...
and return `kind != 'm'`, if could fix the problem. If it fixes this problem, please create a PR.
FYI https://github.com/geany/geany/pull/3102 would allow you to use the declaration tag but remap it to a different `tm_tag_...`. What I suggested in the previous post will just discard it.
Closed #4072 as completed via #4075.
github-comments@lists.geany.org