From b727173843e6f101b21f5193f69944691a3b9902 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 22 Dec 2016 00:19:39 -0800 Subject: [PATCH] Use standard options --- .../src/FSharp.Editor/Common/CommonHelpers.fs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Common/CommonHelpers.fs b/vsintegration/src/FSharp.Editor/Common/CommonHelpers.fs index b734241285e..4ee9660ffe0 100644 --- a/vsintegration/src/FSharp.Editor/Common/CommonHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/CommonHelpers.fs @@ -41,18 +41,6 @@ type internal SymbolLookupKind = | ByRightColumn | ByLongIdent -[] -module Option = - /// Gets the value associated with the option or the supplied default value. - let inline getOrElse v = function - | Some x -> x | None -> v - - /// Gets the option if Some x, otherwise try to get another value - let inline orTry f = - function - | Some x -> Some x - | None -> f() - module internal CommonHelpers = type private SourceLineData(lineStart: int, lexStateAtStartOfLine: FSharpTokenizerLexState, lexStateAtEndOfLine: FSharpTokenizerLexState, hashCode: int, classifiedSpans: IReadOnlyList, tokens: FSharpTokenInfo list) = @@ -318,7 +306,7 @@ module internal CommonHelpers = | LexerSymbolKind.GenericTypeParameter | LexerSymbolKind.StaticallyResolvedTypeParameter -> true | _ -> false) - |> Option.orTry (fun _ -> tokensUnderCursor |> List.tryFind (fun { DraftToken.Kind = k } -> k = LexerSymbolKind.Operator)) + |> Option.orElseWith (fun _ -> tokensUnderCursor |> List.tryFind (fun { DraftToken.Kind = k } -> k = LexerSymbolKind.Operator)) |> Option.map (fun token -> { Kind = token.Kind Line = linePos.Line