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

Commit6f99029

Browse files
committed
Obsolete members are now also omitted in QuickInfo - referencesdotnet#50
1 parentae54746 commit6f99029

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

‎src/fsharp/NicePrint.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,8 +1504,8 @@ module private TastDefinitionPrinting =
15041504
// Don't print individual methods forming interface implementations - these are currently never exported
15051505
not(isInterfaceTy denv.g oty)
15061506
|[]->true)
1507-
|> 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))
1507+
|> List.filter(fun v-> denv.showObsoleteMembers||not(Infos.AttributeChecking.CheckFSharpAttributesForObsolete denv.g v.Attribs))
1508+
|> List.filter(fun v->denv.showHiddenMembers||not(Infos.AttributeChecking.CheckFSharpAttributesForHidden denv.g v.Attribs))
15091509
// sort
15101510
letsortKey(v:ValRef)=(not v.IsConstructor,// constructors before others
15111511
v.Id.idText,// sort by name

‎src/fsharp/fsc.fs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,13 @@ let runFromCommandLineToImportingAssemblies(displayPSTypeProviderSecurityDialogB
548548
// Code from here on down is just used by fsc.exe
549549
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
550550

551-
letBuildInitialDisplayEnvForDocGeneration tcGlobals=
551+
letBuildInitialDisplayEnvForSigFileGeneration tcGlobals=
552552
letdenv= DisplayEnv.Empty tcGlobals
553553
letdenv=
554554
{ denvwith
555555
showImperativeTyparAnnotations=true;
556+
showHiddenMembers=true;
557+
showObsoleteMembers=true;
556558
showAttributes=true;}
557559
denv.SetOpenPaths
558560
[ FSharpLib.RootPath
@@ -577,7 +579,7 @@ module InterfaceFileWriter =
577579
fprintfn os""
578580

579581
for(TImplFile(_,_,mexpr,_,_))in declaredImplsdo
580-
letdenv=BuildInitialDisplayEnvForDocGeneration tcGlobals
582+
letdenv=BuildInitialDisplayEnvForSigFileGeneration tcGlobals
581583
writeViaBufferWithEnvironmentNewLines os(fun os s-> Printf.bprintf os"%s\n\n" s)
582584
(NicePrint.layoutInferredSigOfModuleExprtrue denv infoReader AccessibleFromSomewhere range0 mexpr|> Layout.squashTo80|> Layout.showL)
583585

‎src/fsharp/infos.fs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,15 +2649,17 @@ module AttributeChecking =
26492649
v&&not(messageNumber=62&& g.mlCompatibility)
26502650
|_->false)
26512651

2652+
/// Indicate if a list of F# attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.
2653+
letCheckFSharpAttributesForObsolete g attribs=
2654+
nonNil attribs&&(HasFSharpAttribute g g.attrib_SystemObsolete attribs)
2655+
26522656
/// Indicate if a list of F# attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.
26532657
/// Also check the attributes for CompilerMessageAttribute, which has an IsHidden argument that allows
26542658
/// items to be suppressed from intellisense.
26552659
letCheckFSharpAttributesForUnseen g attribs _m=
2656-
nonNil attribs&&
2657-
(letisObsolete= isSome(TryFindFSharpAttribute g g.attrib_SystemObsolete attribs)
2658-
letisHidden= CheckFSharpAttributesForHidden g attribs
2659-
isObsolete|| isHidden
2660-
)
2660+
nonNil attribs&&
2661+
(CheckFSharpAttributesForObsolete g attribs||
2662+
CheckFSharpAttributesForHidden g attribs)
26612663

26622664
#if EXTENSIONTYPING
26632665
/// Indicate if a list of provided attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.

‎src/fsharp/tastops.fs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2354,6 +2354,7 @@ type DisplayEnv =
23542354
suppressNestedTypes:bool;
23552355
maxMembers:int option;
23562356
showObsoleteMembers:bool;
2357+
showHiddenMembers:bool;
23572358
showTyparBinding:bool;
23582359
showImperativeTyparAnnotations:bool;
23592360
suppressInlineKeyword:bool;
@@ -2384,7 +2385,8 @@ type DisplayEnv =
23842385
shortTypeNames=false;
23852386
suppressNestedTypes=false;
23862387
maxMembers=None;
2387-
showObsoleteMembers=true;
2388+
showObsoleteMembers=false;
2389+
showHiddenMembers=false;
23882390
showTyparBinding=false;
23892391
showImperativeTyparAnnotations=false;
23902392
suppressInlineKeyword=false;

‎src/fsharp/tastops.fsi‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ type DisplayEnv =
590590
suppressNestedTypes:bool;
591591
maxMembers:int option;
592592
showObsoleteMembers:bool;
593+
showHiddenMembers:bool;
593594
showTyparBinding:bool;
594595
showImperativeTyparAnnotations:bool;
595596
suppressInlineKeyword:bool;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp