如何使ReSharper的格式线包裹三元运营商以下列方式 [英] How to make Resharper format line-wrapped ternary operators in the following way

查看:119
本文介绍了如何使ReSharper的格式线包裹三元运营商以下列方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的想ReSharper的格式化我行素裹ternaries这样

I really want Resharper to format my line-wrapped ternaries in this way

return
    navigator.IsTerminating ?
    navigator.Context :
    navigator.Context.GetSimulatableRelative(new Navigator(navigator));



任何人都可以在这方面帮助?

Can anyone help with this?

推荐答案

我不认为有一个出这样做的箱子方式。我知道,影响R·格式的代码是如何通过这些设置的唯一方式:

I don't think there is an out of the box way of doing this. The only way i know to influence how R# formats code is through these settings:

ReSharper的 - >选项 - >汉语语言 - > C# - >格式样式

Resharper --> Options... --> Langauges --> C# --> Formatting Style

这不会让你尽管写自己的自定义格式规则。

This doesn't allow you to write your own custom formatting rules though.

如果你觉得自己是一个挑战,那么你可以编写一个插件。有一些文档和SDK:

If you feel like a challenge then you could write a plugin. There is some docs and an SDK:

  • Developer Docs
  • SDK
  • A video tutorial

这篇关于如何使ReSharper的格式线包裹三元运营商以下列方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆