Skip to content

Commit

Permalink
More workarounds for VS Code project system issues (#68792)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat authored Jun 27, 2023
1 parent 87286e9 commit bdbf1cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ public static ActiveStatementsMap Create(
}
}

// TODO: Remove. Workaround for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1830914.
if (EditAndContinueMethodDebugInfoReader.IgnoreCaseWhenComparingDocumentNames)
{
byDocumentPath = byDocumentPath.WithComparers(keyComparer: StringComparer.OrdinalIgnoreCase);
}

return new ActiveStatementsMap(byDocumentPath, byInstruction.ToImmutableDictionary());
}

Expand Down Expand Up @@ -190,7 +196,7 @@ void AddStatement(LinePositionSpan unmappedLineSpan, ActiveStatement activeState
{
// Protect against stale/invalid active statement spans read from the PDB.
// Also guard against active statements unmapped to multiple locations in the unmapped file
// (when multiple #line map to the same span that overlaps with the active statement).
// (when multiple #line directives map to the same span that overlaps with the active statement).
if (TryGetTextSpan(oldText.Lines, unmappedLineSpan, out var unmappedSpan) &&
oldRoot.FullSpan.Contains(unmappedSpan.Start) &&
mappedStatements.Add(activeStatement))
Expand Down
5 changes: 3 additions & 2 deletions src/Features/Core/Portable/EditAndContinue/EditSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,9 @@ internal static void GetActiveStatementAndExceptionRegionSpans(
// Adds a region with specified PDB spans.
void AddNonRemappableRegion(SourceFileSpan oldSpan, SourceFileSpan newSpan, bool isExceptionRegion)
{
// it is a rude edit to change the path of the region span:
Debug.Assert(oldSpan.Path == newSpan.Path);
// TODO: Remove comparer, the path should match exactly. Workaround for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1830914.
Debug.Assert(string.Equals(oldSpan.Path, newSpan.Path,
EditAndContinueMethodDebugInfoReader.IgnoreCaseWhenComparingDocumentNames ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal));

// The up-to-date flag is copied when new active statement is created from the corresponding old one.
Debug.Assert(oldActiveStatement.IsMethodUpToDate == newActiveStatement.IsMethodUpToDate);
Expand Down

0 comments on commit bdbf1cb

Please sign in to comment.