@@ -1365,8 +1365,18 @@ type FSharpAccessibility(a:Accessibility, ?isProtected) =
13651365
13661366/// An intellisense declaration
13671367[<Sealed>]
1368- type FSharpDeclarationListItem ( name : string , nameInCode : string , fullName : string , glyph : FSharpGlyph , info , isAttribute : bool , accessibility : FSharpAccessibility option ,
1369- kind: CompletionItemKind, isOwnMember: bool, priority: int) =
1368+ type FSharpDeclarationListItem
1369+ ( name: string,
1370+ nameInCode: string,
1371+ fullName: string,
1372+ glyph: FSharpGlyph,
1373+ info,
1374+ isAttribute: bool,
1375+ accessibility: FSharpAccessibility option,
1376+ kind: CompletionItemKind,
1377+ isOwnMember: bool,
1378+ priority: int
1379+ ) =
13701380
13711381let mutable descriptionTextHolder : FSharpToolTipText < _ > option = None
13721382let mutable task = null
@@ -1493,23 +1503,34 @@ type FSharpDeclarationListInfo(declarations: FSharpDeclarationListItem[]) =
14931503
14941504let decls =
14951505// Filter out duplicate names
1496- items|> List.map( fun ( nm , itemsWithSameName ) ->
1506+ items|> List.map( fun ( name , itemsWithSameName ) ->
14971507match itemsWithSameNamewith
14981508| [] -> failwith" Unexpected empty bag"
14991509| item:: _ as items->
15001510let glyph = ItemDescriptionsImpl.GlyphOfItem( denv, item.Item)
15011511let name , nameInCode =
1502- if nm .StartsWith" (" && nm .EndsWith" )" then
1503- let cleanName = nm .[ 2 .. nm .Length- 3 ]
1512+ if name .StartsWith" (" && name .EndsWith" )" then
1513+ let cleanName = name .[ 2 .. name .Length- 3 ]
15041514 cleanName,
1505- if IsOperatorName nmthen cleanNameelse " ``" + cleanName+ " ``"
1506- else nm, nm
1515+ if IsOperatorName namethen cleanNameelse " ``" + cleanName+ " ``"
1516+ else
1517+ name, Lexhelp.Keywords.QuoteIdentifierIfNeeded name
15071518
15081519let fullName = ItemDescriptionsImpl.FullNameOfItem g item.Item
15091520
15101521 FSharpDeclarationListItem(
1511- name, nameInCode, fullName, glyph, Choice1Of2( items, infoReader, m, denv, reactor, checkAlive),
1512- ItemDescriptionsImpl.IsAttribute infoReader item.Item, getAccessibility item.Item, item.Kind, item.IsOwnMember, item.MinorPriority))
1522+ name,
1523+ nameInCode,
1524+ fullName,
1525+ glyph,
1526+ Choice1Of2( items, infoReader, m, denv, reactor, checkAlive),
1527+ ItemDescriptionsImpl.IsAttribute infoReader item.Item,
1528+ getAccessibility item.Item,
1529+ item.Kind,
1530+ item.IsOwnMember,
1531+ item.MinorPriority
1532+ )
1533+ )
15131534
15141535new FSharpDeclarationListInfo( Array.ofList decls)
15151536