Skip to content

Commit 6e086e0

Browse files
committed
Fixed a bug affecting older versions of Roslyn; updated READMEs
1 parent dea1cbf commit 6e086e0

File tree

4 files changed

+13
-30
lines changed

4 files changed

+13
-30
lines changed

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,6 @@ After that, open the solution VSAddWithXmlDoc.sln, and click Ctrl+Shift+B in Vis
115115
# ❔ Got any questions?
116116
Feel free to create an Issue post on the GitHub Repository if you have any questions, found a bug, or proposing a suggestion!
117117

118-
# 🐞 Known Issues
119-
One known problem is that when you click to generate equality methods, the class's base list can become incomplete, like so:
120-
```cs
121-
public class Class1 :
122-
```
123-
This seems to be a bug with the `NormalizeWhitespace()` method in Roslyn. The issue is that we're using an older version, 3.3.1, because
124-
apparently Visual Studio does not load AddWithXmlDoc if it uses a newer version of Roslyn (i.e. 4.14.0), so we have to use 3.3.1. If you're aware
125-
on potential fixes of this problem, please let me know by creating an Issue post on the GitHub Repository!
126-
127-
But it's not a major problem. It just takes 2-4 seconds to manually add:
128-
```cs
129-
public class Class1 : IEquatable<Class1>
130-
```
131-
132118
# 🤗 Author
133119
[winscripter](https://github.com/winscripter)
134120

src/AddWithXmlDoc.Core/CSharp/XmlUtil.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,16 @@ public static TypeDeclarationSyntax WithEqualsGetHashCodeOperatorsAndIEquatable(
1010
TypeDeclarationSyntax tds, IEnumerable<MemberDeclarationSyntax> members)
1111
{
1212
// Add IEquatable`1 to the base list
13-
tds = tds.WithBaseList(
14-
SyntaxFactory.BaseList(
15-
[.. tds.BaseList?.Types ?? [],
16-
SyntaxFactory.SimpleBaseType(
17-
SyntaxFactory.GenericName(
18-
SyntaxFactory.Identifier("IEnumerable"))
19-
.WithTypeArgumentList(
20-
SyntaxFactory.TypeArgumentList(
21-
SyntaxFactory.SingletonSeparatedList<TypeSyntax>(
22-
SyntaxFactory.IdentifierName(tds.Identifier.Text))))
23-
.NormalizeWhitespace()
24-
)
25-
]
26-
)
27-
);
13+
tds = (TypeDeclarationSyntax)tds.AddBaseListTypes(
14+
SyntaxFactory.SimpleBaseType(
15+
SyntaxFactory.GenericName(
16+
SyntaxFactory.Identifier("IEnumerable"))
17+
.WithTypeArgumentList(
18+
SyntaxFactory.TypeArgumentList(
19+
SyntaxFactory.SingletonSeparatedList<TypeSyntax>(
20+
SyntaxFactory.IdentifierName(tds.Identifier.Text))))
21+
.NormalizeWhitespace()
22+
));
2823

2924
string typeName = tds.Identifier.Text;
3025

src/AddWithXmlDoc.Core/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# AddWithXmlDoc.Core
2+
This is the core library for AddWithXmlDoc, a Visual Studio extension to add XML-documented members to classes.

src/VSAddWithXmlDoc/VSAddWithXmlDoc.Vsix/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Metadata>
44
<Identity Id="VSAddWithXmlDoc..94e49af1-4caf-464b-be46-31c0ec2e8d53" Version="1.0" Language="en-US" Publisher="winscripter"/>
55
<DisplayName>VSAddWithXmlDoc</DisplayName>
6-
<Description xml:space="preserve">This extension allows you to add methods like Equals, GetHashCode, and parameterless constructors, with XML documentation inserted for you.</Description>
6+
<Description xml:space="preserve">This extension allows you to add methods like Equals, GetHashCode, and parameterless constructors, with XML documentation inserted for you. See more on https://github.com/winscripter/AddWithXmlDoc.</Description>
77
</Metadata>
88
<Installation>
99
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,)" />

0 commit comments

Comments
 (0)