From 330b4e7ebcce5601b9af666e3dcebb517a1f9eb2 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 3 Jun 2026 13:57:45 +0200 Subject: [PATCH] C#: Address other CoPilot review comments. --- .../Entities/Expressions/ElementAccess.cs | 7 ++++--- csharp/ql/lib/change-notes/2026-05-21-spanaccess-range.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/ElementAccess.cs b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/ElementAccess.cs index f6f44799312..bc81b9254d4 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/ElementAccess.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/ElementAccess.cs @@ -103,9 +103,10 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions /// /// Determines whether the given method is a slice method, which is defined as a method with - /// the name "Slice" or "SubString" and two parameters. - /// The method symbol to check. - /// True if the method is a slice method, false otherwise. + /// the name "Slice" or "Substring" and two parameters. + /// + /// The method symbol to check. + /// True if the method is a slice method; false otherwise. private bool IsSliceWithRange(IMethodSymbol method, [NotNullWhen(true)] out IPropertySymbol? lengthPropertySymbol, [NotNullWhen(true)] out RangeExpressionSyntax? range) { range = null; diff --git a/csharp/ql/lib/change-notes/2026-05-21-spanaccess-range.md b/csharp/ql/lib/change-notes/2026-05-21-spanaccess-range.md index 72858accfa1..b5e81d9adb9 100644 --- a/csharp/ql/lib/change-notes/2026-05-21-spanaccess-range.md +++ b/csharp/ql/lib/change-notes/2026-05-21-spanaccess-range.md @@ -1,4 +1,4 @@ --- category: minorAnalysis --- -* Improved extraction of span range-access expressions (for example, `a[0..3]`). These expressions are now extracted as span `Slice` calls. +* Improved extraction of range-access expressions on spans and strings (for example, `a[0..3]`). These expressions are now extracted as `Slice` (span) or `Substring` (string) calls.