Skip to content

Commit bc4d8a8

Browse files
committed
Merge branch 'main' into sourcestest
2 parents 6878a43 + 5d2ddbf commit bc4d8a8

File tree

75 files changed

+8514
-6001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8514
-6001
lines changed

.github/copilot-instructions.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
applyTo: "**/*.expected"
3+
---
4+
Ignore these files. These are generated to be correct by running the tests, and should not be edited manually.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
applyTo: "**/*.ql,**/*.qll"
3+
---
4+
When reviewing these QL files, do not make any comment on the code itself. You don't understand the QL programming language well enough yet. You can only make comments about the following aspects:
5+
* comments (lines starting with `//` or block comments enclosed in `/* ... */`): you can suggest improvements to the clarity of comments, or point out spelling mistakes
6+
* typos in identifiers

csharp/extractor/Semmle.Extraction.CSharp/Entities/Locations/NonGeneratedSourceLocation.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,29 @@ public File FileEntity
4040
get;
4141
}
4242

43+
private static void WriteStarId(EscapingTextWriter writer)
44+
{
45+
writer.Write('*');
46+
}
47+
48+
public sealed override void WriteQuotedId(EscapingTextWriter writer)
49+
{
50+
if (Context.ExtractionContext.IsStandalone)
51+
{
52+
WriteStarId(writer);
53+
return;
54+
}
55+
base.WriteQuotedId(writer);
56+
}
57+
4358
public override void WriteId(EscapingTextWriter trapFile)
4459
{
60+
if (Context.ExtractionContext.IsStandalone)
61+
{
62+
WriteStarId(trapFile);
63+
return;
64+
}
65+
4566
trapFile.Write("loc,");
4667
trapFile.WriteSubId(FileEntity);
4768
trapFile.Write(',');

csharp/extractor/Semmle.Extraction.CSharp/Extractor/CompilerVersion.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public CompilerVersion(Options options)
7474
specifiedFramework = compilerDir;
7575
}
7676

77-
var versionInfo = FileVersionInfo.GetVersionInfo(SpecifiedCompiler);
77+
// If csc is specified as compiler name, then attempt to read the version information from csc.dll
78+
var compilerBinaryName = Path.GetFileName(SpecifiedCompiler) == "csc" ? $"{SpecifiedCompiler}.dll" : SpecifiedCompiler;
79+
var versionInfo = FileVersionInfo.GetVersionInfo(File.Exists(compilerBinaryName) ? compilerBinaryName : SpecifiedCompiler);
7880
if (!knownCompilerNames.TryGetValue(versionInfo.OriginalFilename ?? string.Empty, out var vendor))
7981
{
8082
SkipExtractionBecause("the compiler name is not recognised");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Console.WriteLine($"<arguments>{string.Join(",", args)}</arguments>");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.100-rc.2.25502.107"
4+
}
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
import runs_on
3+
4+
@runs_on.linux
5+
def test(codeql, csharp):
6+
codeql.database.create()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Console.WriteLine($"<arguments>{string.Join(",", args)}</arguments>");

0 commit comments

Comments
 (0)