Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
6a90816f
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6a90816f
编写于
11月 02, 2022
作者:
P
Petr
提交者:
GitHub
11月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed a typo (#14207)
Co-authored-by:
N
Don Syme
<
dsyme@users.noreply.github.com
>
上级
2c2884ae
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
38 addition
and
38 deletion
+38
-38
src/Compiler/Service/FSharpParseFileResults.fs
src/Compiler/Service/FSharpParseFileResults.fs
+1
-1
src/Compiler/Service/FSharpParseFileResults.fsi
src/Compiler/Service/FSharpParseFileResults.fsi
+1
-1
src/Compiler/Service/ServiceUntypedParse.fsi
src/Compiler/Service/ServiceUntypedParse.fsi
+1
-1
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
...s/FSharp.CompilerService.SurfaceArea.netstandard.expected
+1
-1
tests/service/ServiceUntypedParseTests.fs
tests/service/ServiceUntypedParseTests.fs
+33
-33
vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs
vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs
+1
-1
未找到文件。
src/Compiler/Service/FSharpParseFileResults.fs
浏览文件 @
6a90816f
...
...
@@ -298,7 +298,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,
SyntaxTraversal
.
Traverse
(
pos
,
input
,
visitor
)
member
_.
GetAllArgumentsForFunctionApplicationAtPostion
pos
=
member
_.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
pos
=
SynExprAppLocationsImpl
.
getAllCurriedArgsAtPosition
pos
input
member
_.
TryRangeOfParenEnclosingOpEqualsGreaterUsage
opGreaterEqualPos
=
...
...
src/Compiler/Service/FSharpParseFileResults.fsi
浏览文件 @
6a90816f
...
...
@@ -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
GetAllArgumentsForFunctionApplicationAtPos
i
tion
:
pos
:
pos
->
range
list
option
/// <summary>
/// Given the position of an expression, attempts to find the range of the
...
...
src/Compiler/Service/ServiceUntypedParse.fsi
浏览文件 @
6a90816f
...
...
@@ -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
GetAllArgumentsForFunctionApplicationAtPos
i
tion
:
pos
:
pos
->
range
list
option
/// Determines if the expression or pattern at the given position has a type annotation
member
IsTypeAnnotationGivenAtPosition
:
pos
->
bool
...
...
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
浏览文件 @
6a90816f
...
...
@@ -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]] GetAllArgumentsForFunctionApplicationAtPos
i
tion(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
tests/service/ServiceUntypedParseTests.fs
浏览文件 @
6a90816f
...
...
@@ -385,13 +385,13 @@ let x = { Name = "Hello" }
module
FunctionApplicationArguments
=
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - Single arg``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - Single arg``
()
=
let
source
=
"""
let f x = ()
f 12
"""
let
parseFileResults
,
_
=
getParseAndCheckResults
source
let
res
=
parseFileResults
.
GetAllArgumentsForFunctionApplicationAtPostion
(
mkPos
3
0
)
let
res
=
parseFileResults
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
3
0
)
match
res
with
|
Some
res
->
res
...
...
@@ -401,13 +401,13 @@ f 12
Assert
.
Fail
(
"No arguments found in source code"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - Multi arg``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - Multi arg parentheses``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - Multi arg nested parentheses``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - unit``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - unit``
()
=
let
source
=
"""
let f () = ()
f ()
"""
let
parseFileResults
,
_
=
getParseAndCheckResults
source
let
res
=
parseFileResults
.
GetAllArgumentsForFunctionApplicationAtPostion
(
mkPos
3
0
)
let
res
=
parseFileResults
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
3
0
)
Assert
.
IsTrue
(
res
.
IsNone
,
"Found argument for unit-accepting function, which shouldn't be the case."
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - curried function``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
3
0
)
match
res
with
|
Some
res
->
res
...
...
@@ -475,14 +475,14 @@ f 12
Assert
.
Fail
(
"No arguments found in source code"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - tuple value``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
4
0
)
match
res
with
|
Some
res
->
res
...
...
@@ -492,13 +492,13 @@ f t
Assert
.
Fail
(
"No arguments found in source code"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - tuple literal``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
3
0
)
match
res
with
|
Some
res
->
res
...
...
@@ -508,14 +508,14 @@ f (1, 2)
Assert
.
Fail
(
"No arguments found in source code"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - tuple value with definition that has explicit names``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
4
0
)
match
res
with
|
Some
res
->
res
...
...
@@ -525,13 +525,13 @@ f t
Assert
.
Fail
(
"No arguments found in source code"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - tuple literal inside parens``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
3
0
)
match
res
with
|
Some
res
->
res
...
...
@@ -541,13 +541,13 @@ f ((1, 2))
Assert
.
Fail
(
"No arguments found in source code"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - tuples with elements as arguments``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
3
0
)
match
res
with
|
Some
res
->
res
...
...
@@ -557,13 +557,13 @@ f (1, 2)
Assert
.
Fail
(
"No arguments found in source code"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - top-level arguments with nested function call``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - nested function argument positions``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - nested function application in infix expression``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - nested function application outside of infix expression``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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"
)
[<
Test
>]
let
``GetAllArgumentsForFunctionApplicationAtPostion - nested function applications both inside and outside of infix expression``
()
=
let
``GetAllArgumentsForFunctionApplicationAtPos
i
tion - 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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
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
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
(
mkPos
2
28
)
match
res
with
|
Some
res
->
res
...
...
vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs
浏览文件 @
6a90816f
...
...
@@ -281,7 +281,7 @@ type internal FSharpSignatureHelpProvider
let
numDefinedArgs
=
definedArgs
.
Length
let
curriedArgsInSource
=
parseResults
.
GetAllArgumentsForFunctionApplicationAtPostion
symbolUse
.
Range
.
Start
parseResults
.
GetAllArgumentsForFunctionApplicationAtPos
i
tion
symbolUse
.
Range
.
Start
|>
Option
.
defaultValue
[]
|>
Array
.
ofList
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录