提交 76852a28 编写于 作者: C Cyrus Najmabadi

Add code fixer to add [Obsolete] attribute on code that gets an 'obsolete' warning.

上级 569124ee
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.AddObsoleteAttribute;
using Microsoft.CodeAnalysis.CodeFixes;
namespace Microsoft.CodeAnalysis.CSharp.AddObsoleteAttribute
{
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(CSharpAddObsoleteAttributeCodeFixProvider)), Shared]
internal class CSharpAddObsoleteAttributeCodeFixProvider
: AbstractAddObsoleteAttributeCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds { get; } =
ImmutableArray.Create(
"CS0612", // 'C' is obsolete
"CS0618", // 'C' is obsolete (msg)
"CS0672" // Member 'D.F()' overrides obsolete member 'C.F()'
);
public CSharpAddObsoleteAttributeCodeFixProvider()
: base(CSharpSyntaxFactsService.Instance, CSharpFeaturesResources.Add_Obsolete)
{
}
}
}
......@@ -70,6 +70,15 @@ internal class CSharpFeaturesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Add [Obsolete].
/// </summary>
internal static string Add_Obsolete {
get {
return ResourceManager.GetString("Add_Obsolete", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add parentheses.
/// </summary>
......
......@@ -524,4 +524,7 @@
<data name="if_statement_can_be_simplified" xml:space="preserve">
<value>'if' statement can be simplified</value>
</data>
<data name="Add_Obsolete" xml:space="preserve">
<value>Add [Obsolete]</value>
</data>
</root>
\ No newline at end of file
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Dočasná vložená proměnná</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Inline temporär variabel</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Variable temporal en línea</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Variable temporaire inline</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Variabile temporanea inline</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">インラインの一時変数</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">인라인 임시 변수</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Wstawiona zmienna tymczasowa</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Variável temporária embutida</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Встроенная временная переменная</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="tr" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">Satır içi geçici değişken</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">内联临时变量</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../CSharpFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add [Obsolete]</source>
<target state="new">Add [Obsolete]</target>
<note />
</trans-unit>
<trans-unit id="Inline_temporary_variable">
<source>Inline temporary variable</source>
<target state="translated">內嵌暫存變數</target>
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.AddObsoleteAttribute
{
internal abstract class AbstractAddObsoleteAttributeCodeFixProvider
: SyntaxEditorBasedCodeFixProvider
{
private readonly ISyntaxFactsService _syntaxFacts;
private readonly string _title;
protected AbstractAddObsoleteAttributeCodeFixProvider(
ISyntaxFactsService syntaxFacts,
string title)
{
_syntaxFacts = syntaxFacts;
_title = title;
}
public override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
var cancellationToken = context.CancellationToken;
var document = context.Document;
var attribute = await GetObsoleteAttributeAsync(document, cancellationToken).ConfigureAwait(false);
if (attribute == null)
{
return;
}
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var diagnotic = context.Diagnostics[0];
var node = diagnotic.Location.FindNode(cancellationToken);
var container = GetContainer(root, node);
if (container == null)
{
return;
}
context.RegisterCodeFix(
new MyCodeAction(
_title,
c => FixAsync(document, diagnotic, c)),
context.Diagnostics);
}
private static async Task<INamedTypeSymbol> GetObsoleteAttributeAsync(Document document, CancellationToken cancellationToken)
{
var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
var attribute = compilation.GetTypeByMetadataName(typeof(ObsoleteAttribute).FullName);
return attribute;
}
private SyntaxNode GetContainer(SyntaxNode root, SyntaxNode node)
{
return _syntaxFacts.GetContainingMemberDeclaration(root, node.SpanStart) ??
_syntaxFacts.GetContainingTypeDeclaration(root, node.SpanStart);
}
protected override async Task FixAllAsync(
Document document, ImmutableArray<Diagnostic> diagnostics,
SyntaxEditor editor, CancellationToken cancellationToken)
{
var obsoleteAttribute = await GetObsoleteAttributeAsync(document, cancellationToken).ConfigureAwait(false);
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var containers = diagnostics.Select(d => GetContainer(root, d.Location.FindNode(cancellationToken)))
.WhereNotNull()
.ToSet();
var generator = editor.Generator;
foreach (var container in containers)
{
editor.AddAttribute(container,
generator.Attribute(editor.Generator.TypeExpression(obsoleteAttribute)));
}
}
private class MyCodeAction : CodeAction.DocumentChangeAction
{
public MyCodeAction(string title, Func<CancellationToken, Task<Document>> createChangedDocument)
: base(title, createChangedDocument, title)
{
}
}
}
}
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Immutable
Imports System.Composition
Imports Microsoft.CodeAnalysis.AddObsoleteAttribute
Imports Microsoft.CodeAnalysis.CodeFixes
Namespace Microsoft.CodeAnalysis.VisualBasic.AddObsoleteAttribute
<ExportCodeFixProvider(LanguageNames.VisualBasic, Name:=NameOf(VisualBasicAddObsoleteAttributeCodeFixProvider)), [Shared]>
Friend Class VisualBasicAddObsoleteAttributeCodeFixProvider
Inherits AbstractAddObsoleteAttributeCodeFixProvider
Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) =
ImmutableArray.Create(
"BC40000", ' 'C' is obsolete. (msg)
"BC40008" ' 'C' is obsolete.
)
Public Sub New()
MyBase.New(VisualBasicSyntaxFactsService.Instance, VBFeaturesResources.Add_Obsolete)
End Sub
End Class
End Namespace
......@@ -102,6 +102,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.VBFeaturesResources
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Add &lt;Obsolete&gt;.
'''</summary>
Friend ReadOnly Property Add_Obsolete() As String
Get
Return ResourceManager.GetString("Add_Obsolete", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Add Overloads.
'''</summary>
......
......@@ -1250,4 +1250,7 @@ Sub(&lt;parameterList&gt;) &lt;statement&gt;</value>
<data name="If_statement_can_be_simplified" xml:space="preserve">
<value>'If' statement can be simplified</value>
</data>
<data name="Add_Obsolete" xml:space="preserve">
<value>Add &lt;Obsolete&gt;</value>
</data>
</root>
\ No newline at end of file
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="tr" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../VBFeaturesResources.resx">
<body>
<trans-unit id="Add_Obsolete">
<source>Add &lt;Obsolete&gt;</source>
<target state="new">Add &lt;Obsolete&gt;</target>
<note />
</trans-unit>
<trans-unit id="If_statement_can_be_simplified">
<source>'If' statement can be simplified</source>
<target state="new">'If' statement can be simplified</target>
......
......@@ -809,6 +809,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return node
End If
If TypeOf node Is MethodBaseSyntax AndAlso Not TypeOf node.Parent Is MethodBlockBaseSyntax Then
Return node
End If
If TypeOf node Is PropertyStatementSyntax AndAlso Not TypeOf node.Parent Is PropertyBlockSyntax Then
Return node
End If
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册