This patch comes from
ollydbg, I've only done testing, and ultimately the creation of patches.
Very much hope that this patch can be applied before the 10.4 version, so that will benefit the majority of CB + VC users.
When the application of this patch, VC STL code completion will become perfect!
Before applying patches, this code is no code completion tips.
#include <iostream>
#include <string>
using namespace std;
int main()
{
std::string s;
s.
return 0;
}
However, after applying this patch, VC STL code completion tips and the GCC as perfect!
Thanks!
Index: src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- src/plugins/codecompletion/codecompletion.cpp (revision 6193)
+++ src/plugins/codecompletion/codecompletion.cpp (working copy)
@@ -205,6 +205,10 @@
Tokenizer::SetReplacementString(_T("_GLIBCXX_END_NAMESPACE_TR1"), _T("}"));
Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NAMESPACE_TR1"), _T("-namespace tr1 {"));
+
+ // for VC
+ Tokenizer::SetReplacementString(_T("_STD_BEGIN"), _T("-namespace std {"));
+ Tokenizer::SetReplacementString(_T("_STD_END"), _T("}"));
}
else
cfg->Read(_T("token_replacements"), &repl);
Index: src/plugins/codecompletion/parser/tokenizer.cpp
===================================================================
--- src/plugins/codecompletion/parser/tokenizer.cpp (revision 6193)
+++ src/plugins/codecompletion/parser/tokenizer.cpp (working copy)
@@ -292,7 +292,7 @@
}
// expect we are not in a C-string.
-bool Tokenizer::SkipToOneOfChars(const wxChar* chars, bool supportNesting, bool skipPreprocessor)
+bool Tokenizer::SkipToOneOfChars(const wxChar* chars, bool supportNesting, bool skipPreprocessor, bool skipAnglebrace)
{
while (NotEOF() && !CharInString(CurrentChar(), chars))
{
@@ -320,11 +320,15 @@
case '(': SkipBlock('('); break;
case '[': SkipBlock('['); break;
case '<': // don't skip if << operator
- if (NextChar() == '<')
- MoveToNextChar(2); // skip it and also the next '<' or the next '<' leads to a SkipBlock('<');
- else
- SkipBlock('<');
- break;
+ if (skipAnglebrace)
+ {
+ if (NextChar() == '<')
+ MoveToNextChar(2); // skip it and also the next '<' or the next '<' leads to a SkipBlock('<');
+ else
+ SkipBlock('<');
+ break;
+ }
+
default: done = true; break;
}
}
@@ -503,7 +507,7 @@
{
if (c == _T('='))
{
- if (!SkipToOneOfChars(_T(",;}"), true, true))
+ if (!SkipToOneOfChars(_T(",;}"), true, true, false))
return false;
}
}
Index: src/plugins/codecompletion/parser/tokenizer.h
===================================================================
--- src/plugins/codecompletion/parser/tokenizer.h (revision 6193)
+++ src/plugins/codecompletion/parser/tokenizer.h (working copy)
@@ -134,7 +134,7 @@
bool SkipWhiteSpace();
bool IsEscapedChar();
bool SkipToChar(const wxChar& ch);
- bool SkipToOneOfChars(const wxChar* chars, bool supportNesting = false, bool skipPreprocessor = false);
+ bool SkipToOneOfChars(const wxChar* chars, bool supportNesting = false, bool skipPreprocessor = false, bool skipAnglebrace = true);
bool SkipBlock(const wxChar& ch);
bool SkipUnwanted(); // skips comments, assignments, preprocessor etc.
bool SkipComment(bool skipWhiteAtEnd = true);
[attachment deleted by admin]