Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Suggestion: Using ctags & sqlite for code completion

<< < (11/16) > >>

takeshimiya:

--- Quote from: tiwag on October 10, 2006, 01:06:30 pm ---ctags is obviously not good enough to parse wxwidgets
and gets confused with the heavy usage of macros

--- End quote ---
Yes I've noticed that about WXUNUSED.
Fortunately ctags haves a switch to specially handle identifiers like that.
See the -I identifier-list option in the manual: http://ctags.sourceforge.net/ctags.html

So we'll only need to have a user-configurable list of troublesome identifiers.
Ideal for libraries which haves heavy macro usage. Modern libraries with little-to-no-macro-usage will not need that.

Little example from the manual:

--- Code: (cpp) ---CLASS Example
{
    // your content here
};
--- End code ---

The example above uses "CLASS" as a preprocessor macro which expands to something different for each platform. For instance CLASS may be defined as "class __declspec(dllexport)" on Win32 platforms and simply "class" on UNIX. Normally, the absence of the C++ keyword "class" would cause the source file to be incorrectly parsed. Correct behavior can be restored by specifying -I CLASS=class.

eranif:

--- Quote from: tiwag on October 10, 2006, 01:06:30 pm ---ctags is obviously not good enough to parse wxwidgets
and gets confused with the heavy usage of macros

when parsing .\CodeLiteEditor\LiteEditor\frame.cpp

it shows WXUNUSED(event) instead of
OnUseExternalDatabase(wxCommandEvent& WXUNUSED(event))

and all eventhandler functions are missing

--- End quote ---

they are missing in the GUI tree, but they should appear in the CodeCompletion part, if not then it is a bug inside CodeLite and not within ctags.

I chose not to display the parent(s) functions members only because it adds more complication to the GUI tree, which if a plugin will be implemented, and a requirment will arise, I will add it.

Like Takeshi mentioned, a dialog with a list of pre-processor arguments can be added and be passed to ctags (ctags command line are stored inside a map, and can be changed) to resolve such issues.

Another problem, one can think of, is that in the GNU header files (specially the STL implementation), the vector class is located inside namespace _GNUCXX_STD (or something similar) while map is inside std, so typing std:: (obvioulsly one is a define of the other) will yield a completion box with alot of members but vector is not one of them ...) Takeshis' solutuion will solve this one too.

There are probabaly many other bugs outhere, but I think that it is in a good position that people can work with.

Eran


Pecan:
I cannot compile "Debug wxdll unicode" project under XP CB SVN 3087.

Even though readtags.cpp and readtags.h are checked to be compiled under the ctags target, they are never loaded and compiled. Note that compilation jumps from read.c to rexx.c skipping readtags.cpp


--- Code: ----------------- Build: ctags in Debug wxdll unicode ---------------
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\args.c -o .objs\msw_wxdll_ud\sdk\ctags\args.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\asm.c -o .objs\msw_wxdll_ud\sdk\ctags\asm.o
...<snip>...
-IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\python.c -o .objs\msw_wxdll_ud\sdk\ctags\python.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\read.c -o .objs\msw_wxdll_ud\sdk\ctags\read.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\rexx.c -o .objs\msw_wxdll_ud\sdk\ctags\rexx.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\routines.c -o .objs\msw_wxdll_ud\sdk\ctags\routines.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\ruby.c -o .objs\msw_wxdll_ud\sdk\ctags\ruby.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\scheme.c -o .objs\msw_wxdll_ud\sdk\ctags\scheme.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\sh.c -o .objs\msw_wxdll_ud\sdk\ctags\sh.o
mingw32-gcc.exe -Wall -g -pipe -fmessage-length=0 -mthreads -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE  -I.objs\msw_wxdll_ud\CodeLite -I- -I.objs\msw_wxdll_ud\CodeLite -I. -IC:\Usr\Proj\wxWidgets263\include -IC:\Usr\Proj\wxWidgets263\lib\gcc_dll\mswu -Isdk\ctags -IC:\MinGW\include -Isdk\ctags -IC:\Usr\Proj\cbCodeLite\ -c sdk\ctags\slang.c -o .objs\msw_wxdll_ud\sdk\ctags\slang.o
...<snip>...
.objs\msw_wxdll_ud\sdk\ctags\sql.o .objs\msw_wxdll_ud\sdk\ctags\strlist.o .objs\msw_wxdll_ud\sdk\ctags\tcl.o .objs\msw_wxdll_ud\sdk\ctags\verilog.o .objs\msw_wxdll_ud\sdk\ctags\vim.o .objs\msw_wxdll_ud\sdk\ctags\vstring.o .objs\msw_wxdll_ud\sdk\ctags\yacc.o    -lwxmsw26u
mingw32-g++.exe: .objs\msw_wxdll_ud\sdk\ctags\readtags.o: No such file or directory
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings

--- End code ---


eranif:
MM, maybe I am not udnerstanding something here, but:

Why does readtags.cpp/h are under ctags target? they should be under CodeLite.

They are the interface the tags files (although I developed my own API for it, they still there just incase)

Eran

Pecan:

--- Quote from: eranif on October 15, 2006, 11:12:45 pm ---MM, maybe I am not udnerstanding something here, but:

Why does readtags.cpp/h are under ctags target? they should be under CodeLite.

They are the interface the tags files (although I developed my own API for it, they still there just incase)

Eran



--- End quote ---

You are correct. I unchecked readtags.cpp/h from the ctags target and it compiled and is running just fine.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version