Skip to content

Commit

Permalink
applied formatting with dotnet fantomas
Browse files Browse the repository at this point in the history
  • Loading branch information
jkone27 committed Sep 13, 2023
1 parent 55294bc commit d3d6f8d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
25 changes: 9 additions & 16 deletions src/FsAutoComplete/CodeFixes/AddMissingWildcardOperator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ let tryFindPattern pos input =
member _.VisitExpr(path, traverseSynExpr, defaultTraverse, expr) =
match expr with
| SynExpr.LongIdent(
longDotId =
SynLongIdent.SynLongIdent(
trivia = [ Some(IdentTrivia.OriginalNotation("|->")) ]
)
range = range) when FSharp.Compiler.Text.Range.rangeContainsPos range pos ->
longDotId = SynLongIdent.SynLongIdent(trivia = [ Some(IdentTrivia.OriginalNotation("|->")) ])
range = range) when FSharp.Compiler.Text.Range.rangeContainsPos range pos ->

Some(range)
Some(range)

| _ -> defaultTraverse expr
}
| _ -> defaultTraverse expr }

SyntaxTraversal.Traverse(pos, input, visitor)

Expand All @@ -52,12 +48,9 @@ let fix (getParseResultsForFile: GetParseResultsForFile) : CodeFix =
let lspRange = fcsRangeToLsp operatorRange

return
[ { Title = title
File = codeActionParams.TextDocument
SourceDiagnostic = Some diagnostic
Edits =
[| { Range = lspRange
NewText = "| _ ->" }
|]
Kind = FixKind.Fix } ]
[ { Title = title
File = codeActionParams.TextDocument
SourceDiagnostic = Some diagnostic
Edits = [| { Range = lspRange; NewText = "| _ ->" } |]
Kind = FixKind.Fix } ]
})
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ open Utils.CursorbasedTests
open FsAutoComplete.CodeFix

let tests state =
serverTestList (nameof AddMissingWildcardOperator) state defaultConfigDto None (fun server -> [
let selectCodeFix = CodeFix.withTitle AddMissingWildcardOperator.title
ftestCaseAsync "can suggest wildcard pattern for missing match case" <|
CodeFix.check server
serverTestList (nameof AddMissingWildcardOperator) state defaultConfigDto None (fun server ->
[ let selectCodeFix = CodeFix.withTitle AddMissingWildcardOperator.title

ftestCaseAsync "can suggest wildcard pattern for missing match case"
<| CodeFix.check
server
"""
type SomeUnion =
| First
Expand All @@ -32,6 +34,4 @@ let tests state =
match su with
| First -> "hey"
| _ -> "hello"
"""
]
)
""" ])
3 changes: 1 addition & 2 deletions test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3352,5 +3352,4 @@ let tests state =
wrapExpressionInParenthesesTests state
removeRedundantAttributeSuffixTests state
removePatternArgumentTests state
AddMissingWildcardOperatorTests.tests state
]
AddMissingWildcardOperatorTests.tests state ]

0 comments on commit d3d6f8d

Please sign in to comment.