Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] [DISCUSS] Solution about snipmatch's search result display module

Hi Chen,

Doug and I spent lots of time exploring different options for displaying and navigating through search results, including Eclipse's content assist. We came to the conclusion that content assist was built for a very specific type of workflow - that of traditional snippet insertion. i.e., the one you described in #2. Here are what we consider to be the major problems with using content assist for SnipMatch:
  • SnipMatch allows for the input of simple phrases, and is sensitive to grammatic structure. Content assist uses keywords, and for a good reason: it does not use a separate input box. The user just types in a keyword directly in the code, and content assist will evaluate that. This would not work for SnipMatch, since things like auto-completion and syntax highlighting could mess up the query before it is completed.
  • As you already mentioned, content assist does not allow inline specification of arguments. Instead, it expands a keyword into a snippet with dummy arguments that are intelligently substituted with local variables and such. All editing happens after the fact. To resort to this would defeat the entire purpose of using SnipMatch, rendering it nothing more than a crowd-sourced Eclipse snippet database. To think about this from the end-user perspective: If I type "move fileName to targetFolder", the inserted snippet should already be filled in with the proper arguments. Otherwise, the user would have to parse the inserted code to see the "role" that each dummy argument plays. This is a step that SnipMatch aims to remove.

As for live updating of code, I personally do not think it is necessary to show it right in the Java Editor, but there should be some way for the user to see how the code will look like while browsing through all the search results. You could show this in a preview pane or something, but I definitely think *some* kind of preview should be made easily accessible.

Hope that helps!

Zi

On 24 March 2012 01:02, Chen Cheng <chengchendoc@xxxxxxxxx> wrote:
Hi Marcel & Doug,

Zi, if you are listening, please let us know your idea. Doug told us you are the UI expert :-)

After the whole nignt's survey job, i think if we just use JDT's content assist and javaCompletionProposalComputer extend point to display the search result for SnipMatch, there are several problems (If there is anything wrong with my idea, let me know):

1. Where to input search key words?

Content assist does not supply a text input box etc for us to input search key word, Usually it will use current editor's context to get completion proposals. So if we just use JDT's content assist solution, how about always use *current line* in editor as search key for snipmatch ?

2. How to input the arguments for the search result?

I did not found any extend point to add this step for JDT's content assist. I think may be we can just use some dummy arguments, once user press ENTER, insert the code snippet with dummy arguments into the editor. User can change the arguments in the editor.

3. When i select candidate search result items by UP and DOWN key, should the content in Java editor change ? 

In my experience, all the editors(such as Java, HTML, XML editors) does not have this *real time* change feature. They just insert the target codes into the editor after you press ENTER. Before that, they will not insert the candidate codes into the editor and change along with your selection change. Maybe i ma wrong, if you guys have good solution, please tell me.

--
Best Regards From Cheng Chen [chengchendoc@xxxxxxxxx]

_______________________________________________
recommenders-dev mailing list
recommenders-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/recommenders-dev



Back to the top