@@ -229,30 +229,35 @@ module private MatchExpression =
229229 match ( leftExpr, opExpr) with
230230 | ExpressionUtilities.Identifier([ ident], _), ExpressionUtilities.Identifier([ opIdent], _) when opIdent.idText = " op_Equality" ->
231231 match arguments.FSharpCheckFileResults with
232- | Some( checkFile) ->
233- let checkSymbol () =
234- let symbolUse =
235- checkFile.GetSymbolUseAtLocation (
236- ident.idRange.StartLine , ident.idRange.EndColumn , String.Empty , [ ident.idText ])
237-
238- match symbolUse with
239- | Some ( symbolUse ) ->
232+ | Some checkFile ->
233+ let symbolUse =
234+ checkFile.GetSymbolUseAtLocation (
235+ ident.idRange.StartLine , ident.idRange.EndColumn , String.Empty , [ ident.idText ])
236+
237+ match symbolUse with
238+ | Some symbolUse ->
239+ let checkSymbol () =
240240 match symbolUse.Symbol with
241241 | :? FSharpParameter
242242 | :? FSharpField -> false
243243 | :? FSharpMemberOrFunctionOrValue as element -> not element.IsProperty
244244 | _ -> true
245- | None -> true
246- checkSymbol
247- |> List.singleton
248- |> Match
245+ checkSymbol
246+ |> List.singleton
247+ |> Match
248+ | None ->
249+ // Symbol resolution failed, fall back to breadcrumb checking
250+ match filterParens arguments.Breadcrumbs with
251+ | PossiblyInMethod
252+ | PossiblyInConstructor -> NoMatch
253+ | _ -> Match List.Empty
249254 | None ->
250255 /// Check if in `new` expr or function application (either could be a constructor).
251256 match filterParens arguments.Breadcrumbs with
252257 | PossiblyInMethod
253258 | PossiblyInConstructor -> NoMatch
254- | _ -> Match( List.Empty)
255- | _ -> Match( List.Empty)
259+ | _ -> Match List.Empty
260+ | _ -> Match List.Empty
256261
257262 [<TailCall>]
258263 let rec matchHintExpr ( continuation : unit -> HintMatch ) arguments =
@@ -386,7 +391,10 @@ module private MatchExpression =
386391 matchHintExpr
387392 ( fun () ->
388393 matchHintExpr
389- ( fun () -> arguments.SubHint( AstNode.Expression( rightExpr), right) |> matchHintExpr returnEmptyMatch)
394+ ( fun () ->
395+ matchHintExpr
396+ ( fun () -> notPropertyInitialisationOrNamedParameter arguments leftExpr opExpr)
397+ ( arguments.SubHint( AstNode.Expression( rightExpr), right)))
390398 ( arguments.SubHint( AstNode.Expression( leftExpr), left)))
391399 ( arguments.SubHint( AstNode.Expression( opExpr), op))
392400 | ( AstNode.Expression( SynExpr.App(_, _, infixExpr, rightExpr, _)),
0 commit comments