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

Allow multiple documents in method debug info #66359

Merged
merged 3 commits into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/Binder/Binder_Lookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,8 @@ FileIdentifier getFileIdentifierForFileTypes()
{
if (binder is BuckStopsHereBinder lastBinder)
{
// we never expect to bind a file type in a context where the BuckStopsHereBinder lacks an AssociatedFileIdentifier
return lastBinder.AssociatedFileIdentifier.Value;
// BuckStopsHereBinder.AssociatedFileIdentifier may be null from the EE.
return lastBinder.AssociatedFileIdentifier.GetValueOrDefault();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if the file identifier we get for this binder chain is default, we simply return false from IsInScopeOfAssociatedSyntaxTree?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider asserting lastBinder.AssociatedFileIdentifier.HasValue || (this.Flags & BinderFlags.InEEMethodBinder) != 0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if the file identifier we get for this binder chain is default, we simply return false from IsInScopeOfAssociatedSyntaxTree?

Correct.

Consider asserting lastBinder.AssociatedFileIdentifier.HasValue || (this.Flags & BinderFlags.InEEMethodBinder) != 0.

Sounds good. I'll add that in a subsequent PR unless other changes are needed here.

}
}

Expand Down
Loading