代码清理在内插字符串中添加空格

Code cleanup adds spaces in interpolated strings

提问人:xkk 提问时间:10/17/2023 更新时间:10/18/2023 访问量:74

问:

我在 Resharper 代码清理方面遇到了问题,事实证明,我的编辑器配置中存在一些冲突/设置,导致在插值文本中添加空格,从而破坏了结果。该问题不会在 Rider 中发生,但也不太可能与 VS 中的代码清理(将其关闭)有关。 有没有人可能遇到过这样的问题,或者知道在不完全放弃自动格式化的情况下摆脱它的设置? 干杯

BeforeAfterCodeCleanUp

这是我的编辑器配置的一部分:

resharper_space_in_singleline_accessorholder = false
resharper_space_in_singleline_anonymous_method = false
resharper_space_in_singleline_method = false
resharper_space_near_postfix_and_prefix_op = false
resharper_space_within_array_initialization_braces = false
resharper_space_within_array_rank_empty_parentheses = false
resharper_space_within_array_rank_parentheses = false
resharper_space_within_attribute_angles = false
resharper_space_within_checked_parentheses = false
resharper_space_within_default_parentheses = false
resharper_space_within_empty_braces = false
resharper_space_within_empty_initializer_braces = false
resharper_space_within_empty_invocation_parentheses = false
resharper_space_within_empty_method_parentheses = false
resharper_space_within_empty_template_params = false
resharper_space_within_expression_parentheses = false
resharper_space_within_initializer_braces = false
resharper_space_within_invocation_parentheses = false
resharper_space_within_method_parentheses = false
resharper_space_within_nameof_parentheses = false
resharper_space_within_new_parentheses = false
resharper_space_within_parentheses = false
resharper_space_within_single_line_array_initializer_braces = false
resharper_space_within_sizeof_parentheses = false
resharper_space_within_template_args = false
resharper_space_within_template_params = false
resharper_space_within_tuple_parentheses = false
resharper_space_within_typeof_parentheses = false
resharper_space_within_type_argument_angles = false
resharper_space_within_type_parameter_angles = false
resharper_space_within_type_parameter_parentheses = false
C# Resharper 代码清理

评论

0赞 stuartd 10/17/2023
为此提出问题似乎是一个合理的想法。

答:

2赞 truefar 10/18/2023 #1

这恰好是一个已知问题 - 原始字符串文字格式应该已经在 ReSharper 2022.3 版本中修复。您能否检查一下您使用的是此版本还是更新版本?