dotnet / dotnet/roslyn

Inheritance margin gets between line numbers and current line pill margins

Open
#82,169 0 comments 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Version Used**:
main
**Steps to Reproduce**:

![Image](https://github.com/user-attachments/assets/837baae3-0d18-4c9c-ad67-70a189320135)

**Expected Behavior**:
Inheritance margin is the leftmost margin within the container.
**Actual Behavior**:
Gets between two built-in margins.

A comment in InheritanceMarginViewMarginProviderindicates the margin is supposed to be left-most:

// Place our margin inside Left Selection Margin Container. And keep it to the left-most location.
[MarginContainer(PredefinedMarginNames.LeftSelection)]
[Order(After = DefaultOrderings.Lowest)]

But this clearly doesn't work. The issue is that DefaultOrderings.Lowest is supposed to be used with Before argument, not After:
"Orderable items that do not explicitly indicate they are before Lowest have an implicit constraint that they are after Lowest."
https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.utilities.defaultorderings?view=visualstudiosdk-2022

Switch to [Order(Before = DefaultOrderings.Lowest)] instead.

Contributor guide

Open the contributing guide

Research direction

Open InheritanceMarginViewMarginProvider and inspect its margin ordering attributes, using the linked DefaultOrderings documentation to confirm the constraint semantics. Change the ordering so the inheritance margin is leftmost, then verify the margin no longer appears between the line-number and current-line-pill margins.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.