[Bug 58502] code completion doesn't work with namespace
Steven T.Hatton
hattons at globalsymmetry.com
Tue Feb 24 09:53:06 UTC 2004
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=58502
------- Additional Comments From hattons globalsymmetry com 2004-02-24 09:52 -------
I was going to start a new whishlist item, but it would have addressed this issue as a subset, so I'm going to post my thoughts here. This may be too resource intensive to implement, but I believe the idea is worth considering. I propose the code completion database be parsed by antlr (or whateve the proper tool would be) and stored in a tree(?) form representative of the visibility structure of the libraries. Currently I can begin typing QSt and I get code completion for all the Qt classes that share this initial segment. We need a mechanism for determining the location in the library database tree corresponding to the current scope of the program. and only used descendents of that location to populate the code completion list.
This approach could be used for #include control lines as well. It may prove more difficult, but I believe the header files could be queried to determine their namespace scoping, and included in the data structure at a location subordinate to the header file containing the namespace declaration.
While looking over the gcc documentation, I found specifications of where gcc looks for headers. Those specifications could be used to determine the correct subset of the database. It seems reasonable that much of the building of the tree could be cached. It might be reasonable to store a separate cache per library, or namespace. This would probably be best accomplished by storing the cache local to the user's KDevelop configuration, rather than in the libraries directory structure. It may even be possible to distribute pre-construct cache files (or perhas the should be called mapping file in such a case.)
Since there already is a code completion database, it seems reasonable to start by examining how it might be used to implement this design. I guess this design would also entail parsing the source code on the fly, and building a designtime translation unit.
These look like good jumping off points to find out who to interpret project settings and environment variable in order to implement the design.
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Invoking-G--.html
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Environment-Variables.html
BTW, I can talk the talk, but I am not that skilled of a (C++) coder, so, until those skills are significantly improved, I won't be the one writing the code.
More information about the KDevelop-devel
mailing list