Skip to content

Conversation

@layomia
Copy link
Contributor

@layomia layomia commented Sep 27, 2023

@layomia layomia added this to the 8.0.0 milestone Sep 27, 2023
@layomia layomia self-assigned this Sep 27, 2023
@ghost
Copy link

ghost commented Sep 27, 2023

Tagging subscribers to this area: @dotnet/area-extensions-configuration
See info in area-owners.md if you want to be subscribed.

Issue Details
Author: layomia
Assignees: layomia
Labels:

area-Extensions-Configuration

Milestone: 8.0.0

Location trimmedLocation = Location.Create(sourceLocation.SourceTree?.FilePath ?? "", sourceLocation.SourceSpan, sourceLocation.GetLineSpan().Span);

if (sourceLocation.IsInSource &&
!trimmedLocation.IsInSource &&
Copy link
Member

Choose a reason for hiding this comment

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

What determines whether trimmedLocation.IsInSource is true?

try
{
FieldInfo[] fields = typeof(Location).GetFields(BindingFlags.NonPublic);
info = typeof(Location).GetField("<SourceTree>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not comfortable taking a dependency on this type of implementation detail, particularly in product code. We should instead work with @dotnet/roslyn to come up with a better solution for storing Location instances in incremental values that doesn't encapsulate the Compilation instance.

cc @stephentoub

@ericstj ericstj closed this Oct 5, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants