Filtering groovy completion proposal issue

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Filtering groovy completion proposal issue

Maxime HAMM

Hi

I think there is an issue using the "org.codehaus.groovy.eclipse.codeassist.completion.completionProposalFilter" extension point :

The filtering algorithm using the extension point is part of class "org.codehaus.groovy.eclipse.codeassist.processors.StatementAndExpressionCompletionProcessor" :

        // extra filtering and sorting provided by third parties
        try {
            List<IProposalFilter> filters = ProposalProviderRegistry
                    .getRegistry().getFiltersFor(context.unit);
            for (IProposalFilter filter : filters) {
                try {
                    List<IGroovyProposal> newProposals = filter
                            .filterProposals(groovyProposals, context,
                                    getJavaContext());
                    groovyProposals = newProposals == null ? groovyProposals
                            : newProposals;
                } catch (Exception e) {
                    GroovyCore.logException(
                            "Exception when using third party proposal filter: "
                                    + filter.getClass().getCanonicalName(), e);
                }
            }
        } catch (CoreException e) {
            GroovyCore.logException(
                    "Exception accessing proposal provider registry", e);
        }

In fact there is today 9 different processor classes that inherits from "AbstractGroovyCompletionProcessor"… 
That is why some groovy completion are still visible even after filtering using the extension point…

==>I send you one proposal that fix this… but the signature of "IProposalFilter" is modified… this is fine for Jspresso… but it may impact other third parties… I know this extension was created for Jspresso… then may be we are the only third party that use it today ?
What do you think about it ?

==> In fact that will not fit completely my needs : I also need to filter other proposals : native Java proposals… Can you may be inherit from "ContentAssistProcessor" or "JavaCompletionProcessor" so that you could override method "filterAndSortProposals"...
What do you think about it ?

==> Or may be we should ask eclipse.org to add a new "completion filtering extension point"… or asking "javaCompletionProposalSorters" to include the possibility of removing proposals…
What do you think about it ?

Thank you for reading this !

Regards
Maxime HAMM




Reply | Threaded
Open this post in threaded view
|

Re: Filtering groovy completion proposal issue

Maxime HAMM
Here are the patch about my first proposal.
Regards





Le 22 déc. 2011 à 21:04, Maxime HAMM a écrit :


Hi

I think there is an issue using the " extension point :

The filtering algorithm using the extension point is part of class "org.codehaus.groovy.eclipse.codeassist.processors.StatementAndExpressionCompletionProcessor" :

        // extra filtering and sorting provided by third parties
        try {
            List<IProposalFilter> filters = ProposalProviderRegistry
                    .getRegistry().getFiltersFor(context.unit);
            for (IProposalFilter filter : filters) {
                try {
                    List<IGroovyProposal> newProposals = filter
                            .filterProposals(groovyProposals, context,
                                    getJavaContext());
                    groovyProposals = newProposals == null ? groovyProposals
                            : newProposals;
                } catch (Exception e) {
                    GroovyCore.logException(
                            "Exception when using third party proposal filter: "
                                    + filter.getClass().getCanonicalName(), e);
                }
            }
        } catch (CoreException e) {
            GroovyCore.logException(
                    "Exception accessing proposal provider registry", e);
        }

In fact there is today 9 different processor classes that inherits from "AbstractGroovyCompletionProcessor"… 
That is why some groovy completion are still visible even after filtering using the extension point…

==>I send you one proposal that fix this… but the signature of "IProposalFilter" is modified… this is fine for Jspresso… but it may impact other third parties… I know this extension was created for Jspresso… then may be we are the only third party that use it today ?
What do you think about it ?

==> In fact that will not fit completely my needs : I also need to filter other proposals : native Java proposals… Can you may be inherit from "ContentAssistProcessor" or "JavaCompletionProcessor" so that you could override method "filterAndSortProposals"...
What do you think about it ?

==> Or may be we should ask eclipse.org to add a new "completion filtering extension point"… or asking "javaCompletionProposalSorters" to include the possibility of removing proposals…
What do you think about it ?

Thank you for reading this !

Regards
Maxime HAMM






org.codehaus.groovy.eclipse.codeassist.completion.patch (7K) Download Attachment
org.codehaus.groovy.eclipse.codeassist.completion.test.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Filtering groovy completion proposal issue

Andrew Eisenberg
Thanks for the patches.  Can you create a jira issue and attach the
patches there?  This makes things easier to keep track of.  We can
also discuss the change on the issue.

So, yes, the current implementation only filters statement and
expression proposals.  What kinds of proposals are you looking to
filter, but aren't able to right now?

On Thu, Dec 22, 2011 at 12:06 PM, Maxime HAMM <[hidden email]> wrote:

> Here are the patch about my first proposal.
> Regards
>
>
>
>
>
> Le 22 déc. 2011 à 21:04, Maxime HAMM a écrit :
>
>
> Hi
>
> I think there is an issue using the " extension point :
>
> The filtering algorithm using the extension point is part of class
> "org.codehaus.groovy.eclipse.codeassist.processors.StatementAndExpressionCompletionProcessor"
> :
>
>         // extra filtering and sorting provided by third parties
>         try {
>             List<IProposalFilter> filters = ProposalProviderRegistry
>                     .getRegistry().getFiltersFor(context.unit);
>             for (IProposalFilter filter : filters) {
>                 try {
>                     List<IGroovyProposal> newProposals = filter
>                             .filterProposals(groovyProposals, context,
>                                     getJavaContext());
>                     groovyProposals = newProposals == null ? groovyProposals
>                             : newProposals;
>                 } catch (Exception e) {
>                     GroovyCore.logException(
>                             "Exception when using third party proposal
> filter: "
>                                     + filter.getClass().getCanonicalName(),
> e);
>                 }
>             }
>         } catch (CoreException e) {
>             GroovyCore.logException(
>                     "Exception accessing proposal provider registry", e);
>         }
>
> In fact there is today 9 different processor classes that inherits from
> "AbstractGroovyCompletionProcessor"…
> That is why some groovy completion are still visible even after filtering
> using the extension point…
>
> ==>I send you one proposal that fix this… but the signature of
> "IProposalFilter" is modified… this is fine for Jspresso… but it may impact
> other third parties… I know this extension was created for Jspresso… then
> may be we are the only third party that use it today ?
> What do you think about it ?
>
> ==> In fact that will not fit completely my needs : I also need to filter
> other proposals : native Java proposals… Can you may be inherit from
> "ContentAssistProcessor" or "JavaCompletionProcessor" so that you could
> override method "filterAndSortProposals"...
> What do you think about it ?
>
> ==> Or may be we should ask eclipse.org to add a new "completion filtering
> extension point"… or asking "javaCompletionProposalSorters" to include the
> possibility of removing proposals…
> What do you think about it ?
>
> Thank you for reading this !
>
> Regards
> Maxime HAMM
> www.jspresso.org
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Filtering groovy completion proposal issue

Maxime HAMM
Hi Andrew

For example I have unattempted completion coming from "LocalVariableCompletionProcessor"

Here is the jura : GROOVY-5209 … you think you may validate to change the current extension point signature ? 

Do you know what is the appropriate way to ask eclipse.org to create a new extension point to filter java results ?

Thank you and have a nice Chistmas !

Maxime

Le 22 déc. 2011 à 21:56, Andrew Eisenberg a écrit :

Thanks for the patches.  Can you create a jira issue and attach the
patches there?  This makes things easier to keep track of.  We can
also discuss the change on the issue.

So, yes, the current implementation only filters statement and
expression proposals.  What kinds of proposals are you looking to
filter, but aren't able to right now?

On Thu, Dec 22, 2011 at 12:06 PM, Maxime HAMM <[hidden email]> wrote:
Here are the patch about my first proposal.
Regards





Le 22 déc. 2011 à 21:04, Maxime HAMM a écrit :


Hi

I think there is an issue using the " extension point :

The filtering algorithm using the extension point is part of class
"org.codehaus.groovy.eclipse.codeassist.processors.StatementAndExpressionCompletionProcessor"
:

        // extra filtering and sorting provided by third parties
        try {
            List<IProposalFilter> filters = ProposalProviderRegistry
                    .getRegistry().getFiltersFor(context.unit);
            for (IProposalFilter filter : filters) {
                try {
                    List<IGroovyProposal> newProposals = filter
                            .filterProposals(groovyProposals, context,
                                    getJavaContext());
                    groovyProposals = newProposals == null ? groovyProposals
                            : newProposals;
                } catch (Exception e) {
                    GroovyCore.logException(
                            "Exception when using third party proposal
filter: "
                                    + filter.getClass().getCanonicalName(),
e);
                }
            }
        } catch (CoreException e) {
            GroovyCore.logException(
                    "Exception accessing proposal provider registry", e);
        }

In fact there is today 9 different processor classes that inherits from
"AbstractGroovyCompletionProcessor"…
That is why some groovy completion are still visible even after filtering
using the extension point…

==>I send you one proposal that fix this… but the signature of
"IProposalFilter" is modified… this is fine for Jspresso… but it may impact
other third parties… I know this extension was created for Jspresso… then
may be we are the only third party that use it today ?
What do you think about it ?

==> In fact that will not fit completely my needs : I also need to filter
other proposals : native Java proposals… Can you may be inherit from
"ContentAssistProcessor" or "JavaCompletionProcessor" so that you could
override method "filterAndSortProposals"...
What do you think about it ?

==> Or may be we should ask eclipse.org to add a new "completion filtering
extension point"… or asking "javaCompletionProposalSorters" to include the
possibility of removing proposals…
What do you think about it ?

Thank you for reading this !

Regards
Maxime HAMM
www.jspresso.org







---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Filtering groovy completion proposal issue

Andrew Eisenberg
It's unlikely that the eclipse project will create a new extension
point.  Since the project is so mature, it would take a significant
push to get any changes like that through.

That being said, you may as well raise a bug.  And if you are willing
to implement the feature yourself, then they will more likely listen
to you.

I'll comment on the bug report.

On Thu, Dec 22, 2011 at 2:00 PM, Maxime HAMM <[hidden email]> wrote:

> Hi Andrew
>
> For example I have unattempted completion coming from
> "LocalVariableCompletionProcessor"
>
> Here is the jura : GROOVY-5209 … you think you may validate to change the
> current extension point signature ?
>
> Do you know what is the appropriate way to ask eclipse.org to create a new
> extension point to filter java results ?
>
> Thank you and have a nice Chistmas !
>
> Maxime
>
> Le 22 déc. 2011 à 21:56, Andrew Eisenberg a écrit :
>
> Thanks for the patches.  Can you create a jira issue and attach the
> patches there?  This makes things easier to keep track of.  We can
> also discuss the change on the issue.
>
> So, yes, the current implementation only filters statement and
> expression proposals.  What kinds of proposals are you looking to
> filter, but aren't able to right now?
>
> On Thu, Dec 22, 2011 at 12:06 PM, Maxime HAMM <[hidden email]>
> wrote:
>
> Here are the patch about my first proposal.
>
> Regards
>
>
>
>
>
>
> Le 22 déc. 2011 à 21:04, Maxime HAMM a écrit :
>
>
>
> Hi
>
>
> I think there is an issue using the " extension point :
>
>
> The filtering algorithm using the extension point is part of class
>
> "org.codehaus.groovy.eclipse.codeassist.processors.StatementAndExpressionCompletionProcessor"
>
> :
>
>
>         // extra filtering and sorting provided by third parties
>
>         try {
>
>             List<IProposalFilter> filters = ProposalProviderRegistry
>
>                     .getRegistry().getFiltersFor(context.unit);
>
>             for (IProposalFilter filter : filters) {
>
>                 try {
>
>                     List<IGroovyProposal> newProposals = filter
>
>                             .filterProposals(groovyProposals, context,
>
>                                     getJavaContext());
>
>                     groovyProposals = newProposals == null ? groovyProposals
>
>                             : newProposals;
>
>                 } catch (Exception e) {
>
>                     GroovyCore.logException(
>
>                             "Exception when using third party proposal
>
> filter: "
>
>                                     + filter.getClass().getCanonicalName(),
>
> e);
>
>                 }
>
>             }
>
>         } catch (CoreException e) {
>
>             GroovyCore.logException(
>
>                     "Exception accessing proposal provider registry", e);
>
>         }
>
>
> In fact there is today 9 different processor classes that inherits from
>
> "AbstractGroovyCompletionProcessor"…
>
> That is why some groovy completion are still visible even after filtering
>
> using the extension point…
>
>
> ==>I send you one proposal that fix this… but the signature of
>
> "IProposalFilter" is modified… this is fine for Jspresso… but it may impact
>
> other third parties… I know this extension was created for Jspresso… then
>
> may be we are the only third party that use it today ?
>
> What do you think about it ?
>
>
> ==> In fact that will not fit completely my needs : I also need to filter
>
> other proposals : native Java proposals… Can you may be inherit from
>
> "ContentAssistProcessor" or "JavaCompletionProcessor" so that you could
>
> override method "filterAndSortProposals"...
>
> What do you think about it ?
>
>
> ==> Or may be we should ask eclipse.org to add a new "completion filtering
>
> extension point"… or asking "javaCompletionProposalSorters" to include the
>
> possibility of removing proposals…
>
> What do you think about it ?
>
>
> Thank you for reading this !
>
>
> Regards
>
> Maxime HAMM
>
> www.jspresso.org
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Filtering groovy completion proposal issue

Maxime HAMM
Hi Andrew.
I think I do the job like you ask me to do... The patch is attached... It works fine for Jspresso…
Let me know if this will be part of next snapshot/milestone/release
Nice working with you !
Regards
Maxime

Le 22 déc. 2011 à 23:15, Andrew Eisenberg a écrit :

> It's unlikely that the eclipse project will create a new extension
> point.  Since the project is so mature, it would take a significant
> push to get any changes like that through.
>
> That being said, you may as well raise a bug.  And if you are willing
> to implement the feature yourself, then they will more likely listen
> to you.
>
> I'll comment on the bug report.
>
> On Thu, Dec 22, 2011 at 2:00 PM, Maxime HAMM <[hidden email]> wrote:
>> Hi Andrew
>>
>> For example I have unattempted completion coming from
>> "LocalVariableCompletionProcessor"
>>
>> Here is the jura : GROOVY-5209 … you think you may validate to change the
>> current extension point signature ?
>>
>> Do you know what is the appropriate way to ask eclipse.org to create a new
>> extension point to filter java results ?
>>
>> Thank you and have a nice Chistmas !
>>
>> Maxime
>>
>> Le 22 déc. 2011 à 21:56, Andrew Eisenberg a écrit :
>>
>> Thanks for the patches.  Can you create a jira issue and attach the
>> patches there?  This makes things easier to keep track of.  We can
>> also discuss the change on the issue.
>>
>> So, yes, the current implementation only filters statement and
>> expression proposals.  What kinds of proposals are you looking to
>> filter, but aren't able to right now?
>>
>> On Thu, Dec 22, 2011 at 12:06 PM, Maxime HAMM <[hidden email]>
>> wrote:
>>
>> Here are the patch about my first proposal.
>>
>> Regards
>>
>>
>>
>>
>>
>>
>> Le 22 déc. 2011 à 21:04, Maxime HAMM a écrit :
>>
>>
>>
>> Hi
>>
>>
>> I think there is an issue using the " extension point :
>>
>>
>> The filtering algorithm using the extension point is part of class
>>
>> "org.codehaus.groovy.eclipse.codeassist.processors.StatementAndExpressionCompletionProcessor"
>>
>> :
>>
>>
>>         // extra filtering and sorting provided by third parties
>>
>>         try {
>>
>>             List<IProposalFilter> filters = ProposalProviderRegistry
>>
>>                     .getRegistry().getFiltersFor(context.unit);
>>
>>             for (IProposalFilter filter : filters) {
>>
>>                 try {
>>
>>                     List<IGroovyProposal> newProposals = filter
>>
>>                             .filterProposals(groovyProposals, context,
>>
>>                                     getJavaContext());
>>
>>                     groovyProposals = newProposals == null ? groovyProposals
>>
>>                             : newProposals;
>>
>>                 } catch (Exception e) {
>>
>>                     GroovyCore.logException(
>>
>>                             "Exception when using third party proposal
>>
>> filter: "
>>
>>                                     + filter.getClass().getCanonicalName(),
>>
>> e);
>>
>>                 }
>>
>>             }
>>
>>         } catch (CoreException e) {
>>
>>             GroovyCore.logException(
>>
>>                     "Exception accessing proposal provider registry", e);
>>
>>         }
>>
>>
>> In fact there is today 9 different processor classes that inherits from
>>
>> "AbstractGroovyCompletionProcessor"…
>>
>> That is why some groovy completion are still visible even after filtering
>>
>> using the extension point…
>>
>>
>> ==>I send you one proposal that fix this… but the signature of
>>
>> "IProposalFilter" is modified… this is fine for Jspresso… but it may impact
>>
>> other third parties… I know this extension was created for Jspresso… then
>>
>> may be we are the only third party that use it today ?
>>
>> What do you think about it ?
>>
>>
>> ==> In fact that will not fit completely my needs : I also need to filter
>>
>> other proposals : native Java proposals… Can you may be inherit from
>>
>> "ContentAssistProcessor" or "JavaCompletionProcessor" so that you could
>>
>> override method "filterAndSortProposals"...
>>
>> What do you think about it ?
>>
>>
>> ==> Or may be we should ask eclipse.org to add a new "completion filtering
>>
>> extension point"… or asking "javaCompletionProposalSorters" to include the
>>
>> possibility of removing proposals…
>>
>> What do you think about it ?
>>
>>
>> Thank you for reading this !
>>
>>
>> Regards
>>
>> Maxime HAMM
>>
>> www.jspresso.org
>>
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email