Visual Studio 2010 IntelliSense: Tips for F # Operators

Is it possible to get Visual Studio to display tooltips for statements?

The following image shows a tooltip for a function, but it does not work for operators.

a tooltip hint for a function

Operators usually have simple specifications like 'T -> 'T -> 'T , but such hints can be useful for custom ones.

+4
source share
2 answers

Following Daniel's suggestion, I am posting a workaround that I used for myself.
The workaround is only partially useful, and I'm still looking for the best ideas.

 let (!><) a = () let z1 = op_BangGreaterLess 5 

This code is fully valid because the operator expression generates a function with the name generated by the compiler. See this MSDN article , "Overloaded Operator Names" for a complete list of operator names.

The good news is that op_BangGreaterLess supports IntelliSense hints and also supports the Go To Definition ( F12 ) IDE command, pointing to the original statement of the operator.
The bad news is that IntelliSense does not allow you to quickly enter the full name of the operator ( Ctrl + Space ), so you need to enter the entire name manually.

+7
source

I'm afraid this is not possible (and even in Visual Studio 2012 I don't get tooltips for statements).

I suppose this can be implemented, but as you say, operators usually have simple types. When using custom operators, they should probably be simple enough so that people can use them without looking at their type (or the corresponding XML documentation). Otherwise, it would be better to use a named function.

However, if you use F # Interactive, then you can easily use this to learn the type of operator:

 > (!><);; val it : ('a -> unit) = <fun: clo@2 > 

If I cannot use F # Interactive, I usually define a simple dummy character to get IntelliSense:

 let dummy () = (!><) 

Notice that I added the unit argument to define the function and avoid the value limitation error.

+4
source

All Articles