Skip to content

Commit

Permalink
Simplify generated file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
egregius313 committed Dec 19, 2024
1 parent b5b37af commit a03b232
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import csharp

private string getPath(File f) {
result = f.getRelativePath() and
not exists(result.indexOf("_ql_csharp_ql_integration_tests_blazor_build_mode_none_"))
or
exists(int index1, int index2, string pattern |
pattern = "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator" and
index1 = f.getRelativePath().indexOf(pattern) and
index2 = f.getRelativePath().indexOf("_ql_csharp_ql_integration_tests_blazor_build_mode_none_") and
result =
f.getRelativePath().substring(0, index1 + pattern.length()) + "/[...]" +
f.getRelativePath().substring(index2, f.getRelativePath().length())
)
}

from File f
where f.fromSource() or f.getExtension() = "razor"
select f
select getPath(f)

0 comments on commit a03b232

Please sign in to comment.