[Qt-creator] Where does Creator pick up it code completions?

Erik Verbruggen erik.verbruggen at me.com
Wed Feb 15 13:33:55 CET 2012


On 15-2-12 12:07, Danny Price wrote:
> Hey guys,
>
> Creator's code completion has always been first class but recently I've
> been having some issues with it.
>
> I installed GCC 4.6.0 to make use of the new C++11 features and boost 4.8.
>
> Creator's editor doesn't understand the new syntax like the new range
> iterators but I can live with that as the code compiles.

We are working on c++11 support.

> However it fails to offer completions for things like std::shared_ptr or
> std::unordered_map even though the headers are included and the code
> compiles. Yet similar constructs in boost, like boost::shared_ptr get
> resolved.

I did not look into this specific one, but it might be because of c++11: 
if a parse error occurs, an attempt at error correction is done by 
skipping input until something that looks like a declaration/definition, 
and continue there. This might have the effect of skipping too much.

> Visual Studio (or rather VA Assist as Visual Studio's C++ 'intellisence'
> is rubbish) has a list of editable paths and a database from which it
> gathers all the symbols but I couldn't see anything like that in
> Creator. How is it building these completions?

I'm not sure what editable paths are..

Anyway, completion is done on-demand. No database is stored to disk. The 
(very) short explanation is: the scope on cursor position is retrieved, 
and all visible declarations/definitions/etc are added (also for the 
parent scope(s), imported scopes (using namespace), template 
instantiations, typedef resolving, etc).

-- Erik



More information about the Qt-creator mailing list