简体   繁体   中英

F# Interactive autocomplete

是否有任何选项可以在 VS2010 中的 F# 交互中自动完成?

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 eg in MonoDevelop. However, I think most of the people write code in the main editor, so this is not so frequent request...

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.

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

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+

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM