@@ -700,7 +700,7 @@ private void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> d
700700 /// <see cref="EditKind.Move"/> or <see cref="EditKind.Reorder"/>.
701701 /// The scenarios include moving a type declaration from one file to another and moving a member of a partial type from one partial declaration to another.
702702 /// </summary>
703- internal virtual void ReportDeclarationInsertDeleteRudeEdits ( ArrayBuilder < RudeEditDiagnostic > diagnostics , SyntaxNode oldNode , SyntaxNode newNode , ISymbol oldSymbol , ISymbol newSymbol , CancellationToken cancellationToken )
703+ internal virtual void ReportDeclarationInsertDeleteRudeEdits ( ArrayBuilder < RudeEditDiagnostic > diagnostics , SyntaxNode oldNode , SyntaxNode newNode , ISymbol oldSymbol , ISymbol newSymbol , EditAndContinueCapabilities capabilities , CancellationToken cancellationToken )
704704 {
705705 // When a method is moved to a different declaration and its parameters are changed at the same time
706706 // the new method symbol key will not resolve to the old one since the parameters are different.
@@ -2787,7 +2787,7 @@ private async Task<ImmutableArray<SemanticEditInfo>> AnalyzeSemanticsAsync(
27872787 if ( oldSymbol . DeclaringSyntaxReferences . Length == 1 )
27882788 {
27892789 Contract . ThrowIfNull ( oldDeclaration ) ;
2790- ReportDeclarationInsertDeleteRudeEdits ( diagnostics , oldDeclaration , newDeclaration , oldSymbol , newSymbol , cancellationToken ) ;
2790+ ReportDeclarationInsertDeleteRudeEdits ( diagnostics , oldDeclaration , newDeclaration , oldSymbol , newSymbol , capabilities , cancellationToken ) ;
27912791
27922792 if ( IsPropertyAccessorDeclarationMatchingPrimaryConstructorParameter ( newDeclaration , newContainingType , out var isFirst ) )
27932793 {
@@ -2822,7 +2822,7 @@ private async Task<ImmutableArray<SemanticEditInfo>> AnalyzeSemanticsAsync(
28222822
28232823 // Compare the old declaration syntax of the symbol with its new declaration and report rude edits
28242824 // if it changed in any way that's not allowed.
2825- ReportDeclarationInsertDeleteRudeEdits ( diagnostics , oldDeclaration , newDeclaration , oldSymbol , newSymbol , cancellationToken ) ;
2825+ ReportDeclarationInsertDeleteRudeEdits ( diagnostics , oldDeclaration , newDeclaration , oldSymbol , newSymbol , capabilities , cancellationToken ) ;
28262826
28272827 var oldBody = TryGetDeclarationBody ( oldDeclaration ) ;
28282828 if ( oldBody != null )
@@ -4395,9 +4395,10 @@ private void AddConstructorEdits(
43954395 ReportMemberBodyUpdateRudeEdits ( diagnostics , newDeclaration , firstSpan ) ;
43964396 }
43974397
4398- // When explicitly implementing the copy constructor of a record the parameter name must match for symbol matching to work
4399- // TODO: Remove this requirement with https://github.com/dotnet/roslyn/issues/52563
4400- if ( oldCtor != null &&
4398+ // When explicitly implementing the copy constructor of a record the parameter name if the runtime doesn't support
4399+ // updating parameters, otherwise the debugger would show the incorrect name in the autos/locals/watch window
4400+ if ( ! capabilities . HasFlag ( EditAndContinueCapabilities . UpdateParameters ) &&
4401+ oldCtor != null &&
44014402 ! isPrimaryRecordConstructor &&
44024403 oldCtor . DeclaringSyntaxReferences . Length == 0 &&
44034404 newCtor . Parameters . Length == 1 &&
0 commit comments