Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Code Completion little patch

(1/1)

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
--- Code: ---if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
--- End code ---

To
--- Code: ---if (!m_Str.IsEmpty() && (isalpha(token.GetChar(0)) || token.GetChar(0) == '_'))
--- End code ---


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: Ceniza ---Yes, I know, it would be better to submit it as a Patch. I'll try to find the needed information about it :)
--- End quote ---

Updated the navigation menu on the left side of the screen. Now you can't miss it ;)

Yiannis.

tiwag:

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


if you have installed cvs its as easy as typing

--- Code: ---cvs diff -u > outputfile.patch
--- End code ---

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

--- Code: ---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);
                     }
--- End code ---

mandrav:

--- Quote from: Ceniza ---src/plugins/codecompletion/parser/parserthread.cpp line 541:
From
--- Code: ---if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
--- End code ---

To
--- Code: ---if (!m_Str.IsEmpty() && (isalpha(token.GetChar(0)) || token.GetChar(0) == '_'))
--- End code ---


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

Never mind, I 'll add it now.
But, please, use the patch system next time (you 'll get credited too ;) ).

Yiannis.

Navigation

[0] Message Index

Go to full version