2017-04-13 53 views
2

我有F#的项目,我正在研究VisualStudio2017。我试图重构代码并使用内联,但是这个菜单项不可用。另外,当我点击重命名什么也没有发生。VisualStudio 2017重构不适用于F#

  • 为什么不可用?
  • 如何强制重构操作才能正常工作?

enter image description here

let blobToBlobWithInfo (b:IListBlobItem) = 
    try 
     let blobUri = b.Uri.ToString() 
     let blobUriParts = blobUri.Split '/' 
     let t = Array.length blobUriParts 
     let integrationName = blobUriParts.[t-2] 
     if(integrationName <> "LogsToBlobService") then 
      let logTime = new System.DateTime(System.Int32.Parse <| blobUriParts.[t-1].Substring(0,4), System.Int32.Parse <|blobUriParts.[t-1].Substring(4,2), System.Int32.Parse <|blobUriParts.[t-1].Substring(6,2)) 
      Some((b,integrationName,logTime)) 
     else 
      None 
    with 
     | :? System.ArgumentException -> None 
     | _ -> None 

回答

3

这是在Visual Studio中的一个已知问题2017

将固定在更新2

它在这GitHub issue证实。

2

Resharper的重构还是VS2017的正确?如果您只是想重命名,您可以将Visual F#Tools更新至myget的最新版本(将包含在答案中引用的VS更新中):
https://github.com/Microsoft/visualfsharp/wiki/Using-Nightly-Releases-of-the-Visual-F%23-Tools

例如重命名的CSV CSV2在线:用最新版本的VF#工具

enter image description here

enter image description here

更新:

enter image description here

您也可以下载它从这里: https://dotnet.myget.org/feed/fsharp/package/vsix/VisualFSharp

+0

视觉F#工具不支持的Visual Studio 2017年在这一刻 >作品使用Visual Studio 2013,2015年 https://marketplace.visualstudio.com/items?itemName=FSharpSoftwareFoundation.VisualFPowerTools – burzhuy

+0

@burzhuy你没有错,但那是旧的Visual F#Power Tools。这已贬值。现在,F#工具已内置到VS2017中。但是,由于VS2017 RTW的代码冻结,您获得的版本有点旧。因此,您应该启用myget feed并安装VS F#Tools的最新版本。我将添加我的版本的屏幕截图。 – s952163

+1

谢谢,但答案仅适用于50%!尽管如此,upvote给你!我已经更新了F#电动工具,但重命名是现在正在工作的唯一一项操作。 'inline'is stil unavailable。 – burzhuy