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

Autocomplete (IntelliSense) After List/Collection Includes is Broken #16

Open
AinoraZ opened this issue Aug 3, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@AinoraZ
Copy link
Owner

AinoraZ commented Aug 3, 2022

Description

There is currently an issue with VS and VSCode autocomplete that leads to incorrect code suggestions for nested Includes that come after a collection Include. Specifically, this happens when the included collection implements IEnumerable<T> (ex: ICollection<T>, List<T>).

The issue is being tracked in Roslyn repository: #63108. Please like (👍) the Roslyn issue to get more attention there.

Current behaviour

Roslyn Issue

Expected behaviour

Expected

Workarounds

This only affects autocomplete on VS and VSCode and only for the first include of an affected builder. The code will still compile. Regardless, it can be annoying and break the flow.

One way to circumvent this, is to manually add the relevant type to the include expression:

.UseIncludeBuilder()
.Include((Blog b) => b.Posts, builder => builder
    .Include((Post p) => p.Readers, builder => builder
        .Include((User r) => r.Posts)
    )
)
.Build()

But it looks like a proper fix can only be done by fixing the underlying Roslyn issue.

@AinoraZ AinoraZ added the bug Something isn't working label Aug 3, 2022
@AinoraZ AinoraZ pinned this issue Aug 3, 2022
@AinoraZ AinoraZ self-assigned this Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant