-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Application.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let f x y = () | ||
|
||
fun x y ->{caret} f x y |
3 changes: 3 additions & 0 deletions
3
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Application.fs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let f x y = () | ||
|
||
f{caret} |
3 changes: 3 additions & 0 deletions
3
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Partial application 1.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let f x y = () | ||
|
||
fun x y ->{caret} f 1 y |
3 changes: 3 additions & 0 deletions
3
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Partial application 1.fs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let f x y = () | ||
|
||
fun x ->{caret} f 1 |
3 changes: 3 additions & 0 deletions
3
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Partial application 2.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let f x y = () | ||
|
||
fun x ->{caret} f 1 x |
3 changes: 3 additions & 0 deletions
3
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Partial application 2.fs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let f x y = () | ||
|
||
f {caret}1 |
1 change: 1 addition & 0 deletions
1
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Reference - not available.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fun x ->{caret} x |
1 change: 1 addition & 0 deletions
1
...per.FSharp/test/data/features/quickFixes/simplifyLambda/Reference - not available.fs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let {caret}foo x = 1 |
5 changes: 5 additions & 0 deletions
5
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Simplify lambda.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Test | ||
|
||
let f x y = () | ||
|
||
let _ = fun x y ->{caret} f 1 y |
34 changes: 34 additions & 0 deletions
34
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/Simplify lambda.fs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module Test | ||
|
||
let f |x|(0) |y|(1) = () | ||
|
||
let _ = |fun |x|(3) y -> f 1 y|(2) | ||
|
||
------------------------------------------------ | ||
0: The value 'x' is unused | ||
QUICKFIXES: | ||
Replace with '_' | ||
--Replace unused values with '_' in binding patterns | ||
--Replace unused values with '_' in file | ||
--Replace unused values with '_' in project | ||
--Replace unused values with '_' in solution | ||
Rename to '_x' | ||
1: The value 'y' is unused | ||
QUICKFIXES: | ||
Replace with '_' | ||
--Replace unused values with '_' in binding patterns | ||
--Replace unused values with '_' in file | ||
--Replace unused values with '_' in project | ||
--Replace unused values with '_' in solution | ||
Rename to '_y' | ||
2: Lambda can be simplified | ||
QUICKFIXES: | ||
Simplify lambda | ||
3: The value 'x' is unused | ||
QUICKFIXES: | ||
Replace with '_' | ||
--Replace unused values with '_' in parameter list | ||
--Replace unused values with '_' in file | ||
--Replace unused values with '_' in project | ||
--Replace unused values with '_' in solution | ||
Rename to '_x' |
5 changes: 5 additions & 0 deletions
5
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/To application.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Test | ||
|
||
let f x y = () | ||
|
||
let _ = fun x y ->{caret} f x y |
26 changes: 26 additions & 0 deletions
26
ReSharper.FSharp/test/data/features/quickFixes/simplifyLambda/To application.fs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Test | ||
|
||
let f |x|(0) |y|(1) = () | ||
|
||
let _ = |fun x y -> f x y|(2) | ||
|
||
------------------------------------------------ | ||
0: The value 'x' is unused | ||
QUICKFIXES: | ||
Replace with '_' | ||
--Replace unused values with '_' in binding patterns | ||
--Replace unused values with '_' in file | ||
--Replace unused values with '_' in project | ||
--Replace unused values with '_' in solution | ||
Rename to '_x' | ||
1: The value 'y' is unused | ||
QUICKFIXES: | ||
Replace with '_' | ||
--Replace unused values with '_' in binding patterns | ||
--Replace unused values with '_' in file | ||
--Replace unused values with '_' in project | ||
--Replace unused values with '_' in solution | ||
Rename to '_y' | ||
2: Lambda can be simplified | ||
QUICKFIXES: | ||
To application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
ReSharper.FSharp/test/src/FSharp.Tests/QuickFixes/SimplifyLambdaTest.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace JetBrains.ReSharper.Plugins.FSharp.Tests.Features | ||
|
||
open JetBrains.ReSharper.FeaturesTestFramework.Intentions | ||
open JetBrains.ReSharper.Plugins.FSharp.Psi.Features.Daemon.QuickFixes | ||
open JetBrains.ReSharper.Plugins.FSharp.Tests | ||
open NUnit.Framework | ||
|
||
type SimplifyLambdaTest() = | ||
inherit FSharpQuickFixTestBase<SimplifyLambdaFix>() | ||
|
||
override x.RelativeTestDataPath = "features/quickFixes/simplifyLambda" | ||
|
||
[<Test>] member x.``Application``() = x.DoNamedTest() | ||
[<Test>] member x.``Partial application 1``() = x.DoNamedTest() | ||
[<Test>] member x.``Partial application 2``() = x.DoNamedTest() | ||
[<Test; NotAvailable>] member x.``Reference - not available``() = x.DoNamedTest() | ||
|
||
|
||
[<FSharpTest>] | ||
type SimplifyLambdaAvailabilityTest() = | ||
inherit QuickFixAvailabilityTestBase() | ||
|
||
override x.RelativeTestDataPath = "features/quickFixes/simplifyLambda" | ||
|
||
[<Test>] member x.``To application``() = x.DoNamedTest() | ||
[<Test>] member x.``Simplify lambda``() = x.DoNamedTest() |