-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't suggest names for errors in normal IDE usage (#6063)
* Don't suggest names for errors in normal IDE usage * Remove flag from parsing and project opens * Move flag into FSharpChecker * Suggest names based on symbols in the current document * Cleanup and turn on code fix by default * Use declarationlistinfo as a source for suggesting names * Reduce diff
- Loading branch information
Showing
39 changed files
with
295 additions
and
140 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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,14 @@ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.FSharp.Compiler.SourceCodeServices | ||
|
||
open System.Collections.Generic | ||
|
||
open Microsoft.FSharp.Compiler.ErrorResolutionHints | ||
|
||
module ErrorResolutionHints = | ||
let getSuggestedNames (namesToCheck: string[]) (unresolvedIdentifier: string) = | ||
let res = FilterPredictions (fun () -> HashSet<string>(namesToCheck)) unresolvedIdentifier |> List.map snd | ||
match res with | ||
| [] -> None | ||
| _ -> Some res |
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,9 @@ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.FSharp.Compiler.SourceCodeServices | ||
|
||
/// Exposes the string distance algorithm used to suggest names for mistyped identifiers. | ||
module ErrorResolutionHints = | ||
/// Given a set of names, uses and a string representing an unresolved identifier, | ||
/// returns a list of suggested names if there are any feasible candidates. | ||
val getSuggestedNames: symbolUses: string[] -> unresolvedIdentifier: string -> string list option |
Oops, something went wrong.