Visual Studio for F#中的代码折叠

编程入门 行业动态 更新时间:2024-10-23 09:38:39
本文介绍了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#中的代码折叠

本文发布于:2023-11-15 23:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1598999.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:代码   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!