Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
6e8515fc
F
fsharp
项目概览
dotNET Platform
/
fsharp
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
6e8515fc
编写于
12月 06, 2017
作者:
V
Vasily Kirichenko
提交者:
Will Smith
12月 06, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
do not simplify open statements (#4068)
上级
bc9f2a16
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
7 deletion
+14
-7
src/fsharp/NameResolution.fs
src/fsharp/NameResolution.fs
+2
-0
src/fsharp/NameResolution.fsi
src/fsharp/NameResolution.fsi
+1
-0
src/fsharp/TypeChecker.fs
src/fsharp/TypeChecker.fs
+1
-1
src/fsharp/symbols/Symbols.fs
src/fsharp/symbols/Symbols.fs
+6
-6
src/fsharp/symbols/Symbols.fsi
src/fsharp/symbols/Symbols.fsi
+3
-0
vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs
...harp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs
+1
-0
未找到文件。
src/fsharp/NameResolution.fs
浏览文件 @
6e8515fc
...
...
@@ -1223,6 +1223,8 @@ type ItemOccurence =
|
Implemented
/// Result gets suppressed over this text range
|
RelatedText
/// This is a usage of a module or namespace name in open statement
|
Open
type
OpenDeclaration
=
{
LongId
:
Ident
list
...
...
src/fsharp/NameResolution.fsi
浏览文件 @
6e8515fc
...
...
@@ -246,6 +246,7 @@ type internal ItemOccurence =
|
Pattern
|
Implemented
|
RelatedText
|
Open
/// Check for equality, up to signature matching
val
ItemsAreEffectivelyEqual
:
TcGlobals
->
Item
->
Item
->
bool
...
...
src/fsharp/TypeChecker.fs
浏览文件 @
6e8515fc
...
...
@@ -466,7 +466,7 @@ let OpenModulesOrNamespaces tcSink g amap scopem root env mvvs openDeclaration =
loop acc rest
for item, range in loop [] (List.rev openDeclaration.LongId) do
CallNameResolutionSink tcSink (range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.
Use
, env.DisplayEnv, env.eAccessRights)
CallNameResolutionSink tcSink (range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.
Open
, env.DisplayEnv, env.eAccessRights)
env
let AddRootModuleOrNamespaceRefs g amap m env modrefs =
...
...
src/fsharp/symbols/Symbols.fs
浏览文件 @
6e8515fc
...
...
@@ -2281,11 +2281,11 @@ type FSharpSymbolUse(g:TcGlobals, denv: DisplayEnv, symbol:FSharpSymbol, itemOcc
member
__.
Symbol
=
symbol
member
__.
DisplayContext
=
FSharpDisplayContext
(
fun
_
->
denv
)
member
x
.
IsDefinition
=
x
.
IsFromDefinition
member
__.
IsFromDefinition
=
(
match
itemOcc
with
ItemOccurence
.
Binding
->
true
|
_
->
false
)
member
__.
IsFromPattern
=
(
match
itemOcc
with
ItemOccurence
.
Pattern
->
true
|
_
->
false
)
member
__.
IsFromType
=
(
match
itemOcc
with
ItemOccurence
.
UseInType
->
true
|
_
->
false
)
member
__.
IsFromAttribute
=
(
match
itemOcc
with
ItemOccurence
.
UseInAttribute
->
true
|
_
->
false
)
member
__.
IsFromDispatchSlotImplementation
=
(
match
itemOcc
with
ItemOccurence
.
Implemented
->
true
|
_
->
false
)
member
__.
IsFromDefinition
=
itemOcc
=
ItemOccurence
.
Binding
member
__.
IsFromPattern
=
itemOcc
=
ItemOccurence
.
Pattern
member
__.
IsFromType
=
itemOcc
=
ItemOccurence
.
UseInType
member
__.
IsFromAttribute
=
itemOcc
=
ItemOccurence
.
UseInAttribute
member
__.
IsFromDispatchSlotImplementation
=
itemOcc
=
ItemOccurence
.
Implemented
member
__.
IsFromComputationExpression
=
match
symbol
.
Item
,
itemOcc
with
// 'seq' in 'seq { ... }' gets colored as keywords
...
...
@@ -2293,7 +2293,7 @@ type FSharpSymbolUse(g:TcGlobals, denv: DisplayEnv, symbol:FSharpSymbol, itemOcc
// custom builders, custom operations get colored as keywords
|
(
Item
.
CustomBuilder
_
|
Item
.
CustomOperation
_),
ItemOccurence
.
Use
->
true
|
_
->
false
member
__.
IsFromOpenStatement
=
itemOcc
=
ItemOccurence
.
Open
member
__.
FileName
=
range
.
FileName
member
__.
Range
=
Range
.
toZ
range
member
__.
RangeAlternate
=
range
...
...
src/fsharp/symbols/Symbols.fsi
浏览文件 @
6e8515fc
...
...
@@ -1125,6 +1125,9 @@ type internal FSharpSymbolUse =
/// Indicates if the reference is either a builder or a custom operation in a computation expression
member
IsFromComputationExpression
:
bool
/// Indicates if the reference is in open statement
member
IsFromOpenStatement
:
bool
/// The file name the reference occurs in
member
FileName
:
string
...
...
vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs
浏览文件 @
6e8515fc
...
...
@@ -66,6 +66,7 @@ type internal SimplifyNameDiagnosticAnalyzer() =
let
mutable
result
=
ResizeArray
()
let
symbolUses
=
symbolUses
|>
Array
.
filter
(
fun
symbolUse
->
not
symbolUse
.
IsFromOpenStatement
)
|>
Array
.
Parallel
.
map
(
fun
symbolUse
->
let
lineStr
=
sourceText
.
Lines
.[
Line
.
toZ
symbolUse
.
RangeAlternate
.
StartLine
].
ToString
()
// for `System.DateTime.Now` it returns ([|"System"; "DateTime"|], "Now")
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录