Resharper 在我不希望时连接字符串。

huangapple go评论77阅读模式
英文:

Resharper concatenates strings when I do not want it to

问题

var result = DialogService.Confirm("Save Changes?", message,
"Save" + "Discard");

第二行应该是两个参数。我希望它是这样的

"Save", "Discard");

所以我把光标放在+字符后面,然后按退格键。但是,Resharper不仅删除了+,还将这两个字符串连接成一个参数。

var result = DialogService.Confirm("Save Changes?", message,
"SaveDiscard");

这不是我想要的。我只想让退格键删除+符号。

有人知道是什么设置导致这种情况发生吗?我尝试关闭编辑器行为的所有设置,但它们都不会影响它。

我确定这是Resharper的问题,因为当我禁用它时,这种情况不再发生。

英文:

I am editing this code with Resharper enabled.

var result = DialogService.Confirm("Save Changes?", message,
    "Save" + "Discard");

The second line is supposed to be two arguments. I want it to say this

"Save", "Discard");  

So I put the cursor right after the + character and hit backspace. And instead of just removing the +, Resharper goes ahead and concatenates the two strings into one argument.

var result = DialogService.Confirm("Save Changes?", message,
    "SaveDiscard");

This is not at all what I want. I just want the backspace to remove the + symbol.

Does anyone have any idea what setting would cause this to happen? I tried turning off all the settings on Editor Behavior but none of them affected it.

I am certain it is Resharper because when I disable it, this not longer occurs.

答案1

得分: 0

R# 将在下一个版本中改进这种行为:

  1. 在字符串连接后执行撤销将提供额外的步骤,去除+字符。
  2. 一个新选项将允许完全禁用此输入辅助功能。
英文:

R# will improve this behavior in the next release:

  1. Undo after the strings get concatenated will provide an extra step with the + character removed.
  2. A new option will allow disabling this typing assist altogether.

Resharper 在我不希望时连接字符串。

Please report issues with R# directly to the development team with "ReSharper | Help | Report a bug or submit feedback".

huangapple
  • 本文由 发表于 2023年4月4日 12:02:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/75925422.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定