Load analyzers in separate ALCs
This commit is contained in:
@@ -415,8 +415,15 @@ public partial class CustomMsBuildProjectLoader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var analyzerReferences = commandLineArgs.ResolveAnalyzerReferences(analyzerLoader).Distinct(Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.AnalyzerReferencePathComparer.Instance);
|
||||||
|
|
||||||
return commandLineArgs.ResolveAnalyzerReferences(analyzerLoader).Distinct(Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.AnalyzerReferencePathComparer.Instance);
|
var isolatedReferences = IsolatedAnalyzerReferenceSet.CreateIsolatedAnalyzerReferencesAsync(
|
||||||
|
useAsync: false,
|
||||||
|
analyzerReferences.ToImmutableArray(),
|
||||||
|
_solutionServices,
|
||||||
|
CancellationToken.None).VerifyCompleted();
|
||||||
|
|
||||||
|
return isolatedReferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImmutableArray<DocumentInfo> CreateDocumentInfos(IReadOnlyList<DocumentFileInfo> documentFileInfos, ProjectId projectId, Encoding? encoding)
|
private ImmutableArray<DocumentInfo> CreateDocumentInfos(IReadOnlyList<DocumentFileInfo> documentFileInfos, ProjectId projectId, Encoding? encoding)
|
||||||
|
|||||||
@@ -35,13 +35,16 @@ public class RoslynAnalysisTests
|
|||||||
var solutionModel = await VsPersistenceMapper.GetSolutionModel(@"C:\Users\Matthew\Documents\Git\SharpIDE\SharpIDE.sln", TestContext.Current.CancellationToken);
|
var solutionModel = await VsPersistenceMapper.GetSolutionModel(@"C:\Users\Matthew\Documents\Git\SharpIDE\SharpIDE.sln", TestContext.Current.CancellationToken);
|
||||||
var sharpIdeApplicationProject = solutionModel.AllProjects.Single(p => p.Name == "SharpIDE.Application");
|
var sharpIdeApplicationProject = solutionModel.AllProjects.Single(p => p.Name == "SharpIDE.Application");
|
||||||
|
|
||||||
|
var timer = Stopwatch.StartNew();
|
||||||
roslynAnalysis._solutionLoadedTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
roslynAnalysis._solutionLoadedTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
await roslynAnalysis.LoadSolutionInWorkspace(solutionModel, TestContext.Current.CancellationToken);
|
await roslynAnalysis.LoadSolutionInWorkspace(solutionModel, TestContext.Current.CancellationToken);
|
||||||
|
timer.Stop();
|
||||||
|
_testOutputHelper.WriteLine($"Solution load: {timer.ElapsedMilliseconds} ms");
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
foreach (var i in Enumerable.Range(0, 3))
|
foreach (var i in Enumerable.Range(0, 3))
|
||||||
{
|
{
|
||||||
var timer = Stopwatch.StartNew();
|
timer.Restart();
|
||||||
await roslynAnalysis.GetProjectDiagnostics(sharpIdeApplicationProject, TestContext.Current.CancellationToken);
|
await roslynAnalysis.GetProjectDiagnostics(sharpIdeApplicationProject, TestContext.Current.CancellationToken);
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
_testOutputHelper.WriteLine($"Diagnostics: {timer.ElapsedMilliseconds.ToString()}ms");
|
_testOutputHelper.WriteLine($"Diagnostics: {timer.ElapsedMilliseconds.ToString()}ms");
|
||||||
|
|||||||
Reference in New Issue
Block a user