/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Analyzers/Core/CodeFixes/UseConditionalExpression/UseConditionalExpressionHelpers.cs
31 строка
1 KB
Cyrus Najmabadi
Update features to use file scoped namespaces
28 фев 2024, 00:26
28 фев 2024, 00:26
4262648
Код
Авторство
О чём код?
// 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. using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.LanguageService; using static Microsoft.CodeAnalysis.UseConditionalExpression.UseConditionalExpressionHelpers; namespace Microsoft.CodeAnalysis.UseConditionalExpression; internal static class UseConditionalExpressionCodeFixHelpers { public static readonly SyntaxAnnotation SpecializedFormattingAnnotation = new(); public static SyntaxRemoveOptions GetRemoveOptions( ISyntaxFactsService syntaxFacts, SyntaxNode syntax) { var removeOptions = SyntaxGenerator.DefaultRemoveOptions; if (HasRegularCommentTrivia(syntaxFacts, syntax.GetLeadingTrivia())) { removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; } if (HasRegularCommentTrivia(syntaxFacts, syntax.GetTrailingTrivia())) { removeOptions |= SyntaxRemoveOptions.KeepTrailingTrivia; } return removeOptions; } }