Ericsson / CodeCompass

CodeCompass is a software comprehension tool for large scale software written in C/C++ and Java
https://codecompass.net
GNU General Public License v3.0
517 stars 101 forks source link

Clicking any node inside a lambda does not work #583

Closed intjftw closed 8 months ago

intjftw commented 1 year ago

If you click on a node inside a lambda expression, the lambda declaration will be highlighted and marked (showing the lambda in the info tree) instead of the node itself. See the image for an example with getFile clicked. Screenshot from 2022-10-03 11-58-18

dbukki commented 11 months ago

I found that the issue is with the fact that since commit 3bc3c7f1f69c4a1a0680dc289b50d835d7cf74a1, implicitness is hereditary for child nodes during traversal via the _isImplicit member variable. I guess the original assumption was that once a node is implicit, everything in it must surely also be implicit. But this is simply not the case with lambdas: While the closure type itself is in fact implicit, its operator() is not, and yet it is treated as such. This marks everything inside a lambda point to unspecified locations, because _fileLocUtil.setRange is never called for any of its child nodes. So the parsed nodes are actually there in the database, but their location is never set, so the UI can't display them.