ide: Autocomplete issue with ? : operator #1145

git-svn-id: svn://ultimatepp.org/upp/trunk@8596 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-06-24 18:53:24 +00:00
parent dd697f4f68
commit 9111958d81
2 changed files with 7 additions and 10 deletions

View file

@ -209,9 +209,8 @@ String AssistEditor::CompleteIdBack(int& q)
id = '<' + id; id = '<' + id;
} }
else else
if(Ch(q - 1) == ':') { if(Ch(q - 1) == ':' && Ch(q - 2) == ':') {
while(Ch(q - 1) == ':') q -= 2;
q--;
id = "::" + id; id = "::" + id;
} }
else { else {
@ -253,10 +252,9 @@ Vector<String> AssistEditor::ReadBack(int q)
for(;;) { for(;;) {
id = IdBack(q) + id; id = IdBack(q) + id;
SkipSpcBack(q); SkipSpcBack(q);
if(Ch(q - 1) != ':') if(!(Ch(q - 1) == ':' && Ch(q - 2) == ':'))
break; break;
while(Ch(q - 1) == ':') q -= 2;
q--;
id = "::" + id; id = "::" + id;
SkipSpcBack(q); SkipSpcBack(q);
} }
@ -453,9 +451,8 @@ void AssistEditor::Assist()
return; return;
} }
} }
if(Ch(q - 1) == ':') { if(Ch(q - 1) == ':' && Ch(q - 2) == ':') {
while(Ch(q - 1) == ':') q -= 2;
q--;
Vector<String> tparam; Vector<String> tparam;
String scope = ParseTemplatedType(Qualify(parser.current_scope, CompleteIdBack(q), parser.context.namespace_using), tparam); String scope = ParseTemplatedType(Qualify(parser.current_scope, CompleteIdBack(q), parser.context.namespace_using), tparam);
GatherItems(scope, false, in_types, true); GatherItems(scope, false, in_types, true);

View file

@ -1,6 +1,6 @@
#include "ide.h" #include "ide.h"
#if 1 #if 0
#define LDUMP(x) DDUMP(x) #define LDUMP(x) DDUMP(x)
#define LDUMPC(x) DDUMPC(x) #define LDUMPC(x) DDUMPC(x)
#define LLOG(x) DLOG(x) #define LLOG(x) DLOG(x)