From 45c966713ceb01bdc3e3cec2b4bd93de7361087d Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 1 Nov 2022 14:04:40 +0100 Subject: [PATCH] Fixed a typo --- .../Service/FSharpParseFileResults.fs | 2 +- .../Service/FSharpParseFileResults.fsi | 2 +- src/Compiler/Service/ServiceUntypedParse.fsi | 2 +- ...erService.SurfaceArea.netstandard.expected | 2 +- tests/service/ServiceUntypedParseTests.fs | 66 +++++++++---------- .../FSharp.Editor/Completion/SignatureHelp.fs | 2 +- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index de8d6ae60da..929d38b957c 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -298,7 +298,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, SyntaxTraversal.Traverse(pos, input, visitor) - member _.GetAllArgumentsForFunctionApplicationAtPostion pos = + member _.GetAllArgumentsForFunctionApplicationAtPosition pos = SynExprAppLocationsImpl.getAllCurriedArgsAtPosition pos input member _.TryRangeOfParenEnclosingOpEqualsGreaterUsage opGreaterEqualPos = diff --git a/src/Compiler/Service/FSharpParseFileResults.fsi b/src/Compiler/Service/FSharpParseFileResults.fsi index f160c7fa8fa..e20de374d16 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fsi +++ b/src/Compiler/Service/FSharpParseFileResults.fsi @@ -40,7 +40,7 @@ type public FSharpParseFileResults = member TryRangeOfFunctionOrMethodBeingApplied: pos: pos -> range option /// Gets the ranges of all arguments, if they can be found, for a function application at the given position. - member GetAllArgumentsForFunctionApplicationAtPostion: pos: pos -> range list option + member GetAllArgumentsForFunctionApplicationAtPosition: pos: pos -> range list option /// /// Given the position of an expression, attempts to find the range of the diff --git a/src/Compiler/Service/ServiceUntypedParse.fsi b/src/Compiler/Service/ServiceUntypedParse.fsi index 59586e51e70..19dacd72269 100755 --- a/src/Compiler/Service/ServiceUntypedParse.fsi +++ b/src/Compiler/Service/ServiceUntypedParse.fsi @@ -22,7 +22,7 @@ type public FSharpParseFileResults = member FindNoteworthyParamInfoLocations: pos: pos -> FSharpNoteworthyParamInfoLocations option /// Gets the ranges of all arguments, if they can be found, for a function application at the given position. - member GetAllArgumentsForFunctionApplicationAtPostion: pos: pos -> range list option + member GetAllArgumentsForFunctionApplicationAtPosition: pos: pos -> range list option /// Determines if the expression or pattern at the given position has a type annotation member IsTypeAnnotationGivenAtPosition: pos -> bool diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index e1814272d1b..1ece3f1a780 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2071,7 +2071,7 @@ FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FShar FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] TryRangeOfRefCellDereferenceContainingPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] TryRangeOfStringInterpolationContainingPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] ValidateBreakpointLocation(FSharp.Compiler.Text.Position) -FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range]] GetAllArgumentsForFunctionApplicationAtPostion(FSharp.Compiler.Text.Position) +FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range]] GetAllArgumentsForFunctionApplicationAtPosition(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.Ident,System.Int32]] TryIdentOfPipelineContainingPosAndNumArgsApplied(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range]] TryRangeOfParenEnclosingOpEqualsGreaterUsage(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: System.String FileName diff --git a/tests/service/ServiceUntypedParseTests.fs b/tests/service/ServiceUntypedParseTests.fs index 19716749a39..86b3bd83d2a 100644 --- a/tests/service/ServiceUntypedParseTests.fs +++ b/tests/service/ServiceUntypedParseTests.fs @@ -385,13 +385,13 @@ let x = { Name = "Hello" } module FunctionApplicationArguments = [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - Single arg``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - Single arg``() = let source = """ let f x = () f 12 """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -401,13 +401,13 @@ f 12 Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - Multi arg``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - Multi arg``() = let source = """ let f x y z = () f 1 2 3 """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -417,13 +417,13 @@ f 1 2 3 Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - Multi arg parentheses``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - Multi arg parentheses``() = let source = """ let f x y z = () f (1) (2) (3) """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -433,13 +433,13 @@ f (1) (2) (3) Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - Multi arg nested parentheses``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - Multi arg nested parentheses``() = let source = """ let f x y z = () f ((1)) (((2))) ((((3)))) """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -449,23 +449,23 @@ f ((1)) (((2))) ((((3)))) Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - unit``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - unit``() = let source = """ let f () = () f () """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) Assert.IsTrue(res.IsNone, "Found argument for unit-accepting function, which shouldn't be the case.") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - curried function``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - curried function``() = let source = """ let f x y = x + y f 12 """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -475,14 +475,14 @@ f 12 Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - tuple value``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - tuple value``() = let source = """ let f (t: int * int) = () let t = (1, 2) f t """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 4 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 4 0) match res with | Some res -> res @@ -492,13 +492,13 @@ f t Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - tuple literal``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - tuple literal``() = let source = """ let f (t: int * int) = () f (1, 2) """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -508,14 +508,14 @@ f (1, 2) Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - tuple value with definition that has explicit names``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - tuple value with definition that has explicit names``() = let source = """ let f ((x, y): int * int) = () let t = (1, 2) f t """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 4 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 4 0) match res with | Some res -> res @@ -525,13 +525,13 @@ f t Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - tuple literal inside parens``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - tuple literal inside parens``() = let source = """ let f (x, y) = () f ((1, 2)) """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -541,13 +541,13 @@ f ((1, 2)) Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - tuples with elements as arguments``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - tuples with elements as arguments``() = let source = """ let f (a, b) = () f (1, 2) """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -557,13 +557,13 @@ f (1, 2) Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - top-level arguments with nested function call``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - top-level arguments with nested function call``() = let source = """ let f x y = x + y f (f 1 2) 3 """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 0) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 0) match res with | Some res -> res @@ -573,13 +573,13 @@ f (f 1 2) 3 Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - nested function argument positions``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - nested function argument positions``() = let source = """ let f x y = x + y f (f 1 2) 3 """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 3 3) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 3 3) match res with | Some res -> res @@ -589,12 +589,12 @@ f (f 1 2) 3 Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - nested function application in infix expression``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - nested function application in infix expression``() = let source = """ let addStr x y = string x + y """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 2 17) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 2 17) match res with | Some res -> res @@ -604,12 +604,12 @@ let addStr x y = string x + y Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - nested function application outside of infix expression``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - nested function application outside of infix expression``() = let source = """ let addStr x y = x + string y """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 2 21) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 2 21) match res with | Some res -> res @@ -619,12 +619,12 @@ let addStr x y = x + string y Assert.Fail("No arguments found in source code") [] - let ``GetAllArgumentsForFunctionApplicationAtPostion - nested function applications both inside and outside of infix expression``() = + let ``GetAllArgumentsForFunctionApplicationAtPosition - nested function applications both inside and outside of infix expression``() = let source = """ let addStr x y = string x + string y """ let parseFileResults, _ = getParseAndCheckResults source - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 2 17) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 2 17) match res with | Some res -> res @@ -634,7 +634,7 @@ let addStr x y = string x + string y Assert.Fail("No arguments found in source code") - let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPostion (mkPos 2 28) + let res = parseFileResults.GetAllArgumentsForFunctionApplicationAtPosition (mkPos 2 28) match res with | Some res -> res diff --git a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs index 6f8b4e7301a..17c5f9555ee 100644 --- a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs +++ b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs @@ -281,7 +281,7 @@ type internal FSharpSignatureHelpProvider let numDefinedArgs = definedArgs.Length let curriedArgsInSource = - parseResults.GetAllArgumentsForFunctionApplicationAtPostion symbolUse.Range.Start + parseResults.GetAllArgumentsForFunctionApplicationAtPosition symbolUse.Range.Start |> Option.defaultValue [] |> Array.ofList