dotnet / dotnet/roslynator

RCS1266: Suggest raw string literal for multi-line strings without quotes

Open
#1,691 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Analyzer Options Area-Analyzers Feature Request up-for-grabs
Dominant language
C#
Stars
3.5k
Forks
294
Avg merge
2h 30m
Merged PRs (30d)
4

Description

It seems like this analyzer only triggers for multi-line strings that contain quotation marks. Could there be an option for it to trigger on any multi-line string, similar to what Rider's inspection does?

```cs
// "Use raw string" from Rider's inspection, but no RCS1266.
.AddDocumentFromString(@"
type Query {
field1: String
field2: String @cacheControl(maxAge: 200)
}
")
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation and tests for analyzer RCS1266, then compare how multi-line strings with and without quotation marks are detected. Confirm how an option would be represented and make the inspection cover the example's multi-line verbatim string; done means the corresponding diagnostic and tests reflect the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.