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

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #60 on: November 04, 2006, 12:31:13 am »
Are you guys busy with a plugin to get ctags & sqlite up and running in code::blocks?
If so do you perhaps have a Nightly which I can test?

you can checkout and test what's available so far ...

svn repository
https://opensvn.csie.org/CodeLite


there is no intent to use it in CB, as long ctags isn't able to parse C++ code correctly,
although eranif said, that it would be possible somehow...
brgds,
« Last Edit: November 04, 2006, 12:33:51 am by tiwag »

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #61 on: November 04, 2006, 12:48:40 am »
Quote from: tiwag
as long ctags isn't able to parse C++ code correctly
Please dont spread wrong information, ctags is pretty much capabale of parsing C++. The fact that a single define was inserted into a function list (and can be easily fixed, using list of ignored marcros, as Takeshi suggested), does not mean it cant parse C++.

ctags purpose's is not to be a replacement for the compiler but as an assitant for code writing, so it can miss a complex expression here and there nothing wrong with that -
I didnt see that the current implementation is prefect, and still you are not going around and spreading that it cant parse C++...

-Eran

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #62 on: November 04, 2006, 12:50:31 am »
I played around with Eclipse's CDT... not bad... the only thing I like more in Eclipse is its Indexing (Code Completion & Symbol Browser)... for the rest I will be sticking to Code::Blocks thank you very much!
(Although it is done in Java  :x ) Is it possible to glimpse how they implement the parsing (How they get all the info) ?

BTW ... Thanks


Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #63 on: November 04, 2006, 12:58:18 am »
Uh... well... I actually thought it did more than the current code completion plugin and thought somebody will be working on it... no need to flame one another  :? But you can always continue... (Just let us know where you stay, we will bring beer and snax, and you guys can have at one another) and it will not help the code completion  :lol:

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #64 on: November 04, 2006, 01:29:27 am »
Quote from: tiwag
as long ctags isn't able to parse C++ code correctly
Please dont spread wrong information..

i do not spread wrong information,

the actual implementation of CodeLite and CodeLiteEditor as it is in svn repository
is unusable, because most the functions of wxWidgets code samples are simply missing in the browser,
because, as you told me, ctags is confused about the lots of macros used in wxWidgets ...

you said to know how to solve this issue, so please do it (if it is so simple, which i don't believe ...)

brgds,

Alturin

  • Guest
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #65 on: November 07, 2006, 12:02:51 am »
Quote from: tiwag
as long ctags isn't able to parse C++ code correctly
Please dont spread wrong information..

i do not spread wrong information,

the actual implementation of CodeLite and CodeLiteEditor as it is in svn repository
is unusable, because most the functions of wxWidgets code samples are simply missing in the browser,
because, as you told me, ctags is confused about the lots of macros used in wxWidgets ...

you said to know how to solve this issue, so please do it (if it is so simple, which i don't believe ...)

brgds,

Is that only true for wxWidgets projects, or will it just not compile/run as Code::Blocks plugin due to that?

Offline Szabadember

  • Multiple posting newcomer
  • *
  • Posts: 75
  • That's me!
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #66 on: November 24, 2006, 07:16:04 pm »
Project Suspended?

takeshimiya

  • Guest
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #67 on: November 24, 2006, 07:28:02 pm »
Project Suspended?
No, I had a cb plugin in the works, the symbols tree is already integrated and working, I need to finish the integration with cbEditor, and decide a strategy to where to save the different dbs.
Now I'm working on another projects but I'll retake this when I finish them.

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #68 on: January 09, 2007, 12:32:43 pm »
@takeshi: would you mind sending me the plugin that you started with ctags? I will start play with that and see what I can do about it!

@Eranif: Shall we tackle this plugin together?

Offline Szabadember

  • Multiple posting newcomer
  • *
  • Posts: 75
  • That's me!
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #69 on: March 01, 2007, 08:28:05 pm »
Status?  :o
Last post is almost  months old.

Kreso

  • Guest
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #70 on: March 15, 2007, 09:53:08 pm »
c'mon guys, you're almost there :) don't give up now;

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #71 on: March 15, 2007, 10:37:14 pm »
Quote
c'mon guys, you're almost there Smile don't give up now;
I never gave up, so I wrote the library - CodeLite, however, I am not familiar nor have the time to learn C::B code structure and internals to create a plugin.

If anyone here is willing to create a plugin using CodeLite - I will be happy to fix any bug/request for this library (assuming it is not complicated :))

Eran

mitsukai

  • Guest
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #72 on: May 10, 2007, 10:07:47 pm »
this looks very nice.
in time it will be a very good code completion plugin..

as for the "heavy macros";
parse all macros to a database, then when parsing a line, "dereference" the macros  till there are no macro references left.

for example.

Code
1. //used in GCC i thought
2. #define DLL_EXPORT _attribute_((export))
3. #define CLASS class DLL_EXPORT
4. CLASS someclass
5. {
6. /* some stuff */
7. };

1. { we are parsing line 4 {
2. find CLASS in macro db
3. found CLASS, {replace
4. class is not a macro
5. found DLL_EXPORT, {replace
6. _attribute_ and export are not macros } }
7. someclass is not a macro }
8. start parsing definitions, declarations etc.
line that it is parsing is 'class _attribute_((export)) someclass'}

this could fix the "heavy macro"  "bug"... just an idea :)

thought it has performance impact... but at least its correct
if you manage the database well, like ordering entries by name u can make a very fast algorithm to search for definitions and declarations.
and if u make it so it only parses on a new project and if u edit a line performance impact should not be noticable when programming (unlike intellisense, blegh)
« Last Edit: May 10, 2007, 10:42:16 pm by mitsukai »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #73 on: June 10, 2007, 04:33:05 pm »
@Eranif

In the buildinfo.txt for MSW there is an .cbp for sqlite3 and wxsqlite3.

The project for sqlite3 does not compile because there are no source files for it downloaded by SVN(url="http://svn.berlios.de/svnroot/repos/codelite/trunk")

What is the difference, and which project is correct?

Code
Code::Blocks (CB) workspace and project files are supplied

! two build methods are supplied !

1. CodeLite.workspace
    contains the CB-projects
    * sdk\wxconfig\wx-config-win.cbp
    * sdk\ctags\build\ctags.cbp
    * sdk\sqlite3\build\sqlite3.cbp
    * sdk\wxsqlite3\build\wxsqlite3_wxsqlite3.cbp
    * CodeLite\CodeLite.cbp
    * sdk\wxscintilla\build\wxscintilla.cbp
    * LiteEditor\LiteEditor.cbp



Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Re: Suggestion: Using ctags & sqlite for code completion
« Reply #74 on: June 10, 2007, 04:47:45 pm »
@Eranif

Using MSW \trunk\CodeLite\CodeLite.cbp, precompiled_header.h has the following:

Quote
#ifdef __WXMSW__
   #ifdef _DEBUG
      #include <crtdbg.h>
      #define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__)
   #else
      #define DEBUG_NEW new
   #endif
#endif

However I cannot find on my xpSp2 wxWidgets2.8.4 system a file named "crtdbg.h"

Was this supposed to be in the svn, or on my system somewhere.