dotnet / dotnet/fsharp

A code refactoring to deinterpol a string

Open
#15,564 3 comments 1 reaction 0 assignees View on GitHub
Area-LangService-CodeRefactorings Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

Suggested by @T-Gro

Basically it could fix the following cases:
```fsharp
let x = $"test"

let y = $"{x}"
```

Interpolation is useless here - it decreases readability and in the second case has small perf penalty. Change the code to:
```fsharp
let x = "test"

let y = x
```

Note, $"test" compiles to the "test" so it might be not worth running a code ref in the background for this case.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.