-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch SG mode to 'balanced' by default #73618
Changes from all commits
72f2fd3
ea95ad5
90faf36
70ec054
088f30b
4148828
b4bac65
c1a461d
09864fb
d4acc82
bc793cf
f3c2f0c
8f01700
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,5 @@ public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(thi | |
SourceGeneratorExecutionPreferenceUtilities.GetEditorConfigString)); | ||
|
||
public static readonly Option2<bool> SourceGeneratorExecutionBalancedFeatureFlag = new( | ||
"dotnet_source_generator_execution_balanced_feature_flag", false); | ||
"dotnet_source_generator_execution_balanced_feature_flag", true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: we still have the feature flag. So we still have control-tower support to flip this back to 'false' if we run into any problems with this in the wild. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think we might need to have a modification here to leave it false by default for VSCode - I haven't yet had a chance to implement balanced mode there yet. Easiest way if you want to change the default is have a line of code in the language server project to explicitly set this to false - https://github.com/dotnet/roslyn/blob/main/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs#L90 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -536,6 +536,8 @@ private async Task OnBatchScopeDisposedMaybeAsync(bool useAsync) | |
var additionalDocumentsToOpen = new List<(DocumentId documentId, SourceTextContainer textContainer)>(); | ||
var analyzerConfigDocumentsToOpen = new List<(DocumentId documentId, SourceTextContainer textContainer)>(); | ||
|
||
var hasAnalyzerChanges = _analyzersAddedInBatch.Count > 0 || _analyzersRemovedInBatch.Count > 0; | ||
|
||
await _projectSystemProjectFactory.ApplyBatchChangeToWorkspaceMaybeAsync(useAsync, solutionChanges => | ||
{ | ||
_sourceFiles.UpdateSolutionForBatch( | ||
|
@@ -667,25 +669,21 @@ await _projectSystemProjectFactory.ApplyBatchChangeToWorkspaceMaybeAsync(useAsyn | |
}).ConfigureAwait(false); | ||
|
||
foreach (var (documentId, textContainer) in documentsToOpen) | ||
{ | ||
await _projectSystemProjectFactory.ApplyChangeToWorkspaceMaybeAsync(useAsync, w => w.OnDocumentOpened(documentId, textContainer)).ConfigureAwait(false); | ||
} | ||
|
||
foreach (var (documentId, textContainer) in additionalDocumentsToOpen) | ||
{ | ||
await _projectSystemProjectFactory.ApplyChangeToWorkspaceMaybeAsync(useAsync, w => w.OnAdditionalDocumentOpened(documentId, textContainer)).ConfigureAwait(false); | ||
} | ||
|
||
foreach (var (documentId, textContainer) in analyzerConfigDocumentsToOpen) | ||
{ | ||
await _projectSystemProjectFactory.ApplyChangeToWorkspaceMaybeAsync(useAsync, w => w.OnAnalyzerConfigDocumentOpened(documentId, textContainer)).ConfigureAwait(false); | ||
} | ||
|
||
// Give the host the opportunity to check if those files are open | ||
if (documentFileNamesAdded.Count > 0) | ||
{ | ||
await _projectSystemProjectFactory.RaiseOnDocumentsAddedMaybeAsync(useAsync, documentFileNamesAdded.ToImmutable()).ConfigureAwait(false); | ||
} | ||
|
||
// If we added or removed analyzers, then re-run all generators to bring them up to date. | ||
if (hasAnalyzerChanges) | ||
_projectSystemProjectFactory.Workspace.EnqueueUpdateSourceGeneratorVersion(projectId: null, forceRegeneration: true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is projectId null here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that means "redo all generators". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @CyrusNajmabadi For all projects though? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit odd to me that rename tests are concerning themselves with this -- it seems like this is just something the underlying system should be handling. But maybe I'm missing something here since I'm ramping back up on this space.