Skip to content

Commit

Permalink
Fix analyzer RCS0056 (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Sep 13, 2024
1 parent 4130b73 commit 2011c02
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix analyzer [RCS1018](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1018) ([PR](https://github.com/dotnet/roslynator/pull/1510))
- Fix analyzer [RCS1264](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1264) ([PR](https://github.com/dotnet/roslynator/pull/1511))
- Fix analyzer [RCS0053](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0053) ([PR](https://github.com/dotnet/roslynator/pull/1512))
- Fix analyzer [RCS0056](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0056) ([PR](https://github.com/dotnet/roslynator/pull/1514))

### Changed

Expand Down
1 change: 1 addition & 0 deletions src/Formatting.Analyzers/CSharp/LineIsTooLongAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ private static void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context)
SyntaxKind.StringLiteralToken,
#if ROSLYN_4_2
SyntaxKind.InterpolatedRawStringEndToken,
SyntaxKind.MultiLineRawStringLiteralToken,
#endif
SyntaxKind.InterpolatedStringEndToken))
{
Expand Down
19 changes: 19 additions & 0 deletions src/Tests/Formatting.Analyzers.Tests/RCS0056LineIsTooLongTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,25 @@ static void M(string x, int y)
0);
}
}
"""");
}

[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)]
public async Task TestNoDiagnostic_LongRawStringLiteral()
{
await VerifyNoDiagnosticAsync(""""
class C
{
static void M(string x, int y)
{
C.M(
"""

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
""",
0);
}
}
"""");
}
}

0 comments on commit 2011c02

Please sign in to comment.