Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix enum contained flags check for partial matches in [RCS1258](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1258) ([PR](https://github.com/dotnet/roslynator/pull/1740) by @ovska)
- Fix analyzer [RCS1146](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1146) ([PR](https://github.com/dotnet/roslynator/pull/1747))
- Fix analyzer [RCS1194](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1194) ([PR](https://github.com/dotnet/roslynator/pull/1733))
- [CLI] Fix `fix` command ignoring `--include` / `--exclude` file filter ([PR](https://github.com/dotnet/roslynator/pull/1758) by @hashiiiii)

## [4.15.0] - 2025-12-14

Expand Down
13 changes: 10 additions & 3 deletions src/Workspaces.Core/CodeFixes/CodeFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,16 @@ ImmutableArray<Diagnostic> GetFixableDiagnostics(
IEnumerable<Diagnostic> fixableCompilerDiagnostics = compilerDiagnostics
.Where(f => f.Severity != DiagnosticSeverity.Error
&& !Options.IgnoredCompilerDiagnosticIds.Contains(f.Id)
&& fixersById.ContainsKey(f.Id));
&& fixersById.ContainsKey(f.Id)
&& (f.Location.SourceTree is null
|| Options.FileSystemFilter?.IsMatch(f.Location.SourceTree.FilePath) != false));

return diagnostics
.Where(f => f.IsEffective(Options, project.CompilationOptions)
&& analyzersById.ContainsKey(f.Id)
&& fixersById.ContainsKey(f.Id))
&& fixersById.ContainsKey(f.Id)
&& (f.Location.SourceTree is null
|| Options.FileSystemFilter?.IsMatch(f.Location.SourceTree.FilePath) != false))
Comment thread
josefpihrt marked this conversation as resolved.
.Concat(fixableCompilerDiagnostics)
.ToImmutableArray();
}
Expand Down Expand Up @@ -357,7 +361,10 @@ private async Task<DiagnosticFixResult> FixDiagnosticsAsync(
}

diagnostics = diagnostics
.Where(f => f.Id == descriptor.Id && f.Severity >= Options.SeverityLevel)
.Where(f => f.Id == descriptor.Id
&& f.Severity >= Options.SeverityLevel
&& (f.Location.SourceTree is null
|| Options.FileSystemFilter?.IsMatch(f.Location.SourceTree.FilePath) != false))
.ToImmutableArray();

if (fixKind == DiagnosticFixKind.CompilerError)
Expand Down
Loading