Merge pull request #20555 from michaelnebel/csharp/staridlocationsbuildless

C#: `*` on Source locations in BMN.
This commit is contained in:
Michael Nebel
2025-10-22 13:28:11 +02:00
committed by GitHub
2 changed files with 25 additions and 0 deletions

View File

@@ -40,8 +40,29 @@ namespace Semmle.Extraction.CSharp.Entities
get;
}
private static void WriteStarId(EscapingTextWriter writer)
{
writer.Write('*');
}
public sealed override void WriteQuotedId(EscapingTextWriter writer)
{
if (Context.ExtractionContext.IsStandalone)
{
WriteStarId(writer);
return;
}
base.WriteQuotedId(writer);
}
public override void WriteId(EscapingTextWriter trapFile)
{
if (Context.ExtractionContext.IsStandalone)
{
WriteStarId(trapFile);
return;
}
trapFile.Write("loc,");
trapFile.WriteSubId(FileEntity);
trapFile.Write(',');

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* 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.