提交 da5b06b2 编写于 作者: W Wonseok Chae

Merge pull request #3852 from wschae/auto

[Bug][VB] RudeEdit error message blindly blames AutoProperty

It fixes #3605
......@@ -4069,11 +4069,24 @@ End Class
End Sub
<Fact>
Public Sub PropertyRename()
Public Sub PropertyRename1()
Dim src1 = "Class C : ReadOnly Property P As Integer" & vbLf & "Get : End Get : End Property : End Class"
Dim src2 = "Class C : ReadOnly Property Q As Integer" & vbLf & "Get : End Get : End Property : End Class"
Dim edits = GetTopEdits(src1, src2)
edits.VerifyEdits(
"Update [ReadOnly Property P As Integer]@10 -> [ReadOnly Property Q As Integer]@10")
edits.VerifyRudeDiagnostics(
Diagnostic(RudeEditKind.Renamed, "ReadOnly Property Q", FeaturesResources.Property))
End Sub
<Fact>
Public Sub PropertyRename2()
Dim src1 = "Class C : ReadOnly Property P As Integer : End Class"
Dim src2 = "Class C : ReadOnly Property Q As Integer : End Class"
Dim edits = GetTopEdits(src1, src2)
edits.VerifyEdits(
"Update [ReadOnly Property P As Integer]@10 -> [ReadOnly Property Q As Integer]@10")
......
......@@ -1540,10 +1540,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue
Return FeaturesResources.Constructor
Case SyntaxKind.PropertyBlock
Return FeaturesResources.Property
Case SyntaxKind.PropertyStatement
Return FeaturesResources.AutoProperty
Return If(node.IsParentKind(SyntaxKind.PropertyBlock),
FeaturesResources.Property,
FeaturesResources.AutoProperty)
Case SyntaxKind.EventBlock,
SyntaxKind.EventStatement
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册