Skip to content

Commit d17fcb5

Browse files
committed
refactor RoslynAnalysis v2
1 parent 72ca286 commit d17fcb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public async Task ReloadProject(SharpIdeProjectModel projectModel, CancellationT
208208
await _buildService.MsBuildAsync(_sharpIdeSolutionModel!.FilePath, BuildType.Restore, cancellationToken);
209209
var __ = SharpIdeOtel.Source.StartActivity($"{nameof(RoslynAnalysis)}.{nameof(CustomMsBuildProjectLoader)}.{nameof(CustomMsBuildProjectLoader.LoadProjectInfosAsync)}");
210210

211-
var thisProject = _workspace.CurrentSolution.Projects.Single(s => s.FilePath == projectModel.FilePath);
211+
var thisProject = GetProjectForSharpIdeProjectModel(projectModel);
212212

213213
// we can reliably rely on the Solution's graph of project inter-references, as a project has only been reloaded - no projects have been added or removed from the solution
214214
var dependentProjects = _workspace.CurrentSolution.GetProjectDependencyGraph().GetProjectsThatTransitivelyDependOnThisProject(thisProject.Id);
@@ -302,7 +302,7 @@ public async Task<ImmutableArray<Diagnostic>> GetProjectDiagnostics(SharpIdeProj
302302
{
303303
using var _ = SharpIdeOtel.Source.StartActivity($"{nameof(RoslynAnalysis)}.{nameof(GetProjectDiagnostics)}");
304304
await _solutionLoadedTcs.Task;
305-
var project = _workspace!.CurrentSolution.Projects.Single(s => s.FilePath == projectModel.FilePath);
305+
var project = GetProjectForSharpIdeProjectModel(projectModel);
306306
var compilation = await project.GetCompilationAsync(cancellationToken);
307307
Guard.Against.Null(compilation, nameof(compilation));
308308

0 commit comments

Comments
 (0)