How to cancel the paste when the code will automatically comment?

When I copy a method comment line, pasting it in a certain place will cause the code I pasted to be commented automatically.

Including when I copy a line of code, pasting a line after a comment, also causes the code I pasted to be automatically commented.

In 23.1 I don't remember that happening.

Mainly, I can't find the name of this feature, so I can't find the switch for this feature in the Settings.

As follows:


   /// <summary>
   /// 查询打印模板
   /// </summary>
   /// <param name="unionID"></param>
   /// <param name="clerkID"></param>
   /// <param name="printType"></param>
   /// <returns></returns>

When I copy and paste the above comment, it becomes the following situation, I have to Ctrl + Z to undo one step before it becomes normal.


   /// <summary>
   /// 查询打印模板
   /// </summary>
   /// <param name="unionID"></param>
   /// <param name="clerkID"></param>
   /// <param name="printType"></param>
   /// /// <param name="printType"></param>
   /// <returns></returns>

 

var result = await _storeDataService.GetReportsAsync(unionID, printType);

// 测试粘贴注释操作

return result.OrderBy(ob => ob.Ranking).Select(sl => new QueryPrintTemplateOutput
{
   TemplateID = sl.TemplateID, Title = sl.Title
}).ToList();

The same is true here, but there is a condition that I must paste after an existing comment on a line in order to cause my pasted code to be commented.

var result = await _storeDataService.GetReportsAsync(unionID, printType);

// 测试粘贴注释操作
// var result = await _storeDataService.GetReportsAsync(unionID, printType);

return result.OrderBy(ob => ob.Ranking).Select(sl => new QueryPrintTemplateOutput
{
   TemplateID = sl.TemplateID, Title = sl.Title
}).ToList();

 

Attached operation video!  Upload id: 2023_09_15_TfimXkqDF74yS5k933BSCQ (file: QQ录屏20230915142217.mp4)

0
3 comments

Hello,

Indeed, we've introduced some changes relevant to automatic escape on paste. For both cases you've specified we 'd reconsider the behavior and implement improvements on this matter in ReSharper 2023.3 version.

Please let me know if you have any more questions.

Thank you.

0

Hello,
     I hope this problem can be solved in the ReSharper 2023.3 version, because it is causing me too much trouble now and I need to frequently use Ctrl + Z to undo automatic comments.
    It is convenient to know when the ReSharper 2023.3 version is expected to be released.
Thank you so much!

0

Hello,

we are planning to release ReSharper 2023.3 in December, no certain dates at the moment.

I'd suggest following the issue Automatic escape when copy-pasting inside documentation comments as the fix may appear earlier in some of EAP builds.

 

0

Please sign in to leave a comment.