Skip to content

Commit c2b4f88

Browse files
committed
Downgrade newtonsoft.json
1 parent 636f069 commit c2b4f88

File tree

4 files changed

+9
-32
lines changed

4 files changed

+9
-32
lines changed

src/Microsoft.VisualStudio.Jdt.Tests/Microsoft.VisualStudio.Jdt.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Include="MicroBuild.NonShipping" Version="2.0.40" />
1111
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170425-07" />
12-
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
12+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
1313
<PackageReference Include="xunit" Version="2.2.0" />
1414
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
1515
</ItemGroup>

src/Microsoft.VisualStudio.Jdt/Microsoft.VisualStudio.Jdt.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="MicroBuild.VisualStudio" Version="2.0.40" PrivateAssets="all" />
24-
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
24+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
2525
</ItemGroup>
2626

2727
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.5'">
2828
<PackageReference Include="System.Diagnostics.FileVersionInfo" Version="4.3.0" />
29+
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
2930
</ItemGroup>
3031

3132
<ItemGroup>

src/Microsoft.VisualStudio.Jdt/Processors/Attributes/JdtAttributeExtensions.cs

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,26 @@ namespace Microsoft.VisualStudio.Jdt
55
{
66
using System;
77
using System.Collections.Generic;
8-
using System.ComponentModel;
98
using System.Linq;
10-
using System.Reflection;
119

1210
/// <summary>
1311
/// Implements extensions for <see cref="JdtAttributes"/>
1412
/// </summary>
1513
internal static class JdtAttributeExtensions
1614
{
17-
/// <summary>
18-
/// Gets the description (name) of the attribute
19-
/// </summary>
20-
/// <param name="attribute">The attribute</param>
21-
/// <returns>The name of the attribute</returns>
22-
internal static string GetDescription(this JdtAttributes attribute)
23-
{
24-
var type = attribute.GetType();
25-
var typeInfo = type.GetTypeInfo();
26-
var name = Enum.GetName(type, attribute);
27-
var description = typeInfo.GetField(name)
28-
.GetCustomAttributes(false)
29-
.OfType<DescriptionAttribute>()
30-
.SingleOrDefault();
31-
32-
if (description == null)
33-
{
34-
throw new NotImplementedException(attribute.ToString() + " does not have a corresponding name");
35-
}
36-
37-
return description.Description;
38-
}
39-
4015
/// <summary>
4116
/// Get the full name of an attribute, with the JDT prefix
4217
/// </summary>
4318
/// <param name="attribute">The attribute</param>
4419
/// <returns>A string with the full name of the requested attribute</returns>
4520
internal static string FullName(this JdtAttributes attribute)
4621
{
47-
return JdtUtilities.JdtSyntaxPrefix + attribute.GetDescription();
22+
if (attribute == JdtAttributes.None)
23+
{
24+
return JdtUtilities.JdtSyntaxPrefix;
25+
}
26+
27+
return JdtUtilities.JdtSyntaxPrefix + Enum.GetName(typeof(JdtAttributes), attribute).ToLower();
4828
}
4929

5030
/// <summary>

src/Microsoft.VisualStudio.Jdt/Processors/Attributes/JdtAttributeValidator.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ namespace Microsoft.VisualStudio.Jdt
55
{
66
using System;
77
using System.Collections.Generic;
8-
using System.ComponentModel;
98
using System.Linq;
109
using Newtonsoft.Json.Linq;
1110

@@ -17,19 +16,16 @@ internal enum JdtAttributes
1716
/// <summary>
1817
/// Represents an non existant attribute
1918
/// </summary>
20-
[Description(null)]
2119
None = 0,
2220

2321
/// <summary>
2422
/// The JDT path attribute
2523
/// </summary>
26-
[Description("path")]
2724
Path,
2825

2926
/// <summary>
3027
/// The JDT path attribute
3128
/// </summary>
32-
[Description("value")]
3329
Value,
3430
}
3531

0 commit comments

Comments
 (0)