News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Code Completion little patch

Started by Ceniza, July 02, 2005, 07:20:01 PM

Previous topic - Next topic

Ceniza

This is one of the lost posts (due to the server problem).

I was checking Code::Blocks CVS and I see the new AStyle plugin is in there, but the little patch for Code Completion is not.

Once again, the problem: when you have a variable (tested as member of a class) and it begins with an underline (_), the lexer will recognize it but the parser won't, so it won't be in the Symbols tab.

src/plugins/codecompletion/parser/parserthread.cpp line 541:
From if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
To if (!m_Str.IsEmpty() && (isalpha(token.GetChar(0)) || token.GetChar(0) == '_'))

Yes, I know, it would be better to submit it as a Patch. I'll try to find the needed information about it :)

mandrav

Quote from: CenizaYes, I know, it would be better to submit it as a Patch. I'll try to find the needed information about it :)
Updated the navigation menu on the left side of the screen. Now you can't miss it ;)

Yiannis.
Be patient!
This bug will be fixed soon...

tiwag

Quote from: Ceniza... to submit it as a Patch. I'll try to find the needed information about it :)

if you have installed cvs its as easy as typing
cvs diff -u > outputfile.patch
in that directory where your modiefied file(s) reside,
in order to make a diff- (aka patch-file) "outputfile.patch" versus the actual cvs version.
which can be applied to the original source files with a patch utility, like the one from the GNUwin32 tools
http://gnuwin32.sourceforge.net/packages.html
http://gnuwin32.sourceforge.net/packages/patch.htm

in this case we get the following patch file
Index: src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/codecompletion/parser/parserthread.cpp,v
retrieving revision 1.15
diff -u -r1.15 parserthread.cpp
--- src/plugins/codecompletion/parser/parserthread.cpp  16 Apr 2005 16:31:34 -0000  1.15
+++ src/plugins/codecompletion/parser/parserthread.cpp  4 Jul 2005 09:35:26 -0000
@@ -538,7 +538,8 @@
//                 Log("m_Str='"+m_Str+"'");
//                 Log("token='"+token+"'");
//                 Log("peek='"+peek+"'");
-                   if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
+//                 if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
+                   if (!m_Str.IsEmpty() && (isalpha(token.GetChar(0)) || token.GetChar(0) == '_'))
                   {
                        DoAddToken(tkVariable, token);
                    }

mandrav

Quote from: Cenizasrc/plugins/codecompletion/parser/parserthread.cpp line 541:
From if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
To if (!m_Str.IsEmpty() && (isalpha(token.GetChar(0)) || token.GetChar(0) == '_'))

Yes, I know, it would be better to submit it as a Patch. I'll try to find the needed information about it :)
Never mind, I 'll add it now.
But, please, use the patch system next time (you 'll get credited too ;) ).

Yiannis.
Be patient!
This bug will be fixed soon...