Visual Studio for F#中的代码折叠 [英] code folding in Visual Studio for F#

查看:125
本文介绍了Visual Studio for F#中的代码折叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现我倾向于用F#编写较长的源文件. F#中的一些开源项目也有很长的源文件,例如FPersec和F#for excel.

I find that I tend to write long source files in F#. Some open source projects in F# also have long source files, e.g. FPersec and F# for excel.

因此,如果在VS中为F#提供代码折叠(甚至非常有限的支持),这将非常有帮助.例如.在一个模块中,我们可以折叠稳定的功能,只保留可能发生变化的功能.

So it would be very helpful if code folding (even very limited support) is available in VS for F#. E.g. in a module, we can fold out functions that are stable, only leave functions that are subject to change unfold.

此功能是否易于支持,例如由第三方供应商提供?

Is this feature easy to be supported, e.g. by a third party vendor?

推荐答案

不幸的是,此功能在F#中不可用(既#region也不折叠,例如let绑定或type声明,如C#).

Unfortunately, this feature is not available in F# (neither #region, nor folding of, for example, let bindings or type declarations as in C#).

我也很想在F#的未来版本中看到这一点-实际上,我在MSR实习期间曾尝试编写此功能的原型,但是(比)最初看起来要困难得多,因此代码从未达到生产质量,在VS 2010发行之前,F#团队需要集中精力处理很多重要的事情...

I would also love to see this in future versions of F# - in fact, I tried writing a prototype of this feature during my internship at MSR, but it was (sadly) more difficult than it looked at first, so the code never reached the production quality and there were many far more important things that the F# team needed to focus on before the VS 2010 release...

关于第三方支持-如果可以将代码折叠实现为现有F#语言服务的补充,那么应该可以(只需通过查找一些特殊注释,例如(* #region Some name*)),但是我无法100%确定是否可以通过某些插件或宏添加.

Regarding third party support - If it is possible to implement code folding as an addition to the existing F# language service, then it should be possible (simply by looking for some special comments such as (* #region Some name*)), but I'm not 100% sure if that can be added by some plugin or macro.

这篇关于Visual Studio for F#中的代码折叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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