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

No completion when mixing auto with symbols that references types bellow the cursor #717

Open
ryuukk opened this issue Feb 17, 2023 · 2 comments

Comments

@ryuukk
Copy link
Contributor

ryuukk commented Feb 17, 2023

I found a weird issue, it happens with ~master

struct A
{
    B b;

    void test()
    {
        auto here = b.inside_b;
        here.|<----- cursor here
    }
}

struct B
{
    int inside_b;
}

dcd-server doesn't show anything

If i move B and put it above A, then i get completion

I came accross something similar in my Template PR, so i added a test and this change fixes it:

e7a83be#diff-86f3b1d98d85f9defb3b2ad13eed3ba76c75dbbee18dc6d8ae5214a3b9b07a0dR98-R113

Test: e7a83be#diff-c272767d1a40f2efc3f5daa8238fb6c8063e8220a862e86aa55432ab7cd0392dR26-R28

But no luck for this one here, since B is on a different scope

@ryuukk
Copy link
Contributor Author

ryuukk commented Feb 17, 2023

As a fix, we could do like for the thirdPass, and take into account the whole lookup.breadcrumbs (the whole chain) instead of a just the 1st one

Also it needs to be added from resolveTypeFromInitializer from secondPass

@ryuukk
Copy link
Contributor Author

ryuukk commented Feb 17, 2023

Found a fix!

Simply call secondPass a second time after thirdPass, so it takes care of everything!

I'll create a test with this code and send a PR

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

No branches or pull requests

1 participant