fsprojects / fsprojects/FSharpLint
Quickfix for adding >> changing to much
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- F#
- Stars
- 327
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
Reported by @ovatsus in https://github.com/ionide/ionide-vscode-fsharp/issues/738
Ionide-fsharp 3.17.3
If I have some code like this:
let array = [| "A"; "B"; "C"|]
let foo (s: string) = s
let bar =
array
|> Array.map (sprintf "something %s")
|> Array.map foo
There's a quick fix suggestion that turns it into this:
let bar =
Array.map ((sprintf "something %s") >> foo) array
However I think the correct fix should be to this to keep the existing style
let bar =
array
|> Array.map ((sprintf "something %s") >> foo)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the quick-fix on the F# pipeline example from this issue and trace the quick-fix entry point that rewrites the chained Array.map calls. Done means the fix preserves the existing pipeline style while composing the two mappings as shown in the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100