我正在尝试与 F#
合作.对于 VS2015
中的所有项目解决方案我想要类似的代码风格。我已安装 Visual F# Power Tools并将格式化配置设置为:
根据此配置(逗号后的空格)以下代码:
fun unit ->Log.Information( "Found: {category}\\{name}\\{instance}",category,name,instance )
应转换为:
fun unit ->Log.Information( "Found: {category}\\{name}\\{instance}", category, name, instance )
但是当我尝试通过按
Edit->Advanced->Format Document
来格式化文档时什么也没发生。如何格式化我的代码?
更新 1
当我尝试格式化代码时,我收到
Validation after formatting failed. The original content is preserved.
信息:我试着搜索这个问题,发现this issue .
可能有人面临这样的问题并知道如何解决它?
最佳答案
尝试使用命名空间。下面的代码没有格式化:
module Deck
type Color =
| Red
| Green
| Blue
| Yellow
但是,下一个格式正确
namespace Dummy
module Deck =
type Color =
| Red
| Green
| Blue
| Yellow
关于visual-studio - F# Visual Power Tools 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41201311/