/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Features/CSharp/Portable/EditAndContinue/DeclarationBody/CopyConstructorDeclarationBody.cs
55 строк
2 KB
Tomáš Matoušek
Refactoring of extension methods in source packages (#78620) - take 2 (#78894)
26 июн 2025, 18:42
Не верифицирован
26 июн 2025, 18:42
05fc006
Код
Авторство
О чём код?
// 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 System; using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis.Collections; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.EditAndContinue; /// <summary> /// record [|C{T}|](int a, int b); /// </summary> internal sealed class CopyConstructorDeclarationBody(RecordDeclarationSyntax recordDeclaration) : InstanceConstructorDeclarationBody { public override bool HasExplicitInitializer => false; public override SyntaxNode? ExplicitBody => null; public override SyntaxNode? ParameterClosure => null; public override SyntaxNode? MatchRoot => null; public override SyntaxNode InitializerActiveStatement => recordDeclaration; public override TextSpan InitializerActiveStatementSpan => BreakpointSpans.CreateSpanForCopyConstructor(recordDeclaration); public override OneOrMany<SyntaxNode> RootNodes => new(recordDeclaration); public override SyntaxNode EncompassingAncestor => recordDeclaration; public override TextSpan Envelope => InitializerActiveStatementSpan; public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model) => []; public override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) => BreakpointSpans.GetActiveTokensForCopyConstructor(recordDeclaration, getDescendantTokens); public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) => []; }