F# Interactive autocomplete

2019-06-16 07:35发布

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

5条回答
Juvenile、少年°
2楼-- · 2019-06-16 08:08

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.

查看更多
Rolldiameter
3楼-- · 2019-06-16 08:12

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+

查看更多
The star\"
4楼-- · 2019-06-16 08:14

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

查看更多
冷血范
5楼-- · 2019-06-16 08:18

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.

查看更多
你好瞎i
6楼-- · 2019-06-16 08:25

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...

查看更多
登录 后发表回答