Version: 18.3.0 Insiders [11305.81.main]
CA1822 reports the member doesn't access instance data and can be marked static, but of course if you do that node is then a compile error because it absolutely can't be static.
Full code, FWIW
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Microsoft.CodeAnalysis.Razor.Workspaces;
internal static class CSharpSyntaxNodeExtensions
{
extension(SyntaxNode node)
{
internal bool IsStringLiteral()
{
return node is InterpolatedStringTextSyntax or LiteralExpressionSyntax
{
RawKind: (int)SyntaxKind.StringLiteralExpression or (int)SyntaxKind.Utf8StringLiteralExpression
};
}
}
}