-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly construct a callTip for pointers and symbols with breadcrumbs (T, [], *, etc) #175
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is missing tests
auto c = callTip[index]; | ||
if (c == '*') | ||
isPtr = true; | ||
else | ||
{ | ||
if ((c == ')') && isPtr) | ||
{ | ||
break; | ||
} | ||
else if (c == ']' && isPtr) | ||
{ | ||
if (c > 1) | ||
{ | ||
// TODO: if we ever put the length for static array | ||
// this will need to be updated to support that | ||
if(callTip[index -1] == '[') | ||
{ | ||
ptrArray = true; | ||
break; | ||
} | ||
|
||
// TODO: if we ever put the type name for AA | ||
// this will need to be updated to support that | ||
if(callTip[index -1] == '.') | ||
{ | ||
ptrAA = true; | ||
break; | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
ptrType = true; | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mixed whitespaces with tabs here
literally nobody other than WebFreak001 care about this project this is very sad and disappointing, what D people are doing? they busy programming in Java? |
can you add tests? this is a non-trivial change and tests always also help convey what the PR is meant to fulfill or not fulfill for other reviewers + helps the feature stay working across later changes. |
bool ptrAA = false; | ||
|
||
auto index = callTip.length; | ||
while(index--) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be better to iterate over the breadcrumbs (maybe make a copy) instead of iterating over the characters for stability?
moved to dlang-community/DCD#680 |
The is the continuation of my previous PR that i closed from my old account
This properly handles pointers, they show the Type with the star! finally!
This also properly creates the callTip for arrays, they show as Type[], not more arr