F# Visual Power Tools doesn't work

泄露秘密 提交于 2019-12-10 17:23:51

问题


I'm trying to work with F#. For all projects in VS2015 solution i want to have similar code style. I have installed Visual F# Power Tools and setted formatting configuration to:

According to this configuration (space after comma) the following code:

fun unit ->Log.Information( "Found: {category}\\{name}\\{instance}",category,name,instance )

should be converted to:

fun unit ->Log.Information( "Found: {category}\\{name}\\{instance}", category, name, instance )

But when i'm trying to format documment by pressing Edit->Advanced->Format Document nothing happend.

How to format my code?

Update 1

When i try to format the code i receive Validation after formatting failed. The original content is preserved. message: I tried to search about this problem, and found this issue. May be some one faced with such problem and know how to fix it?


回答1:


Try using namespaces. Below code does not format:

module Deck
type Color = 
    | Red
    | Green
    | Blue
    | Yellow

However, next one formats correctly

namespace Dummy

    module Deck = 
        type Color = 
            | Red
            | Green
            | Blue
            | Yellow


来源:https://stackoverflow.com/questions/41201311/f-visual-power-tools-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!