codecompletion plugin Inadequate
1. macro not parser
2. template<> not parser
3. class member method : MyClass::onTest(int i, int j) != MyClass::onTest(int k, int j)
I look at the above Issue and modify codecompletio plugin. the source based for svn5859( time 2009-11-10)
modify for next function :
*) macro parser .
example BEGIN_EVENT_TABLE ...
*) template <> class parser
*) member method parser
example OnAbout(wxCommandEvent& event) == OnAbout(wxCommandEvent& WXUNUSED(event))
download source and window bin:
http://code.google.com/p/visualfc/downloads/list (http://code.google.com/p/visualfc/downloads/list)
Captions edit wxWidgets source
(http://www.cppblog.com/images/cppblog_com/visualfc/HelloWX.PNG)
Captions edit WTL source
(http://www.cppblog.com/images/cppblog_com/visualfc/HelloWTL.PNG)
Great!!!!!
I will test it tomorrow morning, (now ,I need to go to bed) :D
I did not dig into it deeper (not so familiar with cc), but some remarks.
To make it compile on linux I had to change the type of GetRealArgs from TCHAR to wxChar and the type of the variable ptr in GetRealArgs also.
Find declaration and Find implementation (from context-menu) seems to be partially broken (it does not work for functions) , only tested some random functions and variables.
From symbols browser it works.
Searching in symbols browser is partially broken: if I search for Mgr (if C::B's project-file is open), it shows me the selection-dialog, but chosing any of the entries always jumps to the root-entry (Symbols).
As written, I only did a quick test on linux (debian 64-bit, wx 2.8.10, gcc 4.3.4).
Sorry!
The source only to make and build for Window and Test.
Searching in symbols browser is bug, I will try to repair the。
Here is my comments:
1, it seems you just let the template argument appending to the "Token name", in my opinion, that is not a good idea, because it will disorder the Token tree, because the Token name is the tree's search key.
2, In the tokenizer.cpp , it seems you just regard every statement like "A(xxx) B(yyyy)" as Macros, that's may breaking of parsing some statement.
3, In tokenizer.cpp, when you read the "template arguments", I think the nestlevel should be considered. I think, from a moduality point, the related code can move from "tokenizer" class to "parserthread" class.
Anyway, Thanks for your efforts.
I already changes the template<> class for browse. the code update for top download
Make new GetRealArgs to supper class member method parser
example OnAbout(wxCommandEvent& event) == OnAbout(wxCommandEvent& WXUNUSED(event))
The macro parser:
First test the name is all upper then parser to macro. while there are some global function , but the most of the remaining is correct
hi,visualfc
in this statement,
static wxString GetRealArgs(const wxChar * args why not use statement like this
static wxString GetRealArgs(const wxString& args)I just have a quick review on the codes.I don't understand why doing this.
newToken = TokenExists(newname+realArgs, localParent);the reason is just as ollydbg said above,
Quote1, it seems you just let the template argument appending to the "Token name", in my opinion, that is not a good idea, because it will disorder the Token tree, because the Token name is the tree's search key.
since you have save the template args in m_RealArgs.
I think it is better to do this
newToken->m_Type = readType + m_RealArgs; for better token hover tip.
hi,it seems the template has not worked.
struct qq
{
int x;
int y;
};
template<typename aa>
class xx
{
aa tt;
};
xx<qq> oo;
oo.tt.-------not tip
did I miss something?
@blueshake
I'm sorry, I'm not English,can only guess what you mean, Similarly, do not know whether the right to write.
The code GetRealArgs is portable code, keep compatibility. I would like to improve the quality of the code。
The code tokenExists(newname+realArgs,...) to ensure that function name unique.The reason is to search class method name.
I will try to the code newToken->m_Type = readType + m_RealArgs;
@blueshake
the template<> already parser, but don't visible on browser tree. only on code search can be find.
Quote@blueshake
the template<> already parser, but don't visible on browser tree. only on code search can be find.
hi,Can you provide the codes.For me ,the code suggestion list don't show me the "x" and "y" in the class "qq"body but visual assist worked.
see the screen shot below.
(http://www.ikaca.sh.cn/attachment/200911/11/1745_1257934231AdEK.png)
see the screen shot.this is codeblock's tip.
(http://www.ikaca.sh.cn/attachment/200911/11/1745_1257933705f4ej.png)
this is visual assist's tip.
(http://www.ikaca.sh.cn/attachment/200911/11/1745_1257933706D1m4.png)
see,visual assist can find the right type for oo.tt. I think this is why visual assist can work and codeblock didn't.
I understand what you mean, But my code did not complete this function.
Is only able to identify the class type is or not template class type. Is not parser a variable.
@ollydbg
After some talk with visualfc .He told me the qt creator can parse template and it is open sources.I think we can learn some thing from it. :D
Quote from: blueshake on November 11, 2009, 03:50:05 PM
@ollydbg
After some talk with visualfc .He told me the qt creator can parse template and it is open sources.I think we can learn some thing from it. :D
I have already know that, you can see the links of this wiki page:
http://wiki.codeblocks.org/index.php?title=Code_Completion_Design#Usefull_Links
Actually, I have downloaded the source code of QT creator, but the source code is not easy to read. :(
Update source.
Remove name+realArgs mode
newToken = TokenExists(newname+realArgs, localParent);
To make and build on ubuntu9.10 bit32
download source and window bin:
http://code.google.com/p/visualfc/downloads/list (http://code.google.com/p/visualfc/downloads/list)
[attachment deleted by admin]
Kdevelop4 should have the best c++ parser of all OSS IDEs, look their svn for the source:)
But in my opinion the only path for CB's code-completion is using the clang's libs.
Quote from: oBFusCATed on November 12, 2009, 04:31:10 PM
Kdevelop4 should have the best c++ parser of all OSS IDEs, look their svn for the source:)
But in my opinion the only path for CB's code-completion is using the clang's libs.
hi, what does "clang's libs" mean? I have googled that, but can't find the resource. Can you explain a little? Thanks.
Quote from: ollydbg on November 12, 2009, 04:36:00 PM
hi, what does "clang's libs" mean? I have googled that, but can't find the resource. Can you explain a little? Thanks.
I guess he meant ctags.
He meant this:
http://clang.llvm.org/ (http://clang.llvm.org/)
Eran
Quote from: eranif on November 13, 2009, 12:28:40 PM
He meant this:
http://clang.llvm.org/ (http://clang.llvm.org/)
Eran
Thanks for the hint.
It seems it is a strong compiler which can give more details than the normal compiler. I'm not sure it can replace the CC plugin.
It is just like the Intel compiler, which can give the caret position to the error statement position.
llvm seems like a nice project, but it does not fully support C++ atm (actually I think C::B parser supports more than clang does).
The problem with c-lang is that it is sponsored by big corporates like Apple and they will push it towards they directions (Objective-C/++) so dont expect to get a full CodeCompletion on silver plate ;)
Here is the C++ status of that project:
http://clang.llvm.org/cxx_status.html (http://clang.llvm.org/cxx_status.html) - scroll down and see how in-complete it is atm
Eran
Quote from: eranif on November 13, 2009, 02:17:30 PM
llvm seems like a nice project, but it does not fully support C++ atm (actually I think C::B parser supports more than clang does).
just a reminder:
http://clang.llvm.org/cxx_status.html
seems Clang now fully support C++ in the Parser stage.
Maybe, we could use it to support code-completion. :D