Author Topic: Code Completion little patch  (Read 5909 times)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Code Completion little patch
« on: July 02, 2005, 07:20:01 pm »
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: [Select]
if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
To
Code: [Select]
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 :)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Code Completion little patch
« Reply #1 on: July 02, 2005, 09:08:47 pm »
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 :)

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...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Code Completion little patch
« Reply #2 on: July 04, 2005, 12:00:27 pm »
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
Code: [Select]
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
Code: [Select]
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);
                     }

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Code Completion little patch
« Reply #3 on: July 04, 2005, 12:55:57 pm »
Quote from: Ceniza
src/plugins/codecompletion/parser/parserthread.cpp line 541:
From
Code: [Select]
if (!m_Str.IsEmpty() && isalpha(token.GetChar(0)))
To
Code: [Select]
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...