Allow matching on partial words combined with camel case for autocompletion (Resharper style) #3

Open
opened 2014-05-22 20:21:05 -05:00 by RedwoodForest · 1 comment
RedwoodForest commented 2014-05-22 20:21:05 -05:00 (Migrated from github.com)

I'm a user of https://github.com/lukebuehler/CShell which uses AvalonEdit for code completion. I originally filed this at https://github.com/lukebuehler/CShell/issues/25 but am refiling it here.

I'd like it if code completion allowed on matching within a word combined with the camel case completion. For example if I want DateTime I could enter dt, see that there are still a lot of types that match dt via camel case completion and continue on to type dtime, which will filter the list down to just a couple choices, one of which is DateTime.

This idea is heavily based on my use of Resharper which allows this sort of query.

One approach to this would be:

  1. The first letter of the query must match the first letter of any word in the text.
  2. Each subsequent letter of the query must match either the next letter in the text or the first letter of the next word in the text.

This could alternately require the query to match starting at the beginning of the text by changing 1. to:

  1. The first letter of the query must match the first letter in the text.
I'm a user of https://github.com/lukebuehler/CShell which uses AvalonEdit for code completion. I originally filed this at https://github.com/lukebuehler/CShell/issues/25 but am refiling it here. I'd like it if code completion allowed on matching within a word combined with the camel case completion. For example if I want `DateTime` I could enter `dt`, see that there are still a lot of types that match `dt` via camel case completion and continue on to type `dtime`, which will filter the list down to just a couple choices, one of which is `DateTime`. This idea is heavily based on my use of Resharper which allows this sort of query. One approach to this would be: 1. The first letter of the query must match the first letter of any word in the text. 2. Each subsequent letter of the query must match either the next letter in the text or the first letter of the next word in the text. This could alternately require the query to match starting at the beginning of the text by changing 1. to: 1. The first letter of the query must match the first letter in the text.
dgrunwald commented 2015-05-03 13:31:47 -05:00 (Migrated from github.com)

AvalonEdit already has some logic that makes cct match camelCaseText.

I think these kind of smart matching strategies will end up being language-dependent if done properly. AvalonEdit should expose a callback so that user code can override the built-in matching strategy.

AvalonEdit already has some logic that makes `cct` match `camelCaseText`. I think these kind of smart matching strategies will end up being language-dependent if done properly. AvalonEdit should expose a callback so that user code can override the built-in matching strategy.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-icsharpcode/AvalonEdit#3
No description provided.