Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
7abc88be
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,发现更多精彩内容 >>
未验证
提交
7abc88be
编写于
4月 29, 2022
作者:
K
kerams
提交者:
GitHub
4月 29, 2022
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TypeApp, type parameter completions (#12933)
上级
506e58d4
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
104 addition
and
28 deletion
+104
-28
src/fsharp/NameResolution.fs
src/fsharp/NameResolution.fs
+9
-1
src/fsharp/NicePrint.fs
src/fsharp/NicePrint.fs
+9
-6
src/fsharp/NicePrint.fsi
src/fsharp/NicePrint.fsi
+2
-0
src/fsharp/service/FSharpCheckerResults.fs
src/fsharp/service/FSharpCheckerResults.fs
+9
-8
src/fsharp/service/ServiceConstants.fs
src/fsharp/service/ServiceConstants.fs
+2
-1
src/fsharp/service/ServiceDeclarationLists.fs
src/fsharp/service/ServiceDeclarationLists.fs
+12
-4
src/fsharp/service/ServiceParsedInputOps.fs
src/fsharp/service/ServiceParsedInputOps.fs
+3
-0
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
...s/FSharp.CompilerService.SurfaceArea.netstandard.expected
+5
-0
vsintegration/src/FSharp.Editor/Common/Extensions.fs
vsintegration/src/FSharp.Editor/Common/Extensions.fs
+1
-0
vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs
vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs
+3
-0
vsintegration/src/FSharp.LanguageService/Intellisense.fs
vsintegration/src/FSharp.LanguageService/Intellisense.fs
+1
-0
vsintegration/tests/UnitTests/CompletionProviderTests.fs
vsintegration/tests/UnitTests/CompletionProviderTests.fs
+48
-8
未找到文件。
src/fsharp/NameResolution.fs
浏览文件 @
7abc88be
...
@@ -4364,7 +4364,15 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE
...
@@ -4364,7 +4364,15 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE
|>
Seq
.
collect
(
InfosForTyconConstructors
ncenv
m
ad
)
|>
Seq
.
collect
(
InfosForTyconConstructors
ncenv
m
ad
)
|>
Seq
.
toList
|>
Seq
.
toList
unqualifiedItems
@
activePatternItems
@
moduleAndNamespaceItems
@
tycons
@
constructors
let
typeVars
=
if
nenv
.
eTypars
.
IsEmpty
then
[]
else
nenv
.
eTypars
|>
Seq
.
map
(
fun
kvp
->
Item
.
TypeVar
(
kvp
.
Key
,
kvp
.
Value
))
|>
Seq
.
toList
unqualifiedItems
@
activePatternItems
@
moduleAndNamespaceItems
@
tycons
@
constructors
@
typeVars
|
id
::
rest
->
|
id
::
rest
->
...
...
src/fsharp/NicePrint.fs
浏览文件 @
7abc88be
...
@@ -650,12 +650,13 @@ module PrintTypes =
...
@@ -650,12 +650,13 @@ module PrintTypes =
|
_,
_
->
squareAngleL
(
sepListL
(
rightL
(
tagPunctuation
";"
))
((
match
kind
with
TyparKind
.
Type
->
[]
|
TyparKind
.
Measure
->
[
wordL
(
tagText
"Measure"
)])
@
List
.
map
(
layoutAttrib
denv
)
attrs
))
^^
restL
|
_,
_
->
squareAngleL
(
sepListL
(
rightL
(
tagPunctuation
";"
))
((
match
kind
with
TyparKind
.
Type
->
[]
|
TyparKind
.
Measure
->
[
wordL
(
tagText
"Measure"
)])
@
List
.
map
(
layoutAttrib
denv
)
attrs
))
^^
restL
and
layoutTyparRef
denv
(
typar
:
Typar
)
=
and
layoutTyparRef
denv
(
typar
:
Typar
)
=
wordL
tagTypeParameter
(
tagTypeParameter
(
sprintf
"%s%s%s"
(
sprintf
"%s%s%s"
(
if
denv
.
showConstraintTyparAnnotations
then
prefixOfStaticReq
typar
.
StaticReq
else
"'"
)
(
if
denv
.
showConstraintTyparAnnotations
then
prefixOfStaticReq
typar
.
StaticReq
else
"'"
)
(
if
denv
.
showImperativeTyparAnnotations
then
prefixOfRigidTypar
typar
else
""
)
(
if
denv
.
showImperativeTyparAnnotations
then
prefixOfRigidTypar
typar
else
""
)
typar
.
DisplayName
)
typar
.
DisplayName
))
|>
mkNav
typar
.
Range
|>
wordL
/// Layout a single type parameter declaration, taking TypeSimplificationInfo into account
/// Layout a single type parameter declaration, taking TypeSimplificationInfo into account
/// There are several printing-cases for a typar:
/// There are several printing-cases for a typar:
...
@@ -2426,6 +2427,8 @@ let prettyLayoutOfType denv x = x |> PrintTypes.prettyLayoutOfType denv
...
@@ -2426,6 +2427,8 @@ let prettyLayoutOfType denv x = x |> PrintTypes.prettyLayoutOfType denv
let
prettyLayoutOfTypeNoCx
denv
x
=
x
|>
PrintTypes
.
prettyLayoutOfTypeNoConstraints
denv
let
prettyLayoutOfTypeNoCx
denv
x
=
x
|>
PrintTypes
.
prettyLayoutOfTypeNoConstraints
denv
let
prettyLayoutOfTypar
denv
x
=
x
|>
PrintTypes
.
layoutTyparRef
denv
let
prettyStringOfTy
denv
x
=
x
|>
PrintTypes
.
prettyLayoutOfType
denv
|>
showL
let
prettyStringOfTy
denv
x
=
x
|>
PrintTypes
.
prettyLayoutOfType
denv
|>
showL
let
prettyStringOfTyNoCx
denv
x
=
x
|>
PrintTypes
.
prettyLayoutOfTypeNoConstraints
denv
|>
showL
let
prettyStringOfTyNoCx
denv
x
=
x
|>
PrintTypes
.
prettyLayoutOfTypeNoConstraints
denv
|>
showL
...
...
src/fsharp/NicePrint.fsi
浏览文件 @
7abc88be
...
@@ -87,6 +87,8 @@ val prettyLayoutOfType: denv:DisplayEnv -> x:TType -> Layout
...
@@ -87,6 +87,8 @@ val prettyLayoutOfType: denv:DisplayEnv -> x:TType -> Layout
val
prettyLayoutOfTypeNoCx
:
denv
:
DisplayEnv
->
x
:
TType
->
Layout
val
prettyLayoutOfTypeNoCx
:
denv
:
DisplayEnv
->
x
:
TType
->
Layout
val
prettyLayoutOfTypar
:
denv
:
DisplayEnv
->
x
:
Typar
->
Layout
val
prettyStringOfTy
:
denv
:
DisplayEnv
->
x
:
TType
->
string
val
prettyStringOfTy
:
denv
:
DisplayEnv
->
x
:
TType
->
string
val
prettyStringOfTyNoCx
:
denv
:
DisplayEnv
->
x
:
TType
->
string
val
prettyStringOfTyNoCx
:
denv
:
DisplayEnv
->
x
:
TType
->
string
...
...
src/fsharp/service/FSharpCheckerResults.fs
浏览文件 @
7abc88be
...
@@ -1046,14 +1046,15 @@ type internal TypeCheckInfo
...
@@ -1046,14 +1046,15 @@ type internal TypeCheckInfo
|
Some
(
CompletionContext
.
RecordField
(
RecordContext
.
Declaration
false
))
->
|
Some
(
CompletionContext
.
RecordField
(
RecordContext
.
Declaration
false
))
->
GetDeclaredItems
(
parseResultsOpt
,
lineStr
,
origLongIdentOpt
,
colAtEndOfNamesAndResidue
,
residueOpt
,
lastDotPos
,
line
,
loc
,
filterCtors
,
resolveOverloads
,
false
,
getAllSymbols
)
GetDeclaredItems
(
parseResultsOpt
,
lineStr
,
origLongIdentOpt
,
colAtEndOfNamesAndResidue
,
residueOpt
,
lastDotPos
,
line
,
loc
,
filterCtors
,
resolveOverloads
,
false
,
getAllSymbols
)
|>
Option
.
map
(
fun
(
items
,
denv
,
m
)
->
|>
Option
.
map
(
fun
(
items
,
denv
,
m
)
->
items
items
|>
List
.
filter
(
fun
cItem
->
|>
List
.
filter
(
fun
cItem
->
match
cItem
.
Item
with
match
cItem
.
Item
with
|
Item
.
ModuleOrNamespaces
_
|
Item
.
ModuleOrNamespaces
_
|
Item
.
Types
_
|
Item
.
Types
_
|
Item
.
UnqualifiedType
_
|
Item
.
TypeVar
_
|
Item
.
ExnCase
_
->
true
|
Item
.
UnqualifiedType
_
|
_
->
false
),
denv
,
m
)
|
Item
.
ExnCase
_
->
true
|
_
->
false
),
denv
,
m
)
// Other completions
// Other completions
|
cc
->
|
cc
->
...
...
src/fsharp/service/ServiceConstants.fs
浏览文件 @
7abc88be
...
@@ -24,4 +24,5 @@ type FSharpGlyph =
...
@@ -24,4 +24,5 @@ type FSharpGlyph =
|
Union
|
Union
|
Variable
|
Variable
|
ExtensionMethod
|
ExtensionMethod
|
Error
|
Error
\ No newline at end of file
|
TypeParameter
\ No newline at end of file
src/fsharp/service/ServiceDeclarationLists.fs
浏览文件 @
7abc88be
...
@@ -380,6 +380,11 @@ module DeclarationListHelpers =
...
@@ -380,6 +380,11 @@ module DeclarationListHelpers =
let
remarks
=
toArray
remarks
let
remarks
=
toArray
remarks
ToolTipElement
.
Single
(
layout
,
xml
,
remarks
=
remarks
)
ToolTipElement
.
Single
(
layout
,
xml
,
remarks
=
remarks
)
// Type variables
|
Item
.
TypeVar
(_,
typar
)
->
let
layout
=
NicePrint
.
prettyLayoutOfTypar
denv
typar
ToolTipElement
.
Single
(
toArray
layout
,
xml
)
// F# Modules and namespaces
// F# Modules and namespaces
|
Item
.
ModuleOrNamespaces
(
modref
::
_
as
modrefs
)
->
|
Item
.
ModuleOrNamespaces
(
modref
::
_
as
modrefs
)
->
//let os = StringBuilder()
//let os = StringBuilder()
...
@@ -848,7 +853,7 @@ module internal DescriptionListsImpl =
...
@@ -848,7 +853,7 @@ module internal DescriptionListsImpl =
|
Item
.
CustomOperation
_
->
FSharpGlyph
.
Method
|
Item
.
CustomOperation
_
->
FSharpGlyph
.
Method
|
Item
.
MethodGroup
(_,
minfos
,
_)
when
minfos
|>
List
.
forall
(
fun
minfo
->
minfo
.
IsExtensionMember
)
->
FSharpGlyph
.
ExtensionMethod
|
Item
.
MethodGroup
(_,
minfos
,
_)
when
minfos
|>
List
.
forall
(
fun
minfo
->
minfo
.
IsExtensionMember
)
->
FSharpGlyph
.
ExtensionMethod
|
Item
.
MethodGroup
_
->
FSharpGlyph
.
Method
|
Item
.
MethodGroup
_
->
FSharpGlyph
.
Method
|
Item
.
TypeVar
_
|
Item
.
TypeVar
_
->
FSharpGlyph
.
TypeParameter
|
Item
.
Types
_
->
FSharpGlyph
.
Class
|
Item
.
Types
_
->
FSharpGlyph
.
Class
|
Item
.
UnqualifiedType
(
tcref
::
_)
->
|
Item
.
UnqualifiedType
(
tcref
::
_)
->
if
tcref
.
IsEnumTycon
||
tcref
.
IsILEnumTycon
then
FSharpGlyph
.
Enum
if
tcref
.
IsEnumTycon
||
tcref
.
IsILEnumTycon
then
FSharpGlyph
.
Enum
...
@@ -1031,9 +1036,12 @@ type DeclarationListInfo(declarations: DeclarationListItem[], isForType: bool, i
...
@@ -1031,9 +1036,12 @@ type DeclarationListInfo(declarations: DeclarationListItem[], isForType: bool, i
|
Some
u
->
u
.
DisplayName
|
Some
u
->
u
.
DisplayName
|
None
->
item
.
Item
.
DisplayNameCore
|
None
->
item
.
Item
.
DisplayNameCore
let
textInCode
=
let
textInCode
=
match
item
.
Unresolved
with
match
item
.
Item
with
|
Some
u
->
u
.
DisplayName
|
Item
.
TypeVar
(
name
,
typar
)
->
(
if
typar
.
StaticReq
=
Syntax
.
TyparStaticReq
.
None
then
"'"
else
" ^"
)
+
name
|
None
->
item
.
Item
.
DisplayName
|
_
->
match
item
.
Unresolved
with
|
Some
u
->
u
.
DisplayName
|
None
->
item
.
Item
.
DisplayName
textInDeclList
,
textInCode
,
items
)
textInDeclList
,
textInCode
,
items
)
// Filter out operators, active patterns (as values)
// Filter out operators, active patterns (as values)
...
...
src/fsharp/service/ServiceParsedInputOps.fs
浏览文件 @
7abc88be
...
@@ -957,6 +957,9 @@ module ParsedInput =
...
@@ -957,6 +957,9 @@ module ParsedInput =
|
_
->
|
_
->
defaultTraverse
expr
defaultTraverse
expr
// Unchecked.defaultof<str$>
|
SynExpr
.
TypeApp
(
typeArgsRange
=
range
)
when
rangeContainsPos
range
pos
->
Some
CompletionContext
.
PatternType
|
_
->
defaultTraverse
expr
|
_
->
defaultTraverse
expr
member
_.
VisitRecordField
(
path
,
copyOpt
,
field
)
=
member
_.
VisitRecordField
(
path
,
copyOpt
,
field
)
=
...
...
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
浏览文件 @
7abc88be
...
@@ -2654,6 +2654,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Property
...
@@ -2654,6 +2654,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Property
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Struct
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Struct
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Type
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Type
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Typedef
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Typedef
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 TypeParameter
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Union
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Union
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Variable
FSharp.Compiler.EditorServices.FSharpGlyph+Tags: Int32 Variable
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean Equals(FSharp.Compiler.EditorServices.FSharpGlyph)
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean Equals(FSharp.Compiler.EditorServices.FSharpGlyph)
...
@@ -2678,6 +2679,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsProperty
...
@@ -2678,6 +2679,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsProperty
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsStruct
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsStruct
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsType
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsType
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsTypedef
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsTypedef
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsTypeParameter
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsUnion
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsUnion
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsVariable
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean IsVariable
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsClass()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsClass()
...
@@ -2699,6 +2701,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsProperty()
...
@@ -2699,6 +2701,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsProperty()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsStruct()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsStruct()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsType()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsType()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsTypedef()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsTypedef()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsTypeParameter()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsUnion()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsUnion()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsVariable()
FSharp.Compiler.EditorServices.FSharpGlyph: Boolean get_IsVariable()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Class
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Class
...
@@ -2720,6 +2723,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FShar
...
@@ -2720,6 +2723,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FShar
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Struct
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Struct
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Type
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Type
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Typedef
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Typedef
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph TypeParameter
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Union
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Union
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Variable
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph Variable
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Class()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Class()
...
@@ -2741,6 +2745,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FShar
...
@@ -2741,6 +2745,7 @@ FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FShar
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Struct()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Struct()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Type()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Type()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Typedef()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Typedef()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_TypeParameter()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Union()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Union()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Variable()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph get_Variable()
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph+Tags
FSharp.Compiler.EditorServices.FSharpGlyph: FSharp.Compiler.EditorServices.FSharpGlyph+Tags
...
...
vsintegration/src/FSharp.Editor/Common/Extensions.fs
浏览文件 @
7abc88be
...
@@ -221,6 +221,7 @@ type NavigationItem with
...
@@ -221,6 +221,7 @@ type NavigationItem with
|
Some
SynAccess
.
Internal
->
FSharpRoslynGlyph
.
ExtensionMethodInternal
|
Some
SynAccess
.
Internal
->
FSharpRoslynGlyph
.
ExtensionMethodInternal
|
_
->
FSharpRoslynGlyph
.
ExtensionMethodPublic
|
_
->
FSharpRoslynGlyph
.
ExtensionMethodPublic
|
FSharpGlyph
.
Error
->
FSharpRoslynGlyph
.
Error
|
FSharpGlyph
.
Error
->
FSharpRoslynGlyph
.
Error
|
FSharpGlyph
.
TypeParameter
->
FSharpRoslynGlyph
.
TypeParameter
[<
RequireQualifiedAccess
>]
[<
RequireQualifiedAccess
>]
module
String
=
module
String
=
...
...
vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs
浏览文件 @
7abc88be
...
@@ -147,6 +147,7 @@ module internal Tokenizer =
...
@@ -147,6 +147,7 @@ module internal Tokenizer =
|
Private
->
Glyph
.
StructurePrivate
|
Private
->
Glyph
.
StructurePrivate
|
FSharpGlyph
.
Variable
->
Glyph
.
Local
|
FSharpGlyph
.
Variable
->
Glyph
.
Local
|
FSharpGlyph
.
Error
->
Glyph
.
Error
|
FSharpGlyph
.
Error
->
Glyph
.
Error
|
FSharpGlyph
.
TypeParameter
->
Glyph
.
TypeParameter
let
GetImageIdForSymbol
(
symbolOpt
:
FSharpSymbol
option
,
kind
:
LexerSymbolKind
)
=
let
GetImageIdForSymbol
(
symbolOpt
:
FSharpSymbol
option
,
kind
:
LexerSymbolKind
)
=
let
imageId
=
let
imageId
=
...
@@ -243,6 +244,7 @@ module internal Tokenizer =
...
@@ -243,6 +244,7 @@ module internal Tokenizer =
|
Internal
->
KnownImageIds
.
ClassInternal
|
Internal
->
KnownImageIds
.
ClassInternal
|
Protected
->
KnownImageIds
.
ClassProtected
|
Protected
->
KnownImageIds
.
ClassProtected
|
Private
->
KnownImageIds
.
ClassPrivate
|
Private
->
KnownImageIds
.
ClassPrivate
|
:?
FSharpGenericParameter
->
KnownImageIds
.
Type
|
_
->
KnownImageIds
.
None
|
_
->
KnownImageIds
.
None
if
imageId
=
KnownImageIds
.
None
then
if
imageId
=
KnownImageIds
.
None
then
None
None
...
@@ -345,6 +347,7 @@ module internal Tokenizer =
...
@@ -345,6 +347,7 @@ module internal Tokenizer =
|
Internal
->
Glyph
.
ClassInternal
|
Internal
->
Glyph
.
ClassInternal
|
Protected
->
Glyph
.
ClassProtected
|
Protected
->
Glyph
.
ClassProtected
|
Private
->
Glyph
.
ClassPrivate
|
Private
->
Glyph
.
ClassPrivate
|
:?
FSharpGenericParameter
->
Glyph
.
TypeParameter
|
_
->
Glyph
.
None
|
_
->
Glyph
.
None
...
...
vsintegration/src/FSharp.LanguageService/Intellisense.fs
浏览文件 @
7abc88be
...
@@ -219,6 +219,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations:
...
@@ -219,6 +219,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations:
|
FSharpGlyph
.
Field
|
FSharpGlyph
.
Field
|
FSharpGlyph
.
Delegate
|
FSharpGlyph
.
Delegate
|
FSharpGlyph
.
Variable
|
FSharpGlyph
.
Variable
|
FSharpGlyph
.
TypeParameter
|
FSharpGlyph
.
Error
->
None
|
FSharpGlyph
.
Error
->
None
|>
Option
.
defaultValue
ObsoleteGlyph
.
Class
|>
Option
.
defaultValue
ObsoleteGlyph
.
Class
|>
int
|>
int
...
...
vsintegration/tests/UnitTests/CompletionProviderTests.fs
浏览文件 @
7abc88be
...
@@ -751,9 +751,9 @@ type A = { le: string }
...
@@ -751,9 +751,9 @@ type A = { le: string }
VerifyNoCompletionList
(
fileContents
,
"le"
)
VerifyNoCompletionList
(
fileContents
,
"le"
)
[<
Test
>]
[<
Test
>]
let
``Completion list on record field type at declaration site contains modules
and type
s but not keywords or functions``
()
=
let
``Completion list on record field type at declaration site contains modules
, types and type parameter
s but not keywords or functions``
()
=
let
fileContents
=
"""
let
fileContents
=
"""
type A = { Field: l }
type A
<'lType>
= { Field: l }
"""
"""
VerifyCompletionList
(
fileContents
,
"Field: l"
,
[
"LanguagePrimitives"
;
"List"
],
[
"let"
;
"log"
])
VerifyCompletionList
(
fileContents
,
"Field: l"
,
[
"LanguagePrimitives"
;
"List"
],
[
"let"
;
"log"
])
...
@@ -774,20 +774,28 @@ type A =
...
@@ -774,20 +774,28 @@ type A =
VerifyNoCompletionList
(
fileContents
,
"str"
)
VerifyNoCompletionList
(
fileContents
,
"str"
)
[<
Test
>]
[<
Test
>]
let
``Completion list on union case type at declaration site contains modules
and type
s but not keywords or functions``
()
=
let
``Completion list on union case type at declaration site contains modules
, types and type parameter
s but not keywords or functions``
()
=
let
fileContents
=
"""
let
fileContents
=
"""
type A =
type A
<'lType>
=
| Case of blah: int * str: l
| Case of blah: int * str: l
"""
"""
VerifyCompletionList
(
fileContents
,
"str: l"
,
[
"LanguagePrimitives"
;
"List"
],
[
"let"
;
"log"
])
VerifyCompletionList
(
fileContents
,
"str: l"
,
[
"LanguagePrimitives"
;
"List"
;
"lType"
],
[
"let"
;
"log"
])
[<
Test
>]
[<
Test
>]
let
``Completion list on union case type at declaration site contains modules
and type
s but not keywords or functions2``
()
=
let
``Completion list on union case type at declaration site contains modules
, types and type parameter
s but not keywords or functions2``
()
=
let
fileContents
=
"""
let
fileContents
=
"""
type A =
type A
<'lType>
=
| Case of l
| Case of l
"""
"""
VerifyCompletionList
(
fileContents
,
"of l"
,
[
"LanguagePrimitives"
;
"List"
],
[
"let"
;
"log"
])
VerifyCompletionList
(
fileContents
,
"of l"
,
[
"LanguagePrimitives"
;
"List"
;
"lType"
],
[
"let"
;
"log"
])
[<
Test
>]
let
``Completion list on union case type at declaration site contains type parameter``
()
=
let
fileContents
=
"""
type A<'keyType> =
| Case of key
"""
VerifyCompletionList
(
fileContents
,
"of key"
,
[
"keyType"
],
[]
)
[<
Test
>]
[<
Test
>]
let
``Completion list on type alias contains modules and types but not keywords or functions``
()
=
let
``Completion list on type alias contains modules and types but not keywords or functions``
()
=
...
@@ -804,6 +812,38 @@ type A =
...
@@ -804,6 +812,38 @@ type A =
"""
"""
VerifyNoCompletionList
(
fileContents
,
"| C"
)
VerifyNoCompletionList
(
fileContents
,
"| C"
)
[<
Test
>]
let
``Completion list in generic function body contains type parameter``
()
=
let
fileContents
=
"""
let Null<'wrappedType> () =
Unchecked.defaultof<wrapp>
"""
VerifyCompletionList
(
fileContents
,
"defaultof<wrapp"
,
[
"wrappedType"
],
[]
)
[<
Test
>]
let
``Completion list in generic method body contains type parameter``
()
=
let
fileContents
=
"""
type A () =
member _.Null<'wrappedType> () = Unchecked.defaultof<wrapp>
"""
VerifyCompletionList
(
fileContents
,
"defaultof<wrapp"
,
[
"wrappedType"
],
[]
)
[<
Test
>]
let
``Completion list in generic class method body contains type parameter``
()
=
let
fileContents
=
"""
type A<'wrappedType> () =
member _.Null () = Unchecked.defaultof<wrapp>
"""
VerifyCompletionList
(
fileContents
,
"defaultof<wrapp"
,
[
"wrappedType"
],
[]
)
[<
Test
>]
let
``Completion list in type application contains modules, types and type parameters but not keywords or functions``
()
=
let
fileContents
=
"""
let emptyMap<'keyType, 'lValueType> () =
Map.empty<'keyType, l>
"""
VerifyCompletionList
(
fileContents
,
", l"
,
[
"LanguagePrimitives"
;
"List"
;
"lValueType"
],
[
"let"
;
"log"
])
#
if
EXE
#
if
EXE
ShouldDisplaySystemNamespace
()
ShouldDisplaySystemNamespace
()
#
endif
#
endif
麦壳饼
@mysticboy
mentioned in commit
be0cd39e
·
7月 25, 2022
mentioned in commit
be0cd39e
mentioned in commit be0cd39e2d1b089e4315185f9ad8fcd508caa74f
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录