Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e38a8a

Browse files
committed
Members hidden from IntelliSense are now also omitted in QuickInfo -fixesdotnet#50
1 parent5f27136 commit1e38a8a

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

‎src/fsharp/NicePrint.fs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,6 +1505,7 @@ module private TastDefinitionPrinting =
15051505
not(isInterfaceTy denv.g oty)
15061506
|[]->true)
15071507
|> List.filter(fun v-> denv.showObsoleteMembers||not(HasFSharpAttribute denv.g denv.g.attrib_SystemObsolete v.Attribs))
1508+
|> List.filter(fun v->not(Infos.AttributeChecking.CheckFSharpAttributesForHidden denv.g v.Attribs))
15081509
// sort
15091510
letsortKey(v:ValRef)=(not v.IsConstructor,// constructors before others
15101511
v.Id.idText,// sort by name

‎src/fsharp/infos.fs‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,20 +2637,25 @@ module AttributeChecking =
26372637
let(AttribInfo(tref,_))= g.attrib_SystemObsolete
26382638
isSome(TryDecodeILAttribute g tref(Some(tref.Scope)) cattrs)
26392639

2640+
/// Checks the attributes for CompilerMessageAttribute, which has an IsHidden argument that allows
2641+
/// items to be suppressed from intellisense.
2642+
letCheckFSharpAttributesForHidden g attribs=
2643+
nonNil attribs&&
2644+
(match TryFindFSharpAttribute g g.attrib_CompilerMessageAttribute attribswith
2645+
| Some(Attrib(_,_,[AttribStringArg_; AttribInt32Arg messageNumber],
2646+
ExtractAttribNamedArg"IsHidden"(AttribBoolArg v),_,_,_))->
2647+
// Message number 62 is for "ML Compatibility". Items labelled with this are visible in intellisense
2648+
// when mlCompatibility is set.
2649+
v&&not(messageNumber=62&& g.mlCompatibility)
2650+
|_->false)
2651+
26402652
/// Indicate if a list of F# attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.
26412653
/// Also check the attributes for CompilerMessageAttribute, which has an IsHidden argument that allows
26422654
/// items to be suppressed from intellisense.
26432655
letCheckFSharpAttributesForUnseen g attribs _m=
26442656
nonNil attribs&&
26452657
(letisObsolete= isSome(TryFindFSharpAttribute g g.attrib_SystemObsolete attribs)
2646-
letisHidden=
2647-
(match TryFindFSharpAttribute g g.attrib_CompilerMessageAttribute attribswith
2648-
| Some(Attrib(_,_,[AttribStringArg_; AttribInt32Arg messageNumber],
2649-
ExtractAttribNamedArg"IsHidden"(AttribBoolArg v),_,_,_))->
2650-
// Message number 62 is for "ML Compatibility". Items labelled with this are visible in intellisense
2651-
// when mlCompatibility is set.
2652-
v&&not(messageNumber=62&& g.mlCompatibility)
2653-
|_->false)
2658+
letisHidden= CheckFSharpAttributesForHidden g attribs
26542659
isObsolete|| isHidden
26552660
)
26562661

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp