On Sep 8, 2005, at 9:42 AM, Andreas Grosam wrote:
On 08.09.2005, at 12:52, Jonathan Taylor wrote:
Thanks to the people who answered my last set of questions about Xcode. I wonder if I could try a few more...
Xcode's indexing seems incomplete: sometimes "Find definition" only finds the prototype for a function, for example. Is there a way I can force it to re-index or something? I don't know if it's anything to do with the project having been only recently migrated to Xcode, and hence that I have probably never opened some of the "mature" source files.
Firstly, XCode is indexing automatically in the background, unless you disabled it. The features based upon Indexing is Code Sense, Find Definition, the class browser, and certainly some more.
That's immaterial: the index does know both the declaration and the definition, but the default UI of command-double-click (or the corresponding "Jump to Definition" menu item) only takes you to the source, not to its corresponding header.
Find menu -> Find Selected Definition in Project will show you the occurrences in both the header and the source file.
In the Class Model (select a target or group of sources and choose Design -> Class Model -> QuickModel), when you have a class or member selected you can choose Go to Definition, Go to Declaration, or (for system classes) Go to Documentation. You can re-index and you *explicitly should do this*, occasionally (see below, issues with indexing): just open the Info Panel for the project in the Groups and Files View and click the button "Rebuild Code Sense Index".
There are a couple of problems with indexing - and Apple is constantly improving it in each new version. Currently, I experienced these issues: - the indexer is unable to parse the complete C++ grammer. Due to this, there may be issues in templates, namespaces, local classes, local typedefs; qualifiers in common. - it seems that the indexer only *adds* symbols, but never removes them when it is required - for instance, when you remove a source file - then you need to reindex. - indexing should be done per "translation unit", however, XCode uses a much more course grained model. - the information provided lacks of details, like namespaces, qualifiers,etc. - there are a number of other issues, e.g. the index-parser is unable to propperly parse the __attribute__ spec of classes.
All of the above are true and known. But I have to add this too: Doing Indexing propperly, fast and seamlessly, is a very complex and challenging task!!
Which is no excuse for not doing better than we do now, and we are working on it.
Chris |