dotnet / dotnet/roslynator

Refactorings in record types

Open
#1,741 0 comments 0 reactions 0 assignees View on GitHub
Area-Refactorings Feature Request
Dominant language
C#
Stars
3.5k
Forks
294
Avg merge
2h 30m
Merged PRs (30d)
4

Description

I would like a simple refactoring on a record type to convert between constructor defined property and regular CLR property. Below is the example:

```
public record MyType(int Value1, [property: Range(10, 20)] int Value2);
```
The refactoring should be able to convert it to:
```
public record MyType(int Value1)
{
[Range(10, 20)]
public int Value2
{
get;
init;
}
}
```
It should be able to convert it back as well.

Contributor guide

Open the contributing guide

Research direction

No implementation files or tests are named. Start by locating Roslynator's existing record-type refactoring code and related tests, then compare the two transformations in the issue. Done means the refactoring works in both directions while preserving the property attribute and record behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.