This PR enables local variable (and function parameter) tags and fixes related problems:
- Disables local variables for the symbol tree (it becomes too crowded when these are shown IMO).
- 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.
- 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.
- Update non-scope autocompletion ignoring local variables like in (3).
- 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
- 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.
- 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
- e26cd13 Rename tm_tag_file_t to tm_tag_local_var_t
- 7935058 Enable local tag generation for C/C++
- 81c3055 Update goto symbol definitions to take into account local variables
- f67aa1d Update (non-scope) autocompletion to take into account local variables
- 1bd1306 Update scope completion to take into account local variables
- 0088443 Strip more things from variable type
- e82d91a Move strip_type() above find_scope_members_tags()
- d218ba5 Support (multiple) inheritance by scope completion
File Changes
(6 files)
Patch Links:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/3175@github.com>