问题描述
首先,我终于做出了这样一个wiki,但我相信一个简单,简单的答案是非常可取的,特别是因为其结果将定义为大家统一的IDE行为。更多关于简单的版本。
在过去,我的博客上讲述这意味着什么有一个良好乖成员选择降下来了。如果你还没有看过,现在就这样做。 :)
Visual Studio 2010中增加了新的功能,智能感知选择过程,使事情......没那么容易。我相信,有伟大的力量,我们可以从这些功能利用,但没有设置控制的洁净规则这将是非常困难的。
在你回答之前,记住这一点:的规则应该允许一个人中调的系统作为智能感知力优势更少的击键和更少的时间比其他解决方案提供。这是的没有的只是你已经习惯了 - 如果你使用一个系统,长期和频繁的像我一样,重新学习模式是微不足道的旁边保存有它后面有算法的时间
下面是控制轴:
- 过滤:全列表中包含了每一个标识符或关键字在当前位置不准,不考虑部分键入的文本光标在
- 排序:我们(至少在Visual Studio的用户)用于将成员选择下拉被按字母顺序排序。其他的可能性是被一些概念相关性等部分的排序。
- 的选择:最佳匹配基于当前输入的文本,我们要选择一个项目的能力选择状态为:
- 在没有项目中选择
- 在被动的选择:列出一个项目,而是pressing
<空>
或类似韩元。 'T填补它,而无需使用箭头键,使之: - 主动选择:一个项目选择,除非
Esc键
或箭头键是pressed,一个<空>
,等会自动完成的项目
我的previous一套规则限制的操作来选择轴。他们考虑到了:
- 键入的匹配与
StartsWith
操作列表中的项目(preFIX配套),与变种的比赛是否区分大小写。 - previous完井具有相同的字符集的开始。
以下是另外提供的和潜在有用的,但不是所有的都可以使用:
- 在驼峰匹配或underscore_separation(我们):长,前pressive标识?不是一个问题。
- 子字符串匹配:长prefixes阻碍您的选择速度?不是一个问题。
- 在摘要文本,其中可提供信息:我靠一靠,但我必须承认它派上用场,在Firefox地址栏中,所以你永远不知道
为了你写的应该解决的轴规则(粗体以上)。在关于这个问题我的previous职位,规则很简单,但在另外的考虑因素将可能使这个有点复杂。
- 筛选
- 排序
- 选择
只是一个加法或备注...
智能感知要适应环境。在Visual Studio中的情况下,地方可以仅使用子类型的特定类型或接口,下拉列表应该过滤由这些
IList的列表=新(下拉所有执行IList的类型) - 不是所有可能的类型
First of all, I finally made this a wiki, but I believe a "simple," straightforward answer is highly desirable, especially since the result would define a unified IDE behavior for everyone. More on the simple later.
In the past, I've blogged about what it means to have a well-behaved member selection drop down. If you haven't read it, do so now. :)
Visual Studio 2010 adds new features to the IntelliSense selection process that makes things ... not so easy. I believe there's great power we can harness from these features, but without a clean set of governing rules it's going to be very difficult.
Before you answer, remember this: The rules should allow someone "in tune" with the system to take advantage of the IntelliSense power with fewer keystrokes and less time than other solutions provide. This is not just about what you're used to - If you use a system as long and frequently as I do, relearning the patterns is trivial next to the time it saves to have a great algorithm behind it.
Here are the controllable axes:
- Filtering: A "full" list contains every identifier or keyword allowed at the current location, without regard for the partially typed text the cursor is within.
- Sorting: We (at least Visual Studio users) are used to the member selection drop down being sorted in alphabetical order. Other possibilities are partial sorting by some notion "relevance," etc.
- Selection: Based on the currently typed text, we have the ability to select one item as the "best match." Selection states are:
- No item selected
- Passive selection: one item outlined, but pressing
.
,<space>
or similar won't fill it in without using an arrow key to make it: - Active selection: one item selected, and unless
Esc
or an arrow key is pressed, a.
or<space>
, etc will auto-complete the item.
My previous set of rules restricted the manipulation to the selection axis. They took into account:
- Characters typed as matched against list items with a
StartsWith
operation (prefix matching), with variants for whether the match was case-sensitive. - Previous completions that started with the same set of characters.
The following are additionally available and potentially useful, but not all have to be used:
- CamelCase matches or underscore_separation ("us"): Long, expressive identifiers? Not a problem.
- Substring matches: long prefixes hindering your selection speed? Not a problem.
- Information available in the summary text, where available: I lean against this but I must admit it's come in handy in the Firefox address bar, so you never know.
The rules you write should address the axes (in bold above) in order. In my previous posts on the subject, the rules were very simple, but the additional considerations will likely make this a bit more complicated.
- Filtering
- Sorting
- Selection
Just one addition or remark ...
IntelliSense should adapt to the context. In the case of Visual Studio, places where only subtypes of a specific type or interface may be used, the dropdown list should filter by these.
IList list = new (Drop down all the types implementing IList) - not all possible types!
这篇关于智能感知规则&QUOT;获得最佳匹配QUOT;在成员选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!