Skip to content

Commit f7dabe1

Browse files
Michael RenderRenderMichael
authored andcommitted
Allow null langword fixer at the end of an XML tag
1 parent 98ea496 commit f7dabe1

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

src/Features/CSharpTest/ReplaceDocCommentTextWithTag/ReplaceDocCommentTextWithTagTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,25 @@ class C<TKey>
7575
""");
7676
}
7777

78+
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/76548")]
79+
public async Task TestEndOfKeyword_XmlCloseTagFollowing()
80+
{
81+
await TestInRegularAndScriptAsync(
82+
"""
83+
/// <summary>Testing keyword null[||]</summary>
84+
class C<TKey>
85+
{
86+
}
87+
""",
88+
89+
"""
90+
/// <summary>Testing keyword <see langword="null"/></summary>
91+
class C<TKey>
92+
{
93+
}
94+
""");
95+
}
96+
7897
[Fact]
7998
public async Task TestSelectedKeyword()
8099
{

src/Features/Core/Portable/ReplaceDocCommentTextWithTag/AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
2525
{
2626
var (document, span, cancellationToken) = context;
2727
var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
28-
var token = root.FindToken(span.Start, findInsideTrivia: true);
28+
var token = root.FindTokenFromEnd(span.Start, findInsideTrivia: true);
2929

3030
if (!IsXmlTextToken(token))
3131
return;

src/Features/VisualBasicTest/ReplaceDocCommentTextWithTag/ReplaceDocCommentTextWithTagTests.vb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ class C(Of TKey)
6868
end class")
6969
End Function
7070

71+
<Fact, WorkItem("https://github.com/dotnet/roslyn/issues/76548")>
72+
Public Async Function TestEndOfKeyword_XmlCloseTagFollowing() As Task
73+
Await TestInRegularAndScriptAsync(
74+
"
75+
''' <summary>Testing keyword MustInherit[||]</summary>
76+
class C(Of TKey)
77+
end class",
78+
"
79+
''' <summary>Testing keyword <see langword=""MustInherit""/></summary>
80+
class C(Of TKey)
81+
end class")
82+
End Function
83+
7184
<Fact>
7285
Public Async Function TestSelectedKeyword() As Task
7386
Await TestInRegularAndScriptAsync(

0 commit comments

Comments
 (0)