提交 492509cb 编写于 作者: V Vasily Kirichenko 提交者: Kevin Ransom (msft)

Fix glyphs for unresolvable items in completion list (#2896)

* fix glyphs for Item.UnqualifiedType

* fix description tooltip for unresolved completion items
上级 dd18b3e0
......@@ -982,7 +982,8 @@ module internal ItemDescriptionsImpl =
FSharpStructuredToolTipElement.Single(layout, xml)
// Types.
| Item.Types(_,((TType_app(tcref,_)):: _)) ->
| Item.Types(_,((TType_app(tcref,_)):: _))
| Item.UnqualifiedType (tcref :: _) ->
let denv = { denv with shortTypeNames = true }
let layout =
NicePrint.layoutTycon denv infoReader AccessibleFromSomewhere m (* width *) tcref.Deref ^^
......@@ -1042,6 +1043,7 @@ module internal ItemDescriptionsImpl =
| Item.SetterArg (_, item) ->
FormatItemDescriptionToToolTipElement isDecl infoReader m denv item
| _ ->
FSharpStructuredToolTipElement.None
......@@ -1341,8 +1343,24 @@ module internal ItemDescriptionsImpl =
| Item.MethodGroup (_, minfos, _) when minfos |> List.forall (fun minfo -> minfo.IsExtensionMember) -> FSharpGlyph.ExtensionMethod
| Item.MethodGroup _ -> FSharpGlyph.Method
| Item.TypeVar _
| Item.Types _
| Item.UnqualifiedType _ -> FSharpGlyph.Class
| Item.Types _ -> FSharpGlyph.Class
| Item.UnqualifiedType (tcref :: _) ->
if tcref.IsEnumTycon || tcref.IsILEnumTycon then FSharpGlyph.Enum
elif tcref.IsExceptionDecl then FSharpGlyph.Exception
elif tcref.IsFSharpDelegateTycon then FSharpGlyph.Delegate
elif tcref.IsFSharpInterfaceTycon then FSharpGlyph.Interface
elif tcref.IsFSharpStructOrEnumTycon then FSharpGlyph.Struct
elif tcref.IsModule then FSharpGlyph.Module
elif tcref.IsNamespace then FSharpGlyph.NameSpace
elif tcref.IsUnionTycon then FSharpGlyph.Union
elif tcref.IsILTycon then
let (TILObjectReprData (_, _, tydef)) = tcref.ILTyconInfo
if tydef.IsInterface then FSharpGlyph.Interface
elif tydef.IsDelegate then FSharpGlyph.Delegate
elif tydef.IsEnum then FSharpGlyph.Enum
elif tydef.IsStructOrEnum then FSharpGlyph.Struct
else FSharpGlyph.Class
else FSharpGlyph.Class
| Item.ModuleOrNamespaces(modref::_) ->
if modref.IsNamespace then FSharpGlyph.NameSpace else FSharpGlyph.Module
| Item.ArgName _ -> FSharpGlyph.Variable
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册