-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C#: Change source generated razor file paths to be relative to csproj
- Loading branch information
Showing
5 changed files
with
24 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
csharp/ql/integration-tests/all-platforms/cshtml_standalone/Files.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
| Program.cs | | ||
| Views/Home/Index.cshtml | | ||
| test-db/working/implicitUsings/GlobalUsings.g.cs | | ||
| test-db/working/razor/EC52D77FE9BF67AD10C5C3F248392316/Microsoft.CodeAnalysis.Razor.Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/[...]_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_test_test_Views_Home_Index_cshtml.g.cs | | ||
| test-db/working/razor/EC52D77FE9BF67AD10C5C3F248392316/Microsoft.CodeAnalysis.Razor.Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Views_Home_Index_cshtml.g.cs | |
18 changes: 1 addition & 17 deletions
18
csharp/ql/integration-tests/all-platforms/cshtml_standalone/Files.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
import csharp | ||
|
||
private string getPath(File f) { | ||
result = f.getRelativePath() and | ||
not exists(result.indexOf("_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_")) | ||
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_all_platforms_cshtml_standalone_") 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() = "cshtml" | ||
select getPath(f) | ||
select f.getRelativePath() |
2 changes: 1 addition & 1 deletion
2
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/Files.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
| Program.cs | | ||
| Views/Home/Index.cshtml | | ||
| test-db/working/implicitUsings/GlobalUsings.g.cs | | ||
| test-db/working/razor/EC52D77FE9BF67AD10C5C3F248392316/[...]/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/[...]_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_net6_test_test_Views_Home_Index_cshtml.g.cs | | ||
| test-db/working/razor/EC52D77FE9BF67AD10C5C3F248392316/[...]/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Views_Home_Index_cshtml.g.cs | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters