It would suffice to update the AnalyzerConfigDocuments in the CurrentSolution. The current implementation can cause build loops as SourceGenerators can generate .editorconfig files on disk from on MSBuild properties. See dotnet/aspnetcore#30750
|
if (_workspace.EditorConfigEnabled) |
|
{ |
|
// Watch beneath the Project folder for changes to .editorconfig files. |
|
_fileSystemWatcher.Watch(".editorconfig", (file, changeType) => |
|
{ |
|
QueueProjectUpdate(projectFileInfo.FilePath, allowAutoRestore: false, projectFileInfo.ProjectIdInfo, file); |
|
}); |
|
|
|
// Watch in folders above the Project folder for changes to .editorconfig files. |
|
var parentPath = Path.GetDirectoryName(projectFileInfo.FilePath); |
|
while (parentPath != Path.GetPathRoot(parentPath)) |
|
{ |
|
if (!EditorConfigFinder.TryGetDirectoryPath(parentPath, out parentPath)) |
|
{ |
|
break; |
|
} |
|
|
|
_fileSystemWatcher.Watch(Path.Combine(parentPath, ".editorconfig"), (file, changeType) => |
|
{ |
|
QueueProjectUpdate(projectFileInfo.FilePath, allowAutoRestore: false, projectFileInfo.ProjectIdInfo, file); |
|
}); |
|
} |
|
} |
It would suffice to update the AnalyzerConfigDocuments in the CurrentSolution. The current implementation can cause build loops as SourceGenerators can generate .editorconfig files on disk from on MSBuild properties. See dotnet/aspnetcore#30750
omnisharp-roslyn/src/OmniSharp.MSBuild/ProjectManager.cs
Lines 390 to 412 in 4510973