-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide EditorBrowsableNever members by default #4618
Changes from 1 commit
a481dcf
1243679
1043f41
606f12c
3109aa5
d0513c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
bool isHeadingWithDelta = false; | ||
string headingClass = String.Empty; | ||
string documentationRow = String.Empty; | ||
string hiddenApiRow = String.Empty; | ||
string codeLineDisplay = String.Empty; | ||
string codeLineClass = (!String.IsNullOrWhiteSpace(Model.CodeLine.LineClass)) ? Model.CodeLine.LineClass.Trim() : String.Empty; | ||
int? sectionKey = Model.DiffSectionId ?? Model.CodeLine.SectionKey; | ||
|
@@ -58,6 +59,15 @@ | |
codeLineDisplay = "hidden-row"; | ||
} | ||
|
||
if (Model.CodeLine.IsHiddenApi) | ||
{ | ||
hiddenApiRow = "hidden-api"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies the italicized style. |
||
if (Model.Kind == DiffLineKind.Unchanged) | ||
{ | ||
hiddenApiRow += " hidden-api-toggleable d-none"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes it toggleable. When there is a diff, it should not be toggleable. |
||
} | ||
} | ||
|
||
if (Regex.IsMatch(codeLineClass, @".*lvl_[0-9]+_parent.*")) | ||
{ | ||
isSubSectionHeading = true; | ||
|
@@ -70,7 +80,7 @@ | |
isHeadingWithDelta = true; | ||
} | ||
var userPreference = TempData["UserPreference"] as UserPreferenceModel ?? new UserPreferenceModel(); | ||
var rowClass = RemoveMultipleSpaces($"code-line {headingClass} {codeLineClass} {lineClass} {codeLineDisplay} {documentationRow}"); | ||
var rowClass = RemoveMultipleSpaces($"code-line {headingClass} {codeLineClass} {lineClass} {codeLineDisplay} {documentationRow} {hiddenApiRow}"); | ||
var cellContent = String.Empty; | ||
for (int i = 0; i < Model.CodeLine.Indent; i++) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
<ul class="nav-list-children"> | ||
@foreach (var item in Model) | ||
{ | ||
<li class="@navListGroupClass"> | ||
<li class="@navListGroupClass @(item.IsHiddenApi ? " hidden-api-toggleable d-none" : "")"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hides the navigation section if it represents a hidden namespace/type.
JoshLove-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<span class="nav-list-toggle @(item.ChildItems.Any() ? "":"invisible")"></span> | ||
|
||
@if (item.Tags != null && item.Tags.ContainsKey("TypeKind")) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My assumption is that this is safe because all out-dated codefiles will be updated in the background to the latest version. If we think this is too dangerous I can make the new property nullable and add a safeguard such that if either is null, we don't consider it a difference. This way old files containing hidden APIs will not trigger a diff against new files. We could also leave the values as null for non C# languages so that they would not run into the same issue if ever enabling support for hidden API hiding.
However, it would be a lot simpler if we could rely on the background update process.