Skip to content

Commit

Permalink
Disable some asserts that are incorrect with source generators
Browse files Browse the repository at this point in the history
Fixing these is tracked by #42823.
  • Loading branch information
jasonmalinowski committed Mar 27, 2020
1 parent fa3f90e commit a50c23e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,11 @@ private static async Task<ImmutableArray<DocumentHighlights>> CreateSpansAsync(
// GetDocument will return null for locations in #load'ed trees.
// TODO: Remove this check and add logic to fetch the #load'ed tree's
// Document once https://github.com/dotnet/roslyn/issues/5260 is fixed.
// TODO: the assert is also commented out becase generated syntax trees won't
// have a document until https://github.com/dotnet/roslyn/issues/42823 is fixed
if (document == null)
{
Debug.Assert(solution.Workspace.Kind == WorkspaceKind.Interactive || solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles);
// Debug.Assert(solution.Workspace.Kind == WorkspaceKind.Interactive || solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles);
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ public async Task<ImmutableArray<SymbolAndProjectId>> DetermineCascadedSymbolsAs
// GetDocument will return null for locations in #load'ed trees.
// TODO: Remove this check and add logic to fetch the #load'ed tree's
// Document once https://github.com/dotnet/roslyn/issues/5260 is fixed.
// TODO: the assert is also commented out becase generated syntax trees won't
// have a document until https://github.com/dotnet/roslyn/issues/42823 is fixed
if (originalDocument == null)
{
Debug.Assert(solution.Workspace.Kind == WorkspaceKind.Interactive || solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles);
// Debug.Assert(solution.Workspace.Kind == WorkspaceKind.Interactive || solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles);
continue;
}

Expand Down

0 comments on commit a50c23e

Please sign in to comment.