[Github-comments] [geany/geany] Enable local variable and function parameter tag reporting for C/C++ (PR #3175)

Jiří Techet notifications at github.com
Wed Apr 20 19:51:20 UTC 2022


This PR enables local variable (and function parameter) tags and fixes related problems:

1. Disables local variables for the symbol tree (it becomes too crowded when these are shown IMO).
2. Disables local variables for generated tag files - these aren't interesting for what we use global tags for. This however also means that unit tests don't cover local variables because they are generated in the same way as global tag files.
3. Update goto tag definition/declaration to ignore local tags from other functions than the current one and also ignoring local variables defined on a line which is behind the current line.
4. Update non-scope autocompletion ignoring local variables like in (3).
5. Update scope autocompletion ignoring local variables like in (3). In addition, when searching for applicable types for the variable for which we perform scope autocompletion, sort the candidate types so local variables from current function above the current line are preferred to global variables from the current file which are preferred to other variables.

This PR also improves the scope autocompletion a bit by
1. Removing some keywords like "const", "struct" from the type, also removing `&` and contents of `<>` braces and `[]` braces so we only get the "pure" type without additional garbage.
2. Supporting (multiple) inheritance and including members of parent classes in the result.

More details are in the individual commit messages.

@elextr Your turn, bring your evil C++ code :-)
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/3175

-- Commit Summary --

  * Rename tm_tag_file_t to tm_tag_local_var_t
  * Enable local tag generation for C/C++
  * Update goto symbol definitions to take into account local variables
  * Update (non-scope) autocompletion to take into account local variables
  * Update scope completion to take into account local variables
  * Strip more things from variable type
  * Move strip_type() above find_scope_members_tags()
  * Support (multiple) inheritance by scope completion

-- File Changes --

    M src/editor.c (14)
    M src/symbols.c (11)
    M src/tagmanager/tm_parser.c (10)
    M src/tagmanager/tm_parser.h (2)
    M src/tagmanager/tm_workspace.c (307)
    M src/tagmanager/tm_workspace.h (6)

-- Patch Links --

https://github.com/geany/geany/pull/3175.patch
https://github.com/geany/geany/pull/3175.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3175
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3175 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220420/fb046159/attachment.htm>


More information about the Github-comments mailing list