F# Interactive autocomplete

蹲街弑〆低调 提交于 2019-12-10 12:45:01

问题


Is there any option of getting auto-completion in F# interactive in VS2010?


回答1:


There is a visual studio extension here: https://github.com/vlasenkoalexey/FSharp.Interactive.Intellisense

It doesn't work as good as the c# interactive intellisense but it can be a good start.




回答2:


No. The best way to write code interactively in F# is to create a new script file and write all code in the script file (where you get all the autocompletion and background type checking). Then you just select code and hit Alt+Enter to evaluate it in F# Interactive window.

The F# service running in Visual Studio has a method that returns declarations (see source code), so it would be possible to add IntelliSense to F# Interactive e.g. in MonoDevelop. However, I think most of the people write code in the main editor, so this is not so frequent request...




回答3:


Aleksey Vlasenko made F# Interactive Intellisense for VS2013 and VS2015. It knows about any variables/functions you create in FSI. My biggest gripe is that it doesn't display documentation or the type signatures




回答4:


Well, you get autocompletation by pressing TAB key.

open S[TAB] will write System and so on

It should be ON by default.

For more info see:

fsi.exe --help

or run

fsi.exe --readline+




回答5:


VS 2015, Community edition

No autocomplete in the console, but more annoying no reliable autocomplete in the editor.

The only way that seems to remotely work is to actually have a .fs instead of .fsx in another project and set-up the dependencies, this way F12 to navigate to the rest of your solution works, and you get the same level of auto-complete etc that the other projects.

Don't forget to comment or exclude the new project before you compile, otherwise you might have some possibly dangerous scripts executing out of nowhere..

Interestingly C# interactive, which is a total copy of F# interactive has auto-complete. So it seems a bit far fetched, but at some point - if C# interactive starts to resemble like something usable, maybe use it on your F# project and be done with the frustration.



来源:https://stackoverflow.com/questions/5619033/f-interactive-autocomplete

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