Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

RUSShyTwo
Copy link

@RUSShyTwo RUSShyTwo commented Dec 4, 2021

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

@WebFreak001 WebFreak001 self-assigned this Dec 4, 2021
Copy link
Member

@WebFreak001 WebFreak001 left a 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

Comment on lines +327 to +362
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;
}
}
Copy link
Member

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

@RUSShyTwo
Copy link
Author

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?

@WebFreak001
Copy link
Member

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--)
Copy link
Member

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?

@WebFreak001
Copy link
Member

moved to dlang-community/DCD#680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants