diff --git a/src/Microsoft.AspNetCore.Razor/Editor/EditorHints.cs b/src/Microsoft.AspNetCore.Razor/Editor/EditorHints.cs
index a32b383980..719fa01e54 100644
--- a/src/Microsoft.AspNetCore.Razor/Editor/EditorHints.cs
+++ b/src/Microsoft.AspNetCore.Razor/Editor/EditorHints.cs
@@ -6,9 +6,10 @@ using System;
namespace Microsoft.AspNetCore.Razor.Editor
{
///
- /// Used within .
+ /// This class is obsolete and will be removed in a future version.
///
[Flags]
+ [Obsolete("This class is obsolete and will be removed in a future version.")]
public enum EditorHints
{
///
diff --git a/src/Microsoft.AspNetCore.Razor/Editor/SpanEditHandler.cs b/src/Microsoft.AspNetCore.Razor/Editor/SpanEditHandler.cs
index b160962caa..c6934f93c9 100644
--- a/src/Microsoft.AspNetCore.Razor/Editor/SpanEditHandler.cs
+++ b/src/Microsoft.AspNetCore.Razor/Editor/SpanEditHandler.cs
@@ -29,8 +29,9 @@ namespace Microsoft.AspNetCore.Razor.Editor
public AcceptedCharacters AcceptedCharacters { get; set; }
///
- /// Provides a set of hints to editors which may be manipulating the document in which this span is located.
+ /// This property is obsolete and will be removed in a future version.
///
+ [Obsolete("This property is obsolete and will be removed in a future version.")]
public EditorHints EditorHints { get; set; }
public Func> Tokenizer { get; set; }
@@ -158,7 +159,10 @@ namespace Microsoft.AspNetCore.Razor.Editor
public override string ToString()
{
- return GetType().Name + ";Accepts:" + AcceptedCharacters + ((EditorHints == EditorHints.None) ? string.Empty : (";Hints: " + EditorHints.ToString()));
+ return GetType().Name + ";Accepts:" + AcceptedCharacters +
+#pragma warning disable 618 // Ignore obsolete warning for EditorHints
+ ((EditorHints == EditorHints.None) ? string.Empty : (";Hints: " + EditorHints.ToString()));
+#pragma warning restore 618 // Ignore obsolete warning for EditorHints
}
public override bool Equals(object obj)
@@ -167,7 +171,9 @@ namespace Microsoft.AspNetCore.Razor.Editor
return other != null &&
GetType() == other.GetType() &&
AcceptedCharacters == other.AcceptedCharacters &&
+#pragma warning disable 618 // Ignore obsolete warning for EditorHints
EditorHints == other.EditorHints;
+#pragma warning restore 618 // Ignore obsolete warning for EditorHints
}
public override int GetHashCode()
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs
index db1ef775d4..892ec81b3e 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Editor/AutoCompleteEditHandlerTest.cs
@@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
{
public class AutoCompleteEditHandlerTest
{
+#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static TheoryData MatchingTestDataSet
{
get
@@ -180,6 +181,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
};
}
}
+#pragma warning restore 618 // Ignore obsolete warning for EditorHints
[Theory]
[MemberData(nameof(MatchingTestDataSet))]
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs
index e8d21445ed..b0cb4dd719 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Editor/ImplicitExpressionEditHandlerTest.cs
@@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
{
public class ImplicitExpressionEditHandlerTest
{
+#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static TheoryData MatchingTestDataSet
{
get
@@ -253,6 +254,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
};
}
}
+#pragma warning restore 618 // Ignore obsolete warning for EditorHints
[Theory]
[MemberData(nameof(MatchingTestDataSet))]
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs
index 32ecc960b4..eb21188b47 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Editor/SpanEditHandlerTest.cs
@@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
{
public class SpanEditHandlerTest
{
+#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static TheoryData MatchingTestDataSet
{
get
@@ -127,6 +128,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
};
}
}
+#pragma warning restore 618 // Ignore obsolete warning for EditorHints
[Theory]
[MemberData(nameof(MatchingTestDataSet))]
diff --git a/test/Microsoft.AspNetCore.Razor.Test/Framework/TestSpanBuilder.cs b/test/Microsoft.AspNetCore.Razor.Test/Framework/TestSpanBuilder.cs
index e97dae18a9..d030149d29 100644
--- a/test/Microsoft.AspNetCore.Razor.Test/Framework/TestSpanBuilder.cs
+++ b/test/Microsoft.AspNetCore.Razor.Test/Framework/TestSpanBuilder.cs
@@ -269,10 +269,12 @@ namespace Microsoft.AspNetCore.Razor.Test.Framework
});
}
+#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static SpanConstructor WithEditorHints(this SpanConstructor self, EditorHints hints)
{
return self.With(eh => eh.EditorHints = hints);
}
+#pragma warning restore 618 // Ignore obsolete warning for EditorHints
}
public class UnclassifiedCodeSpanConstructor