Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Indexer Requirements for 3.0

Douglas Schaefer wrote:
There are a couple of problems with parsing all header files on the include path:

1) Scalability. The number of files on an include path is somewhat unbounded. Parsing is expensive and we would need to control how much we do.

Would it be better to index external headers separately from the normal project indexing (this could apply to offline indexing as well). Maybe this header-only index could then be shared across a workspace?

2) Correctness. Parsing a header file on it's own does not always work. And in the world of Windows development and precompiled headers, it is generally guaranteed not to work. If the user doesn't require full accuracy, then it should be possible to do a ctags kind of thing to get a general hint at what is in the header files. Or if the user promises to ensure that all header files will behave like translation units, then they could use the parser based indexer.

I think 100% correctness is probably near impossible to achieve, nor is it required. The high-runner case seems to be things like type navigation (eg open type, type hierarchy), class wizard (eg let me pick a base class from all known classes) and code completion (eg add include).

All this points back to the user configurability of the indexer to make sure we are doing the right thing for their environment.

Doing the right thing - it's not as easy as it sounds... ;)

Chris


Back to the top