mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
ide: Fixed Assist/T++ problem with function pointers
This commit is contained in:
parent
8ff4d3d9d4
commit
1553ad42e6
2 changed files with 16 additions and 1 deletions
|
|
@ -160,6 +160,17 @@ String CleanupId(const char *s)
|
|||
was_param_type = false;
|
||||
operator_def = false;
|
||||
}
|
||||
if(s[1] == '*') { // function pointer, e.g. int(*)(int)
|
||||
was_param_type = false; // prevent skipping ^^^
|
||||
while(*s && *s != ')') {
|
||||
if(*s == '*') // exclude any names
|
||||
mm.Cat(*s);
|
||||
s++;
|
||||
}
|
||||
mm.Cat(')');
|
||||
if(*s) s++;
|
||||
continue;
|
||||
}
|
||||
inparams = true;
|
||||
}
|
||||
if(*s == ',')
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ String ClangCursorInfo::Id()
|
|||
{
|
||||
if(!hasid) {
|
||||
String m, s;
|
||||
const char *p;
|
||||
int q = 0;
|
||||
switch(cursorKind) {
|
||||
case CXCursor_StructDecl:
|
||||
|
|
@ -125,7 +126,10 @@ String ClangCursorInfo::Id()
|
|||
case CXCursor_CXXMethod:
|
||||
#ifdef UBUNTU2204_WORKAROUND
|
||||
s = RawId();
|
||||
m = CleanupId(s);
|
||||
p = s;
|
||||
while(*p == '&' || *p == '*') // fix CleanupId("&Accel(int (*filter)(int))") -> Accel(int(*filter)())
|
||||
p++;
|
||||
m = CleanupId(p);
|
||||
if(s.StartsWith("template ")) { // template class method already seems to contain some scope, sometimes
|
||||
int p = m.Find('(');
|
||||
for(;;) { // remove any scope
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue