-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16776 from tamasvajk/fix/source-generator-folder
C#: Make sure no file is added twice to the compilation
- Loading branch information
Showing
10 changed files
with
50 additions
and
1 deletion.
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
Empty file.
4 changes: 4 additions & 0 deletions
4
csharp/ql/integration-tests/all-platforms/source_generator/Diag.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import csharp | ||
import semmle.code.csharp.commons.Diagnostics | ||
|
||
query predicate test2(CompilerError e) { any() } |
6 changes: 6 additions & 0 deletions
6
csharp/ql/integration-tests/all-platforms/source_generator/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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
| Generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | Generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | | ||
| Generated/x.cs:0:0:0:0 | Generated/x.cs | | ||
| Program.cs:0:0:0:0 | Program.cs | | ||
| obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | | ||
| obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | obj/Debug/net8.0/test.AssemblyInfo.cs | | ||
| obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | obj/Debug/net8.0/test.GlobalUsings.g.cs | |
5 changes: 5 additions & 0 deletions
5
csharp/ql/integration-tests/all-platforms/source_generator/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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import csharp | ||
|
||
from File f | ||
where f.fromSource() | ||
select f |
4 changes: 4 additions & 0 deletions
4
csharp/ql/integration-tests/all-platforms/source_generator/Generated/x.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// File added to the Generated folder. This is not a source generator output file. | ||
class X | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
csharp/ql/integration-tests/all-platforms/source_generator/Program.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Text.RegularExpressions; | ||
|
||
Console.WriteLine("Hello, World!"); | ||
|
||
partial class Test | ||
{ | ||
[GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")] | ||
private static partial Regex AbcOrDefGeneratedRegex(); | ||
} |
5 changes: 5 additions & 0 deletions
5
csharp/ql/integration-tests/all-platforms/source_generator/global.json
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": "8.0.101" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
csharp/ql/integration-tests/all-platforms/source_generator/test.csproj
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<!-- Add source generated files into the Generated folder. --> | ||
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath> | ||
</PropertyGroup> | ||
|
||
</Project> |
3 changes: 3 additions & 0 deletions
3
csharp/ql/integration-tests/all-platforms/source_generator/test.py
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from create_database_utils import * | ||
|
||
run_codeql_database_create(['dotnet build'], lang="csharp") |