-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix the duplicate glyphs in Inheritance margin #73996
Conversation
@@ -523,9 +524,9 @@ public Task TestCSharpSpecialMember(string memberDeclaration, TestHost testHost) | |||
var markup = $@" | |||
public abstract class {{|target1:Bar1|}} | |||
{{}} | |||
public class Bar : Bar1 | |||
public class {{|{SearchAreaTag}:Bar : Bar1 |
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.
This test is modified a little bit.
The prev test is asserting that no inheritanceMargin tag should be created for special C# methods. (e.g. constructor/deconsctructor/operator)
So the assertion is just assert one tag is created for the type (class Bar1
here)
It only chooses to search the memberDeclaration
region so only tags for Bar1
would be created.
However, after the change, we would only return the tag within the search span. So expand the SearchAreaTag
area here to include class Bar1
No real change here.
src/Features/Core/Portable/InheritanceMargin/AbstractInheritanceMarginService_Helpers.cs
Show resolved
Hide resolved
Fixes #73615? |
Yes it should fix the problem |
Fix: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1988154/
Currently, you might find there are duplicate glyphs in inheritance margin like:
(There are three controls created in the canvas, all of them are same)
Reason:
Our tagger infra has switched to a three-tagger stucture.
Tagger 1 -> Tag the [visible region + 10 line, visible region - 10 line]
Tagger 2 -> Tag the [visible region + 10 line, visible region + 100 line]
Tagger 3 -> Tag the [visible region - 100 line, visible region - 10 line]
This change causes problem here
So computing the symbol to tag, inheritance margin service would call
root.DescendantNodes(spanToSearch)
to find all the nodes intersect withspanToSearch
.So suppose you have a class, and the visible region is around
class A
Tagger 1 would tag class
A
. (Because thespanToSearch
is the visible span)Tagger 2 would also tag class
A
, because the top lines span also intersects withclass A
Tagger 3 would also tag class
A
, because the empty body span also intersects withclass A
The solution is to only create the tag when
spanToSearch
contains the member's identifier.