Skip to content

Commit 6a02649

Browse files
authored
Merge pull request #20555 from michaelnebel/csharp/staridlocationsbuildless
C#: `*` on Source locations in BMN.
2 parents 50e0ca8 + 9ec0c9d commit 6a02649

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

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(',');
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The extraction of location information for source code entities has been updated to use star IDs (`*` IDs). This change should be transparent to end-users but may improve extraction performance in some cases by reducing TRAP file size and eliminating overhead from location de-duplication.

0 commit comments

Comments
 (0)