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?

Oh... sure... I didn't check that...
I'm working on profiling of our application for the last week, and I'm going to go crazy by that... :)

On Mon, Apr 28, 2008 at 6:28 PM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
because it returns a char[]:
public char[] getName()

and that doesnt work very well when i want to filter duplicates with a HashSet...

johan



On Mon, Apr 28, 2008 at 5:25 PM, Michael Spector <spektom@xxxxxxxxx> wrote:

Hi,

My question is a bit not related to the subject, but can you explain why do you create new string objects instead of re-using the object returned by proposal.getName(). There are places in ScriptCompletionProposalCollector already where such a method of object duplication is already in use. Am I missing something?

Thanks!



On Mon, Apr 28, 2008 at 5:46 PM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
hi,

i added a ScriptCompletionProposalCollector.isFiltered()  method.


        if (!doubleFilter.add(new String(proposal.getName())))
        {
            return true;
        }
        return super.isFiltered(proposal);
   
stupid thing is that i currently cant really test it because somehow the mixin/search doesnt return anything
for my project at this time. So only code completion gives me the results. This was not the case 1 week ago.
Maybe something  changed in the search engine in this time.

But i guess this code is fine for filtering out the duplicates.

johan

On Tue, Apr 22, 2008 at 11:03 AM, Andrei Sobolev <andrei.sobolev@xxxxxxxxx> wrote:
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
(_javascript_CompletionProposalCollector for _javascript_).

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 _javascript_CompletionProposalLabelProvider
>     > 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
>

_______________________________________________
dltk-dev mailing list
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




--
Michael
_______________________________________________
dltk-dev mailing list
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




--
Michael

Back to the top