Skip to content

Commit

Permalink
Suggest id if it is an infix
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Dec 27, 2016
1 parent b3f2fd1 commit 0de2322
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/fsharp/ErrorResolutionHints.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ let FilterPredictions (unknownIdent:string) (predictionsF:ErrorLogger.Suggestion
predictionsF()
|> Seq.choose (fun p ->
let similarity = Internal.Utilities.EditDistance.JaroWinklerDistance unknownIdent (p.ToUpperInvariant())
if not useThreshold || similarity >= thresholdForSuggestions then
if not useThreshold || similarity >= thresholdForSuggestions || p.Contains unknownIdent then
Some(similarity,p)
else
None
)
None)
|> Seq.sortByDescending fst
|> Seq.mapi (fun i x -> i,x)
|> Seq.takeWhile (fun (i,_) -> i < maxSuggestions)
Expand Down
4 changes: 1 addition & 3 deletions tests/fsharp/core/load-script/out.stderr.bsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

usesfsi.fsx(2,1): error FS0039: The namespace or module 'fsi' is not defined.

Maybe you want one of the following:
usesfsi.fsx(2,1): error FS0039: The namespace or module 'fsi' is not defined. Maybe you want one of the following:

FSharp
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg06.bsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

neg06.fs(3,40,3,45): typecheck error FS0039: The field, constructor or member 'Ascii' is not defined. Maybe you want one of the following: ASCII
neg06.fs(3,40,3,45): typecheck error FS0039: The field, constructor or member 'Ascii' is not defined. Maybe you want one of the following: ASCII, get_ASCII

neg06.fs(12,6,12,31): typecheck error FS0942: Struct types are always sealed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ let x: float = 1.2(*start*).(*end*)3
let gDateTime (arr: (*start*)DateTime(*end*)[]) =
arr.[0]
""",
expectedMessage = "The type 'DateTime' is not defined.\r\nMaybe you want one of the following:\r\n nativeint\r\n DelegateEvent")
expectedMessage = "The type 'DateTime' is not defined. Maybe you want one of the following:\r\n nativeint\r\n DelegateEvent")

[<Test>]
member public this.Error_CyclicalDeclarationDoesNotCrash() =
Expand Down

0 comments on commit 0de2322

Please sign in to comment.