Skip to content

Commit 116cfaa

Browse files
author
Kapil Borle
committed
Use only 1 runspace in analysis service
Having multiple runspaces crashed scriptanalyzer invocation because of the following two issues: * PSCmdlet.WriteOutput being called from another thread than Begin/Process * CompositionContainer.ComposeParts complaining that "...Only one batch can be composed at a time" We used multiple runspaces in the first pace because PSSA was slow and having multiple instances sped things up. But having multiple runspaces is causing a lot of issues which are hard to debug. Also, PSSA has become significantly fast compared to the previous version and there having just one runspace should give a reasonable performance. And on the positive side we do not have to deal with the aforementioned crashes.
1 parent de4ac3f commit 116cfaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PowerShellEditorServices/Analysis/AnalysisService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class AnalysisService : IDisposable
2424
{
2525
#region Private Fields
2626

27-
private const int NumRunspaces = 2;
27+
private const int NumRunspaces = 1;
2828
private RunspacePool analysisRunspacePool;
2929
private PSModuleInfo scriptAnalyzerModuleInfo;
3030

0 commit comments

Comments
 (0)