Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
a1cc8b7a
F
fsharp
项目概览
dotNET Platform
/
fsharp
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
a1cc8b7a
编写于
8月 30, 2023
作者:
P
Petr Pokorny
提交者:
GitHub
8月 30, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix finding references to CtorGroup (#15884)
上级
aaf4c118
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
7 deletion
+35
-7
src/Compiler/Checking/NameResolution.fs
src/Compiler/Checking/NameResolution.fs
+6
-1
src/Compiler/Service/ItemKey.fs
src/Compiler/Service/ItemKey.fs
+6
-5
tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs
...p.Compiler.ComponentTests/FSharpChecker/FindReferences.fs
+22
-0
tests/service/ProjectAnalysisTests.fs
tests/service/ProjectAnalysisTests.fs
+1
-1
未找到文件。
src/Compiler/Checking/NameResolution.fs
浏览文件 @
a1cc8b7a
...
...
@@ -271,7 +271,12 @@ type Item =
|
Item
.
Property
(
name
=
nm
)
->
nm
|>
ConvertValLogicalNameToDisplayNameCore
|
Item
.
MethodGroup
(_,
FSMeth
(_,
_,
v
,
_)
::
_,
_)
->
v
.
DisplayNameCore
|
Item
.
MethodGroup
(
nm
,
_,
_)
->
nm
|>
ConvertValLogicalNameToDisplayNameCore
|
Item
.
CtorGroup
(
nm
,
_)
->
nm
|>
DemangleGenericTypeName
|
Item
.
CtorGroup
(
nm
,
ILMeth
(_,
ilMethInfo
,
_)
::
_)
->
match
ilMethInfo
.
ApparentEnclosingType
|>
tryNiceEntityRefOfTy
with
|
ValueSome
tcref
->
tcref
.
DisplayNameCore
|
_
->
nm
|>
DemangleGenericTypeName
|
Item
.
CtorGroup
(
nm
,
_)
->
nm
|>
DemangleGenericTypeName
|
Item
.
FakeInterfaceCtor
ty
|
Item
.
DelegateCtor
ty
->
match
ty
with
...
...
src/Compiler/Service/ItemKey.fs
浏览文件 @
a1cc8b7a
...
...
@@ -415,11 +415,12 @@ and [<Sealed>] ItemKeyStoreBuilder() =
match
info
with
|
FSMeth
(_,
ty
,
vref
,
_)
when
vref
.
IsConstructor
->
writeType
true
ty
|
FSMeth
(_,
_,
vref
,
_)
->
writeValue
vref
|
ILMeth
(_,
info
,
_)
->
info
.
ILMethodRef
.
ArgTypes
|>
List
.
iter
writeILType
writeILType
info
.
ILMethodRef
.
ReturnType
writeString
info
.
ILName
writeType
false
info
.
ApparentEnclosingType
|
ILMeth
(_,
ilMethInfo
,
_)
when
info
.
IsConstructor
->
writeType
true
ilMethInfo
.
ApparentEnclosingType
|
ILMeth
(_,
ilMethInfo
,
_)
->
ilMethInfo
.
ILMethodRef
.
ArgTypes
|>
List
.
iter
writeILType
writeILType
ilMethInfo
.
ILMethodRef
.
ReturnType
writeString
ilMethInfo
.
ILName
writeType
false
ilMethInfo
.
ApparentEnclosingType
|
_
->
writeString
ItemKeyTags
.
itemValueMember
writeEntityRef
info
.
DeclaringTyconRef
...
...
tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs
浏览文件 @
a1cc8b7a
...
...
@@ -152,6 +152,28 @@ let foo x = x ++ 4""" })
])
}
[<
Theory
>]
[<
InlineData
(
"First"
)>]
[<
InlineData
(
"Second"
)>]
let
``We find disposable constructors``
searchIn
=
let
source1
=
"type MyReader = System.IO.StreamReader"
let
source2
=
"""open ModuleFirst
let reader = MyReader "
test
.
txt
"
"""
{
SyntheticProject
.
Create
(
{
sourceFile
"First"
[]
with
Source
=
source1
},
{
sourceFile
"Second"
[]
with
Source
=
source2
})
with
SkipInitialCheck
=
true
}
.
Workflow
{
placeCursor
searchIn
"MyReader"
findAllReferences
(
expectToFind
[
"FileFirst.fs"
,
2
,
5
,
13
"FileSecond.fs"
,
3
,
13
,
21
])
}
module
Parameters
=
[<
Fact
>]
...
...
tests/service/ProjectAnalysisTests.fs
浏览文件 @
a1cc8b7a
...
...
@@ -3070,7 +3070,7 @@ let ``Test Project21 all symbols`` () =
(
"unit"
,
"unit"
,
"file1"
,
((
12
,
43
),
(
12
,
47
)),
[
"type"
],
[
"abbrev"
]);
(
"val raise"
,
"raise"
,
"file1"
,
((
13
,
18
),
(
13
,
23
)),
[]
,
[
"val"
]);
(
"System"
,
"System"
,
"file1"
,
((
13
,
25
),
(
13
,
31
)),
[]
,
[
"namespace"
]);
(
"member .ctor"
,
"
``.ctor``
"
,
"file1"
,
((
13
,
25
),
(
13
,
55
)),
[]
,
[
"member"
]);
(
"member .ctor"
,
"
NotImplementedException
"
,
"file1"
,
((
13
,
25
),
(
13
,
55
)),
[]
,
[
"member"
]);
(
"Impl"
,
"Impl"
,
"file1"
,
((
2
,
7
),
(
2
,
11
)),
[
"defn"
],
[
"module"
])|]
//-----------------------------------------------------------------------------------------
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录