/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Features/VisualBasic/Portable/CodeRefactorings/RemoveStatementCodeAction.vb
35 строк
1 KB
dotnet-bot
FixAll in solution for IDE0051 (Remove unused private members) - VB projects
16 апр 2020, 03:39
16 апр 2020, 03:39
7923431
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.CodeActions Namespace Microsoft.CodeAnalysis.VisualBasic.CodeActions Friend Class RemoveStatementCodeAction Inherits CodeAction Private ReadOnly _document As Document Private ReadOnly _node As SyntaxNode Private ReadOnly _title As String Public Sub New(document As Document, node As SyntaxNode, title As String) Me._document = document Me._node = node _title = title End Sub Public Overrides ReadOnly Property Title As String Get Return _title End Get End Property Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document) Dim root = Await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(False) Dim updatedRoot = root.RemoveNode(_node, SyntaxRemoveOptions.KeepUnbalancedDirectives) Return _document.WithSyntaxRoot(updatedRoot) End Function End Class End Namespace