为什么不能在F#项目中添加子文件夹? [英] Why can't I add a subfolder in a F# project?

查看:86
本文介绍了为什么不能在F#项目中添加子文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大多数.NET项目中,我可以使用文件夹来组织代码文件.在C ++中,我做不到,但是过滤器最终扮演了相同的角色.但是,在带有Visual Studio 2010的F#中,我不能.每个代码文件都直接显示在项目目录中.为什么此功能不可用?

In most .NET project I can use folder to organise the code files. In C++, I can't, but filters end up playing the same role. However, in F# with Visual Studio 2010, I can't. Every code file is shown directly in the project dir. Why is this feature not available?

组织具有大量文件的项目的最佳策略是什么?

And what is the optimal strategy for organizing a project with a lot of files?

推荐答案

实际上,您可以将文件夹添加到F#项目中,但是Visual Studio不直接支持该文件夹(您必须自己编辑项目文件):答案).

Actually, you can add folders to F# projects but it's not supported directly through Visual Studio (you have to edit the project file yourself): http://fsprojectextender.codeplex.com/ (edit: old link was broken, updated to F# Project Extender home page which has links to the original blog posts which were moved) (which I found in this answer).

我自己做这个,但它很麻烦,您最终避免这样做,直到保持理智真正需要它为止.我认为该功能只是简单地滑落了,或者也许首先没有F#设计人员的文件夹组织文化.您可以在F#源代码中看到它们偏爱没有目录的大型源文件,并且使用单独的项目作为组织边界.

I do this myself, but it is cumbersome and you end up avoiding it until keeping sanity really demands it. I think the feature simply slipped, or perhaps there wasn't as much a culture for folder organization with the F# designers in the first place. You can see in the F# source code that they favor huge source files with no directories, with separate projects as an organization boundary.

我想可以修改F#项目模板以支持此功能,这当然是我希望看到的事情.同时,F#强制执行线性编译顺序会使您的代码有些自组织,因此文件夹分组的作用不那么重要.

I imagine the F# project template could be modified to support this, and it is certainly something I'd like to see happen. At the same time the linear compilation order F# enforces causes your code to be somewhat self-organized, and so folder grouping plays a less significant role.

这篇关于为什么不能在F#项目中添加子文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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