-
Notifications
You must be signed in to change notification settings - Fork 127
Conversation
Relevance parameter has been taken into account when sorting code completion proposals.
@@ -91,7 +91,6 @@ public void accept(CompletionProposal proposal) | |||
case CompletionProposal.LOCAL_VARIABLE_REF: | |||
case CompletionProposal.VARIABLE_DECLARATION: | |||
case CompletionProposal.ANNOTATION_ATTRIBUTE_REF: | |||
case CompletionProposal.POTENTIAL_METHOD_DECLARATION: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reasoning behind this removal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the
if (proposal.getKind() != CompletionProposal.POTENTIAL_METHOD_DECLARATION)
statement, this case is useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I was just looking at the diff. Makes sense after looking beyond that.
@@ -55,6 +55,10 @@ public int compare(CodeCompleteResult o1, CodeCompleteResult o2) | |||
return -1; | |||
} | |||
|
|||
if (o1.getRelevance() != o2.getRelevance()) { | |||
return o2.getRelevance() - o1.getRelevance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nitpick, but eclim code uses 2 spaces for indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I will change my editor settings.
@@ -185,6 +184,9 @@ protected CodeCompleteResult createCompletionResult( | |||
// of whether the user ever views it. | |||
/*return new CodeCompleteResult( | |||
kind, completion, menu, proposal.getAdditionalProposalInfo());*/ | |||
return new CodeCompleteResult(completion, menu, menu, type, offset); | |||
CodeCompleteResult result = new CodeCompleteResult(completion, menu, menu, type, offset); | |||
result.setRelevance(proposal.getRelevance()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting the completions by relevance should be an option (new command argument) since this will have an adverse affect on vim's code completion mechanism which, unfortunately, works best with completions that are sorted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my experience with eclim, it is hard to find an item in autocomplete if it is in the same package. With this option, autocomplete order becomes the same with Eclipse and it is easier to use IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide an example? I'm not saying that there shouldn't be an option to sort by relevance, but it should be just that, an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will provide some screenshots as soon as possible.
@@ -66,7 +66,7 @@ public Object execute(final CommandLine commandLine) | |||
if(COMPACT.equals(layout) && results.size() > 0){ | |||
results = compact(results); | |||
} | |||
Collections.sort(results); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to affect completion for all eclim supported languages here or were you hoping to just affect the java completions? This breaks quite a few unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to change for Java. If it breaks tests, I will re-add the line.
- To enable the eclim client to sort the proposals according to their relevance the relevance field is set. - The relevance field is not passed along when using compact mode -> fixed. This commit is a subset of the commit made for 'Autocomplete relevance ervandew#474'.
- To enable the eclim client to sort the proposals according to their relevance the relevance field is set. - The relevance field is not passed along when using compact mode -> fixed. This commit is a subset of the commit made for 'Autocomplete relevance ervandew#474'.
Relevance parameter has been taken into account when sorting code
completion proposals.