News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Suggestion: Using ctags & sqlite for code completion

Started by eranif, August 21, 2006, 01:44:17 PM

Previous topic - Next topic

eranif

Hi,

I loaded the file you sent me as is into the CodeLite demo, and I see nothing wrong ...

To make sure, I compared the resulted tree with MSVC 7.1 tree, attached are the result (MSVC was even fooled by the args(()) definition)  :wink:




Please ignore the functions ended with <prototype> I am still working on it ^^

If you want to test it for yourself, and you are working on windows, here is a link to the demo installation:
http://eistware.com/wxes/codelite/LiteEditor_0.1.zip

If you want to build it by yourself, use SVN to get the latest source files:
https://opensvn.csie.org/CodeLite/

HTH,
Eran


Alturin

Aaah, I seem to have mistaken the CC redisign by Mandrav with your work *chuckle*.
I guess I'll post this in the proper thread.

takeshimiya

For anyone wanting to testing this parser library, go to https://opensvn.csie.org/traccgi/CodeLite/wiki

Any help is appreciated. I've included Code::Blocks projects along with all dependencies and projects.  :)
I can compile and link everything fine, the library too. Still can't link the example "LiteEditor", I'm trying to solve it.

eranif

I commited earlier today a version of makefile (not code blocks project) that compiles and links everything successfully using g++ /mingw (it builds the dependencies first sqlite, scintilla) CodeLite library and then LiteEditor program (revision 38)

I tested the unicode debug version build, and it is working perfectly

The only configuration missing is Unicde debug dll/Unicode release dll, but this can wait until the library functionality is closed

Eran





joubertdj

 :P Oh boy... this is cool... thanx Eran. Question... for I am either mis-configuring my CodeCompletion or it is still in development. Is the CodeCompletion for the open files only (The ones in the editor), or do you have to "parse" other header files that you would like to use (Ogre, Allegro, RakNet etc.) into the SQLLite database also?

mandrav

Eran, can you please edit your first post's subject to indicate that what is discussed here is not about the code-completion plugin?
It's starting to get confusing for people...
Be patient!
This bug will be fixed soon...

joubertdj

 :? I think that confused citizen is me... whoops

eranif

QuoteEran, can you please edit your first post's subject to indicate that what is discussed here is not about the code-completion plugin?
It's starting to get confusing for people...
Done, I think that the topic title now indicates that this is not the current CodeCompletion plugin
Eran

pastbin

Great work Eranif
I compiled everything from the repository today (mingw).
I noticed something for local scope variables. Here is an example:


void f() {
  int aa;    // 1
#define BLAH // 2
  int bb;    // 3
}


Ctrl+space works fine with aa or bb.
Now remove line 1. There is no match for bb.
We have to remove the preprocessor keyword (line 2) if we want bb to be matched again.

It seems there is a little problem with preprocessor instructions.
Not sure if I can track the bug. I'll try to understand your codebase before.

Anyway, keep up the good work!

eranif

Thanks for letting me know of this bug - I fixed it.

Eran

MortenMacFly

Well... I again tried to compile this "beast" ;-). Now that there are C::B project files in SVN (r59) I didn't have to adjust a lot (nice work!). Everything compiles nicely but in the end the linkage fails for a reason I don't understand. Here is the linker's output:

mingw32-g++.exe -LD:\Devel\wxWidgets\lib\gcc_dllUnicode -L..\CodeLite\lib -L..\sdk\wxscintilla\lib -L..\sdk\wxsqlite3\lib -L..\sdk\sqlite3\lib -LD:\Devel\GCC345\lib  -o bin\LiteEditor.exe .obj\Release\cpp_symbol_tree.o .obj\Release\editor.o .obj\Release\editor_config.o .obj\Release\frame.o .obj\Release\resources.o .obj\Release\wxFlatNotebook.o .obj\Release\app.o  .obj\Release\code_parser.res  -s -Wl,--enable-auto-image-base -Wl,--export-all-symbols -Wl,--add-stdcall-alias  -lcodelite_wxdll -lwxscintilla_wxdll -lwxsqlite3_wxdll -lsqlite3 -lwxmsw26u  -mwindows
..\CodeLite\lib/libcodelite_wxdll.a(symbol_tree.o):symbol_tree.cpp:(.text+0x713d): undefined reference to `_imp__wxEVT_COMMAND_SYMBOL_TREE_ADD_ITEM'
..\CodeLite\lib/libcodelite_wxdll.a(symbol_tree.o):symbol_tree.cpp:(.text+0x7163): undefined reference to `_imp__wxEVT_COMMAND_SYMBOL_TREE_DELETE_ITEM'
..\CodeLite\lib/libcodelite_wxdll.a(symbol_tree.o):symbol_tree.cpp:(.text+0x718f): undefined reference to `_imp__wxEVT_COMMAND_SYMBOL_TREE_UPDATE_ITEM
'
collect2: ld returned 1 exit status

I realised that the missing export is actually declared in parse_thread.h... Any idea what I am missing here?!
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

eranif

I think tiwag solved that issue - this error is only realted to dll build

Try to build the static build (since I am not using C::B I dont know if there is project for the static build) using the provided makefile.

Eran



takeshimiya

#42
Quote from: eranif on September 06, 2006, 12:05:56 PM
since I am not using C::B I dont know if there is project for the static build
Yes, there is: the project is exactly the same, regardless if it uses wxWidgets in static, shared, monolithic, unicode or whatever configuration. :)
For using the static build, you just need to set the env. var. accordingly, ie. WXCFG=gcc_lib\mswu.

UPDATE: tiwag just added explicit C::B projects for wxWidgets SHARED=1.

tiwag

#43
Quote from: MortenMacFly on September 06, 2006, 10:38:40 AM
Well... I again tried to compile this "beast" ;-). Now that there are C::B project files in SVN (r59) I didn't have to adjust a lot (nice work!). Everything compiles nicely but in the end the linkage fails for a reason I don't understand. Here is the linker's output:

mingw32-g++.exe -LD:\Devel\wxWidgets\lib\gcc_dllUnicode -L..\CodeLite\lib -L..\sdk\wxscintilla\lib -L..\sdk\wxsqlite3\lib -L..\sdk\sqlite3\lib -LD:\Devel\GCC345\lib  -o bin\LiteEditor.exe .obj\Release\cpp_symbol_tree.o .obj\Release\editor.o .obj\Release\editor_config.o .obj\Release\frame.o .obj\Release\resources.o .obj\Release\wxFlatNotebook.o .obj\Release\app.o  .obj\Release\code_parser.res  -s -Wl,--enable-auto-image-base -Wl,--export-all-symbols -Wl,--add-stdcall-alias  -lcodelite_wxdll -lwxscintilla_wxdll -lwxsqlite3_wxdll -lsqlite3 -lwxmsw26u  -mwindows
..\CodeLite\lib/libcodelite_wxdll.a(symbol_tree.o):symbol_tree.cpp:(.text+0x713d): undefined reference to `_imp__wxEVT_COMMAND_SYMBOL_TREE_ADD_ITEM'
..\CodeLite\lib/libcodelite_wxdll.a(symbol_tree.o):symbol_tree.cpp:(.text+0x7163): undefined reference to `_imp__wxEVT_COMMAND_SYMBOL_TREE_DELETE_ITEM'
..\CodeLite\lib/libcodelite_wxdll.a(symbol_tree.o):symbol_tree.cpp:(.text+0x718f): undefined reference to `_imp__wxEVT_COMMAND_SYMBOL_TREE_UPDATE_ITEM
'
collect2: ld returned 1 exit status

I realised that the missing export is actually declared in parse_thread.h... Any idea what I am missing here?!
With regards, Morten.

Hi Morten,
the beast is drilled.

needed changes to parse_thread.h

* changes to codelite/parse_thread.h
  added header guard for definition of WXDLLIMPEXP_SYM_TREE
  MACRO USAGE:
  use WXMAKINGDLL_SYM for building codelite regardless if .dll or static library .a
  use WXUSINGDLL_SYM when using codelite as .dll
  use no macro when using codelite as static library .a


update from svn to rev 66

the CB workspace CodeLiteEditor_wxdll.workspace builds fine for me by doing "Build Workspace"
it builds Release and Debug versions of CodeLiteEditor
btw. these projects don't use wx-config, they use the CB global variables instead.

if you want to run it from the LiteEditor\bin directory, you have to copy the files
liteeditor.xml, sqlite3.dll and ctags.exe there too , it runs fine for me using wx263.dll

i would be interested if it builds and runs fine for you too


MortenMacFly

Quote from: tiwag on September 06, 2006, 01:23:27 PM
i would be interested if it builds and runs fine for you too
Yes, it does now. Thanks!!!
BTW: I've modified the C::B project files to use wxUnicode - thus, basically change the compiler include, add the _UNICODE and wxUSE_UNICODE defines to the compiler switches and link against wxmsw26*u*. This works very well, too.
Now that I have "my" executable I can start testing... ;-)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]