Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Patch for calltip, support preprocessor

(1/1)

Loaden:

--- Code: ---Index: src/plugins/codecompletion/nativeparser.cpp

===================================================================

--- src/plugins/codecompletion/nativeparser.cpp (revision 6203)

+++ src/plugins/codecompletion/nativeparser.cpp (working copy)

@@ -1033,7 +1033,7 @@

         }
         if (!end)
             break;
-        lineText.Remove(end);
+        lineText.Remove(end).Trim(false);
 //        Manager::Get()->GetLogManager()->DebugLog(_T("Sending \"%s\" for call-tip"), lineText.c_str());
 
         TokensTree* tokens = m_Parser.GetTokens();
@@ -1048,8 +1048,14 @@

         ParseLocalBlock(ed);
 
         m_GettingCalltips = true;
+
+        Token* tk = tokens->at(tokens->TokenExists(lineText, -1, tkPreprocessor));
+        if (tk != NULL)
+            lineText = tk->m_Type;
+
         if (!AI(result, ed, lineText, true, true, &search_scope))
             break;
+
         for (TokenIdxSet::iterator it = result.begin(); it != result.end(); ++it)
         {
             Token* token = tokens->at(*it);

--- End code ---


[attachment deleted by admin]

ollydbg:
Nice!! A lot of works by you in these days.
Many patches to improve Codeblocks.

Loaden:
Here are little modify for support global namespace.

--- Code: ---Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 6203)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1033,7 +1033,9 @@
         }
         if (!end)
             break;
-        lineText.Remove(end);
+        lineText.Remove(end).Trim(false);
+        if (lineText.StartsWith(_T("::")))
+            lineText = lineText.Right(lineText.Length() - 2);
 //        Manager::Get()->GetLogManager()->DebugLog(_T("Sending \"%s\" for call-tip"), lineText.c_str());
 
         TokensTree* tokens = m_Parser.GetTokens();
@@ -1048,8 +1050,14 @@
         ParseLocalBlock(ed);
 
         m_GettingCalltips = true;
+
+        Token* tk = tokens->at(tokens->TokenExists(lineText, -1, tkPreprocessor));
+        if (tk != NULL)
+            lineText = tk->m_Type;
+
         if (!AI(result, ed, lineText, true, true, &search_scope))
             break;
+
         for (TokenIdxSet::iterator it = result.begin(); it != result.end(); ++it)
         {
             Token* token = tokens->at(*it);

--- End code ---

Navigation

[0] Message Index

Go to full version