Author Topic: Suggestion: Using ctags & sqlite for code completion  (Read 85142 times)

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: CodeCompletion - what is the status?
« Reply #30 on: September 02, 2006, 11:01:19 am »
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

  • Guest
Re: CodeCompletion - what is the status?
« Reply #31 on: September 02, 2006, 11:57:31 am »
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

  • Guest
Re: CodeCompletion - what is the status?
« Reply #32 on: September 02, 2006, 08:13:45 pm »
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.

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: CodeCompletion - what is the status?
« Reply #33 on: September 03, 2006, 07:16:49 pm »
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





Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: CodeCompletion - what is the status?
« Reply #34 on: September 04, 2006, 02:33:17 pm »
 :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?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: CodeCompletion - what is the status?
« Reply #35 on: September 04, 2006, 02:53:41 pm »
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...

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: CodeCompletion - what is the status?
« Reply #36 on: September 04, 2006, 03:21:35 pm »
 :? I think that confused citizen is me... whoops

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #37 on: September 04, 2006, 04:40:48 pm »
Quote
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...
Done, I think that the topic title now indicates that this is not the current CodeCompletion plugin
Eran

pastbin

  • Guest
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #38 on: September 05, 2006, 05:18:22 pm »
Great work Eranif
I compiled everything from the repository today (mingw).
I noticed something for local scope variables. Here is an example:

Code
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!

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #39 on: September 05, 2006, 08:09:03 pm »
Thanks for letting me know of this bug - I fixed it.

Eran

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #40 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:
Code
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #41 on: September 06, 2006, 12:05:56 pm »
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

  • Guest
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #42 on: September 06, 2006, 12:14:01 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.
« Last Edit: September 06, 2006, 12:39:39 pm by Takeshi Miya »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #43 on: September 06, 2006, 01:23:27 pm »
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:
Code
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

« Last Edit: September 06, 2006, 01:26:02 pm by tiwag »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #44 on: September 06, 2006, 06:31:31 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ