This is a reworked and extended implementation of sorting based on tag presence in header files discussed (and dropped) from #3185. This implementation uses the header tags from ctags so we know precisely which files are included so we can use not only the tags from the source's header file but also tags from other included files. After this change the ordering sequence looks this way:
- sort local vars first (with highest line number first), - followed by tags from current file, - NEW: followed by tags from header, - NEW: followed by tags from other included files, - followed by workspace tags, - followed by global tags
To me, the result seems to improve autocompletion results (it's a bit hard to tell for sure, one can always prepare artificial examples to test where it works better, with the real world it's harder to spot a difference between different orderings unless something is visibly broken).
For reference, I also tried the option to use the includes from the included headers recursively to some depth but the results didn't seem visibly better and were actually slightly worse (by including `<gtk.h>` one got all the GTK symbols which were then fighting with symbols from explicitly included headers that started to appear lower in the list which was often worse). You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3269
-- Commit Summary --
* Maintain a hash table of TMSourceFiles inside TMWorkspace * Process header tags * Sort autocompletion tags also based on their presence in included files
-- File Changes --
M src/symbols.c (2) M src/tagmanager/tm_parser.c (4) M src/tagmanager/tm_parser.h (3) M src/tagmanager/tm_workspace.c (155) M src/tagmanager/tm_workspace.h (1)
-- Patch Links --
https://github.com/geany/geany/pull/3269.patch https://github.com/geany/geany/pull/3269.diff