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

elextr notifications at github.com
Thu Apr 21 10:45:48 UTC 2022


Neat!!!  Have not looked at it in detail but comments below.

> Disables local variables for the symbol tree (it becomes too crowded when these are shown IMO).

Totally agree, I enabled them in the past using your patch and its waaay too busy.

> 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

Agree that global tags usage is for names accessible outside the scope, function names and struct members, but locals and parameters are only visible inside the function scope.  

No tests!!! Well almost all the rest of Geany has no tests so its not like it stands out :smile: 

> 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.

Limiting it to only locals/parameters of the current function is great.

Nice idea about the following declarations, fine for languages that are C, but be careful, at least Julia violates it ([see](https://docs.julialang.org/en/v1/manual/variables-and-scoping/#Local-Scope) "This is true even if the outer local is declared after (in the sense of textually below) an inner block.") and other languages may too (I think Lisp).  Or is this feature filetype specific to C/C++ only?

> Update non-scope autocompletion ignoring local variables like in (3).

What about object data members in member functions, data members (and functions as well actually) from all parent classes are available as unqualified names automatically visible in the member function (ignoring complications like "private" and "protected").

> Update scope autocompletion ignoring local variables like in (3).

Isn't scope autocompletion automatically limited to the applicable scope?  

Or are you talking about limiting the candidate set of composite declarations that are considered as scopes to provide potential names? ie when typing `x.` first apply (3) to find the possible types of `x` then for those that are composite types (things like `int` are irrelevant) find their member names and present that list?

> 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.

I presume by <> you mean C++ template parameters?  If so, although the parameters are actually part of the typename, technically the members (and so completions) can vary between specialisations.  What do you do when there are several, show only the original declaration members, or combine members from all specialisations?

> Supporting (multiple) inheritance and including members of parent classes in the result.

Neat!! Does it ripple up through grandparents and great grandparents etc?  This also applies to non-scope autocompletion inside member functions as mentioned above.

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

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


More information about the Github-comments mailing list