When hovering over a variable of type Int<signed char> the tooltip being displayed says Int<signedchar>.
Minimal code sample?
OS/C::B/compiler version?
template<class Int_T, Int_T Min_Range,
Int_T Max_Range>
class Int
{};
OS: W8
c::b: svn 7452
compiler: gcc 4.6.1
Quote from: smallB on October 28, 2011, 08:28:28 AM
template<class Int_T, Int_T Min_Range,
Int_T Max_Range>
class Int
{};
OS: W8
c::b: svn 7452
compiler: gcc 4.6.1
So, when you hover on which variable? What is the expect tip should show?
PS: template handling in CC's parser is not quite good. :D
The tooltip should show Int<signed char>
I just test the code:
template<class Int_T, Int_T Min_Range,
Int_T Max_Range>
class Int
{};
Int < signed char > aaaa;
Then hover on the "aaaa", it looks like it will show "Int<signedchar>", so it is a bug!!
I will take some time to check it. Thanks for the report!!!
Thanks! It's great feeling that I can contribute in my tiny way to make this great IDE even better.
The patch should fix your problem.
Index: E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/parserthread.cpp (revision 7535)
+++ E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -2646,6 +2646,7 @@
else if (tmp==ParserConsts::gt)
{
--nestLvl;
+ m_TemplateArgument.Trim();
m_TemplateArgument << tmp;
}
else if (tmp==ParserConsts::semicolon)
@@ -2658,7 +2659,7 @@
else if (tmp.IsEmpty())
break;
else
- m_TemplateArgument << tmp;
+ m_TemplateArgument << tmp <<_T(" ");
if (nestLvl <= 0)
break;
}
BTW:
If you write the code: (No need to write some "template" declaration)
AAA< CCC DDD> EEE;
Then, "EEEE" will be recognized as a variable, and "AAA< CCC DDD>" will be its type string.
@ollydbg Hi, thanks for this patch. This will be probably sounds strange to you but I have absolutely no idea what to do with this patch you've provided. Would you mind telling me next steps?
Thanks
Quote from: smallB on October 29, 2011, 01:09:25 PM
Would you mind telling me next steps?
Check out the codeblocks' source code, then you can apply my patch on the source, and later build the codeblocks yourself under Windows.
There are some wiki, see:
Installing Code::Blocks from source on Windows - CodeBlocks (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows), follow the steps and it was easy. :D
(Also: patch application (http://wiki.codeblocks.org/index.php?title=Creating_a_patch_to_submit_to_BerliOS_(Patch_Tracker)#Patch_application_and_testing).)