Visual Studio 2010 IntelliSense:有关F#运算符的提示 [英] Visual Studio 2010 IntelliSense: hints on F# operators

查看:136
本文介绍了Visual Studio 2010 IntelliSense:有关F#运算符的提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使Visual Studio在操作员上显示工具提示?

Is it possible to make Visual Studio to display tooltips on operators?

下图演示了功能的工具提示,但不适用于操作员.

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

运算符通常具有简单的类型规范,例如'T -> 'T -> 'T,但此类提示对自定义提示很有用.

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

推荐答案

根据丹尼尔(Daniel)的建议,我发布了一个我一直在使用的解决方法.
解决方法仅部分有用,我仍在寻找更好的主意.

Following Daniel's suggestion, I'm posting a workaround that I've been using for myself.
The workaround is only partially helpful, and I'm still looking for any better ideas.

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

此代码完全有效,因为运算符表达式使用编译器生成的名称生成函数.请参阅此MSDN文章的重载的操作员名称"部分,以获取有关以下内容的完整列表:运算符名称.

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

好消息是,op_BangGreaterLess支持IntelliSense提示,它还支持IDE的转到定义"( F12 )命令,指向原始的操作员声明.
坏消息是IntelliSense不允许快速输入操作员全名( Ctrl + Space ),因此您必须手动键入整个名称.

Good news is that op_BangGreaterLess supports IntelliSense hints and it also supports "Go to Definition" (F12) command of IDE, pointing to an original operator declaration.
Bad news is that IntelliSense does not allow rapid entry of the full operator name (Ctrl+Space), so you have to type the entire name manually.

这篇关于Visual Studio 2010 IntelliSense:有关F#运算符的提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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