Skip to content

Commit

Permalink
Merge pull request #72645 from CyrusNajmabadi/includePrivates
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi authored Mar 21, 2024
2 parents 9a299e6 + 5bd9f2c commit 6eb98bb
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,18 @@ internal partial class SolutionCompilationState
[NonCopyable]
private struct SkeletonReferenceCache
{
private static readonly EmitOptions s_metadataOnlyEmitOptions = new(metadataOnly: true);
/// <summary>
/// We don't want to include private members for several reasons. First, it provides more opportunity to fail
/// to generate the skeleton reference. Second, it adds much more perf cost having to bind and emit all those
/// members. Finally, those members serve no purpose as within the IDE we don't even load privates from metadata
/// in our compilations. So this information doesn't even end up supporting any scenarios. Note: Due to not
/// loading privates, it means that if a cross language call references something private, you'll get an error,
/// but go-to-def won't work. That not ideal, but not the end of the world. And the cost needed to support
/// that working is simply too high (both on emit and on load) to be worthwhile.
/// </summary>
private static readonly EmitOptions s_metadataOnlyEmitOptions = new(
metadataOnly: true,
includePrivateMembers: false);

/// <summary>
/// Lock around <see cref="_version"/> and <see cref="_skeletonReferenceSet"/> to ensure they are updated/read
Expand Down

0 comments on commit 6eb98bb

Please sign in to comment.