Code completion not showing all options - Using SDL
-
- CodeLite Curious
- Posts: 7
- Joined: Mon Aug 13, 2012 5:57 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Code completion not showing all options - Using SDL
Hello everybody, I'm trying to use code lite to make a SDL program with C++. Everything was perfect until I realized that not all options shows up in codelite autocompletion. Simple and common stuff like SDL_Surface and SDL_Rect structs, functions like SDL_SetVideoMode() and SDL_PollEvent() doesnt show up when I type "SDL_". The only options that shows up are the same: some SDL macros, and the main functions like SDL_Init() and SDL_Quit(). I think that's not supposed to happen, since when I build the program, everything compiles fine, and I can run the executable just fine. I guess it means that all SDL related files are in the right places inside MinGW folder. Also, I tried to do the same with Eclipse CDT, and its autocompletion shows everything just fine. It looks like there is kinda of a limit on the number of suggestions codelite autocompletion shows. It is really odd . Also, is there a way to make the cppcheck plugin parse the currently editing file as you type (something like eclipse does), or to make it more "accessible", like a keyboard shortcut or a quick interface button? Having to change to explorer tab and right clicking the file to cppcheck is tiring...
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Code completion not showing all options - Using SDL
Please specify your OS / codelite version
But again, I need to know which OS are you using.
Eran
You might want to change that from: "Settings -> Tags Settings -> Display and behavior -> Number of items to display in the completion box" atm it is set to 50 (but the list is dynamic and it will display new options as you type)hydren wrote:It looks like there is kinda of a limit on the number of suggestions codelite autocompletion shows. It is really odd
But again, I need to know which OS are you using.
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 7
- Joined: Mon Aug 13, 2012 5:57 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Code completion not showing all options - Using SDL
Oops sorry.
I'm testing on a Windows 7 Professional 64-bit, with codelite 4.0.5589, MinGW 4.6.1 (that one that comes with codelite), SDL 1.2.14
I've just tried to change the number of itens to display to 1000, but with no luck. . I counted the number of items showing and they're only 24 items. Of course, as I type and match one of those 24, it shows less options accordingly.
Strangely, that change in "Settings -> Tags Settings -> Display and behavior -> Number of items to display in the completion box" affected the behavior when autocompleting "std::", showing a LOT of itens, when before (with 50 set) it used to show 34 itens. But, again, no changes when typing "SDL_".
Thanks for the quick reply!
I'm testing on a Windows 7 Professional 64-bit, with codelite 4.0.5589, MinGW 4.6.1 (that one that comes with codelite), SDL 1.2.14
I've just tried to change the number of itens to display to 1000, but with no luck. . I counted the number of items showing and they're only 24 items. Of course, as I type and match one of those 24, it shows less options accordingly.
Strangely, that change in "Settings -> Tags Settings -> Display and behavior -> Number of items to display in the completion box" affected the behavior when autocompleting "std::", showing a LOT of itens, when before (with 50 set) it used to show 34 itens. But, again, no changes when typing "SDL_".
Thanks for the quick reply!
-
- CodeLite Curious
- Posts: 7
- Joined: Mon Aug 13, 2012 5:57 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Code completion not showing all options - Using SDL
Wow, I think I've just solved it!
It seems that Codelite doesnt check "Include Files" paths subfolders contained within the ones listed. All SDL include files were in inside a folder named "SDL" in the mingw "include" folder.
This one was in the "Include Files" paths list:
c:\program files (x86)\CodeLite\mingw-4.6.1\include
But, "C:\Program Files (x86)\CodeLite\mingw-4.6.1\include\SDL", despite being inside the previous cited path, wasnt checked for items. I needed to include this in the "Include Files" paths list.
Now its working! All SDL itens are showing. Now I need to do the same for other libraries like OpenGL (inside GL folder).
It would be nice if Codelite could check files inside subfolders inside the folders listed in "Include Files" paths list.
It seems that Codelite doesnt check "Include Files" paths subfolders contained within the ones listed. All SDL include files were in inside a folder named "SDL" in the mingw "include" folder.
This one was in the "Include Files" paths list:
c:\program files (x86)\CodeLite\mingw-4.6.1\include
But, "C:\Program Files (x86)\CodeLite\mingw-4.6.1\include\SDL", despite being inside the previous cited path, wasnt checked for items. I needed to include this in the "Include Files" paths list.
Now its working! All SDL itens are showing. Now I need to do the same for other libraries like OpenGL (inside GL folder).
It would be nice if Codelite could check files inside subfolders inside the folders listed in "Include Files" paths list.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Code completion not showing all options - Using SDL
codelite checks for files based on the user's input + parsing #include statements in the codehydren wrote:It would be nice if Codelite could check files inside subfolders inside the folders listed in "Include Files" paths list.
So.. if you set your search path like this (from: settings -> tags settings -> ctags)
Code: Select all
/home/eran/include/
and all your SDL files are located under
Code: Select all
/home/eran/include/SDL
Code: Select all
#include <SDL_file.h>
Code: Select all
./SDL_file.h
/home/eran/include/SDL_file.h
Code: Select all
#include <SDL/SDL_file.h>
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 7
- Joined: Mon Aug 13, 2012 5:57 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Code completion not showing all options - Using SDL
But Eran, in my code I was declaring:
#include <iostream>
#include <SDL/SDL.h>
#include <SDL/sdl_image.h>
without this, even g++ fails to build.
I'm not sure if that could be the issue, but I was declaring all this stuff in a header "main.hpp" and using it in "main.cpp". But i did make sure that in main.cpp I included "main.hpp":
======main.hpp:
#ifndef MAIN_HPP
#define MAIN_HPP
#include <iostream>
#include <SDL/SDL.h>
#endif // MAIN_HPP
======main.cpp:
#include "main.hpp"
int main(int argc, char **argv)
{
std::cout << "hello world\n" << std::endl;
SDL_Init(SDL_INIT_VIDEO);
SDL_Surface* screen;
SDL_Event game_event;
bool leave=false;
screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE | SDL_DOUBLEBUF);
while(!leave)
{
//SDL related stuff here
}
SDL_Quit();
return 0;
}
#include <iostream>
#include <SDL/SDL.h>
#include <SDL/sdl_image.h>
without this, even g++ fails to build.
I'm not sure if that could be the issue, but I was declaring all this stuff in a header "main.hpp" and using it in "main.cpp". But i did make sure that in main.cpp I included "main.hpp":
======main.hpp:
#ifndef MAIN_HPP
#define MAIN_HPP
#include <iostream>
#include <SDL/SDL.h>
#endif // MAIN_HPP
======main.cpp:
#include "main.hpp"
int main(int argc, char **argv)
{
std::cout << "hello world\n" << std::endl;
SDL_Init(SDL_INIT_VIDEO);
SDL_Surface* screen;
SDL_Event game_event;
bool leave=false;
screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE | SDL_DOUBLEBUF);
while(!leave)
{
//SDL related stuff here
}
SDL_Quit();
return 0;
}