Code Completion in Codelite 5.3

General questions regarding the usage of CodeLite
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Code Completion in Codelite 5.3

Post by ColinTaylor »

Windows 7, 64-bit
Codelite installed from codelite-5.3-mingw4.7.1

Since I upgraded to Codelite 5.3 code completion hasn't worked, and it worked very well on 5.2 and earlier. At the point where code completion would normally offer a list of completions, I get an error stating "This file requires compiler and library support for C++ 2011 blah blah blah".

Things I've tried so far

Workspace->Retag Workspace (full)
Workspace->Retag Workspace (quick)
Complete rebuild of workspace

In Settings->Tags settings ->Clang ..., the checkbox "Enable clang code completion" is checked, and all the listed paths in that dialog box look ok and are the same as under codelite 5.2. I've tried it with the "only use clang code completion" both checked and unchecked.

Please can someone tell me the necessary settings/actions in order to get code completion working again?
Cheers, Colin
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion in Codelite 5.3

Post by eranif »

What are the search paths set up for your code completion?
You can look them here:

Settings -> Tags Settings -> CTags -> Search Paths

Eran
Make sure you have read the HOW TO POST thread
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion in Codelite 5.3

Post by ColinTaylor »

Thanks, you've pointed me at the answer to the problem

The first line on the search paths was
E:\Dev\wxWidgets-2.9.4\include
, and when I updated that to
E:\Dev\wxWidgets-2.9.5\include
, code completion started working again.

I had no idea that the ctags settings were so important, because I checked the 'Enable clang code completion' I sort of assumed this would override any ctags settings!

That's certainly one to remember for future releases, thanks again :)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion in Codelite 5.3

Post by eranif »

ColinTaylor wrote:I had no idea that the ctags settings were so important, because I checked the 'Enable clang code completion' I sort of assumed this would override any ctags settings!
In 99.9% of the cases codelite will be using the in-house code completion engine. Even when you enable clang, it will be only be used as a fallback engine
So in fact, ctags (its not really ctags, its just an historical name ;)) is the important one

Some notes about clang with codelite:
http://codelite.org/LiteEditor/ClangIntegration41
Eran
Make sure you have read the HOW TO POST thread
evstevemd
CodeLite Guru
Posts: 352
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion in Codelite 5.3

Post by evstevemd »

eranif wrote:
ColinTaylor wrote: Even when you enable clang, it will be only be used as a fallback engine
So in fact, ctags (its not really ctags, its just an historical name ;)) is the important one
Eran
Hi Eran,
Ctags is a confusing name.
I was battling with same problem because I didn't though Ctags is that much important.
Think of changing names.

Another thing is, why should I fill include path in both Clang and Ctags if that is the case?
Why not have single place?

CodeLite 15.x
CodeLite is awesome, I just Love it!

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion in Codelite 5.3

Post by eranif »

evstevemd wrote:Another thing is, why should I fill include path in both Clang and Ctags if that is the case?
In fact, clang does not need this (at least not under Linux). You can leave it empty under linux and it will work since in codelite, the include paths used for clang are taken from the actual compilation line ( codelite manages a compilation database where it stores the exact compilation line needed for every file in the workspace)
and when code completion is required, codelite passes these arguments to clang. The only reason its there is for adding the default include paths (C:\MinGW\include etc) for _Windows_ , otherwise, clang will not were to look for the standard headers

ctags on the other hand, is a less sophisticated so codelite needs to "crawl" into header files and extract list of files to passed to codelite-indexer (which indexes them and store the result into the database)

Eran
Make sure you have read the HOW TO POST thread
evstevemd
CodeLite Guru
Posts: 352
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code Completion in Codelite 5.3

Post by evstevemd »

eranif wrote:
evstevemd wrote:Another thing is, why should I fill include path in both Clang and Ctags if that is the case?
The only reason its there is for adding the default include paths (C:\MinGW\include etc) for _Windows_ , otherwise, clang will not were to look for the standard headers
Eran
I see thaks for clarification.
My Point is, if Clang and Ctags headers are the same (which is for all my cases and I guess all users) why not share?
I mean when Clang needs them it will find them in Ctags Tab than having duplicate tabs that add confusion to user :oops:

Else your explanations are super clear :)

CodeLite 15.x
CodeLite is awesome, I just Love it!

Post Reply