Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] what would be the best area to filter the doubles out of the completion engine?

Hi Johan,

You are right.Such method has CompletionProposal class. This class
instances are returned from completion engine. And you could filter
duplicates from ScriptCompletionProposalCollector.isFiltered() method
(JavaScriptCompletionProposalCollector for java script).

Best regards,
Andrei Sobolev.
> There is no such thing as getName()
>
> also the sorted does it also by getDisplayName or getSortString if it
> is from a specific type.
>
> for example ScriptMethodCompletionProposal only does internally has
> the displayName..
> And the general interface ICompletionProposal or
> IScriptCompletionProposal dont have anything else then getDisplayName
>
> johan
>
>
> On Mon, Apr 21, 2008 at 12:46 PM, Andrei Sobolev
> <andrei.sobolev@xxxxxxxxx <mailto:andrei.sobolev@xxxxxxxxx>> wrote:
>
>     Hi Johan,
>
>     I suppose this is just a bug. I've fixed it and commited.
>     Also I suppose you need to filter them using
>     CompletionProposal.getName() as unique identifier but not by label.
>
>     Best regards,
>     Andrei Sobolev.
>     > i am looking at it so what i did was quickly put it by display
>     name in
>     > a map
>     > But to my surprise this didnt work because for a override method
>     > proposal the name is padded with some empty spaces..
>     > So i guess thats there for a reason but why?
>     > see JavaScriptCompletionProposalLabelProvider
>     > you have there 2 kind of methods.. almost exactly the same except:
>     >
>     > nameBuffer.append(")  "); //$NON-NLS-1$
>     >
>     > So why is that?
>     >
>     > On Mon, Apr 21, 2008 at 11:16 AM, Andrei Sobolev
>     > <andrei.sobolev@xxxxxxxxx <mailto:andrei.sobolev@xxxxxxxxx>
>     <mailto:andrei.sobolev@xxxxxxxxx
>     <mailto:andrei.sobolev@xxxxxxxxx>>> wrote:
>     >
>     >     Hi Johan,
>     >
>     >     For Tcl I have same problem in some cases.
>     >     I've filter duplicates in completion engine itself, because more
>     >     information are available at completion time.
>     >
>     >     For Javascript case I suppose using of
>     filterAndSortProposals() method
>     >     is a good decision.
>     >
>     >     Best regards,
>     >     Andrei Sobolev.
>     >     > In javascript i constantly see double method names in the code
>     >     completion
>     >     > This is because i get 1 as a Method Declaration and
>     another as a
>     >     > Method Reference.
>     >     > Both have the same name in the end but the are in the
>     internal sets
>     >     > and lists as 2 different kind of things.
>     >     > The S
>     >     >     protected List filterAndSortProposals(List proposals,
>     >     >             IProgressMonitor monitor,
>     ContentAssistInvocationContext
>     >     > context) {
>     >     >
>     >     >
>     >    
>     ProposalSorterRegistry.getDefault().getCurrentSorter().sortProposals(
>     >     >                 context, proposals);
>     >     >         return proposals;
>     >     >     }
>     >     >
>     >     > would be a good place i think to first filter for doubles?
>     >     >
>     >     > johan
>     >     >
>     >     >
>     >    
>     ------------------------------------------------------------------------
>     >     >
>     >     > _______________________________________________
>     >     > dltk-dev mailing list
>     >     > dltk-dev@xxxxxxxxxxx <mailto:dltk-dev@xxxxxxxxxxx>
>     <mailto:dltk-dev@xxxxxxxxxxx <mailto:dltk-dev@xxxxxxxxxxx>>
>     >     > https://dev.eclipse.org/mailman/listinfo/dltk-dev
>     >     >
>     >
>     >     _______________________________________________
>     >     dltk-dev mailing list
>     >     dltk-dev@xxxxxxxxxxx <mailto:dltk-dev@xxxxxxxxxxx>
>     <mailto:dltk-dev@xxxxxxxxxxx <mailto:dltk-dev@xxxxxxxxxxx>>
>     >     https://dev.eclipse.org/mailman/listinfo/dltk-dev
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > dltk-dev mailing list
>     > dltk-dev@xxxxxxxxxxx <mailto:dltk-dev@xxxxxxxxxxx>
>     > https://dev.eclipse.org/mailman/listinfo/dltk-dev
>     >
>
>     _______________________________________________
>     dltk-dev mailing list
>     dltk-dev@xxxxxxxxxxx <mailto:dltk-dev@xxxxxxxxxxx>
>     https://dev.eclipse.org/mailman/listinfo/dltk-dev
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
>   



Back to the top