Page 1 of 1
Force AutoCompletion to include subdirectories too
Posted: Fri Sep 23, 2016 12:17 am
by kilon
So with the help of the main dev,I have managed to add the correct paths in my MacOS AutoCompletion Settings, it autocompletes normal C++ code no problemo. However because I code in Unreal Engine, I included the parent folder where subfolders exist with the header files (talking CTag here) , but it does not like that and cannot autocomplete. Should I add each subfolder individually , is it possible to force it to search to the subfolders ?
Re: Force AutoCompletion to include subdirectories too
Posted: Fri Sep 23, 2016 11:29 am
by eranif
You don't need to add each folder separately.
CodeLite will search the files for you.
Basically, CodeLite will scan the folders that you added to your include path in the project settings.
You should only add folders which are not included in the project settings.
For example: /usr/include is a default folder which even though not provided in this simple build command:
Code: Select all
g++ -c test.c -o test.o -I/home/eran/includes
The compiler will still knows about it. This is the kind of folders you need to add in the CTags -> Search paths field
However, since /home/eran/includes is passed to the compiler (via the -I switch) CodeLite will already include this folder for you.
This is why you needed to perform a build and then things started to work for you.
Also, note that you can simply use the menu entry: "workspace->parse workspace -incremental" and tell CodeLite to scan and parse the workspace
So, some more details about your build environment will be helpful here (mainly: please provide a code snippet + a complete build output)
Are you using some custom build systems? (CMake, QMake etc)
Re: Force AutoCompletion to include subdirectories too
Posted: Fri Sep 23, 2016 1:34 pm
by kilon
as always you a correct, I have not tried to build an Unreal project because Unreal has its own build system which is quite complex because it does hot reloading of dlls for chaning C++ code while your game runs. So I will need to take a deeper look and do thorough testing.
I am on late 2013 iMac, i5 32Ghz, 8GB Ram and run MacOS El Capitan (10.11.6). Unreal is made to support XCode but my XCode has been acting crazy since I upgraded to El Capitan from Yosemite, it eats my entire memory and that of course makes the OS super slow.
Another thing I wanted to ask, what I like about XCode is that it does not only show me in auto completition the method signature but also documentation about the method. Is this possible to add to CodeLite ? What kind of files it uses to fetch such documentation ?
Re: Force AutoCompletion to include subdirectories too
Posted: Fri Sep 23, 2016 2:13 pm
by kilon
Ok after some searching I came on front a pleasant suprise it appears there is a developer that added support for Codelite in Unreal
https://www.youtube.com/watch?v=61yGNLZ2w68
So I will be following his directions , thanks for the help
Re: Force AutoCompletion to include subdirectories too
Posted: Tue Oct 04, 2016 11:23 am
by kilon
So after much searching I was finally succesfull finding how to build an Unreal game from the console, so what I did was to go to the Project settings , enable custom build and add the instruction there to be precise
Code: Select all
/Users/Shared/UnrealEngine/4.13/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -project="/Users/kilon/Documents/Unreal Projects/Periastron/Periastron.uproject" -noP4 -platform=mac -clientconfig=Development -allmaps -build
The game builds succesfully from inside codelite but still no auto completion. I have added the folder where the header files are located for the Unreal engine , this should be enough for auto completion , yes ?
I also tried both Workspace parse and Workspace parse incremental. Workspace parse make a little message on the status bar and last just a fraction of a second which says that it tries to find files to parse , its clear that for some reason it cannot locate files.
I also tried to set auto completion in project settings as well as general settings, same paths both cases.
Any idea why that may be the case ?
I am on macos Sierra , using codelite version 9.2.4
An ugly workaround I found was to take the folder with the header files and import it directly to the project, in that case codelite indeed starts the workspace parsing and autocompletion works. But even in that case autocompletion still has issues, for example, if I try to autocomplete a class names AGameMode and I type AGame , it displays me only the classes named AGameplay and only if I type AGameM it autocompletes to AGameMode.
Importing the folder is an ugly workaround because the folder is almost 1 gb in size.