Disabling a IJavaCompletionProposalComputer as default

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

Disabling a IJavaCompletionProposalComputer as default

Gayan Perera
Hi All,

How can i disable IJavaCompletionProposalComputer from benign activated by default in the content assist list.

Br,
Gayan,

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Disabling a IJavaCompletionProposalComputer as default

Gayan Perera
Hi all,

Any updates on this? I see that some proposal computers such as chain completions are by default not included. How to achieve this?

Br,
Gayan 

On Sat, 4 Apr 2020 at 21:11, Gayan Perera <[hidden email]> wrote:
Hi All,

How can i disable IJavaCompletionProposalComputer from benign activated by default in the content assist list.

Br,
Gayan,

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Disabling a IJavaCompletionProposalComputer as default

Roland Grunberg
On Tue, Apr 7, 2020 at 3:40 AM Gayan Perera <[hidden email]> wrote:
>
> Hi all,
>
> Any updates on this? I see that some proposal computers such as chain completions are by default not included. How to achieve this?

Hey Gayan,

I think the properties you care about are
PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES and
PreferenceConstants.CODEASSIST_CATEGORY_ORDER .

Their values are set in PreferenceConstants.initializeDefaultValues(..) .

When a completion proposal computer's ID is present in
CODEASSIST_EXCLUDED_CATEGORIES, it disables proposals
from being computed on the first completion invocation. When the
ID is present in CODEASSIST_CATEGORY_ORDER with a
'cyclestate' greater than 65535, then it will also be disabled from
appearing in its own "group" on subsequent invocations of content
assist (eg. hitting ctrl+space multiple times).

The above still won't work if a user has overridden the default
settings and a new completion proposal is being introduced so
we addressed this in http://eclip.se/550226 with the ability to
disable these newly introduced completions as well.

Hope this helps.

Roland Grunberg

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Disabling a IJavaCompletionProposalComputer as default

Gayan Perera
Hi Roland,
Thanks for the tips, by the way this to work i need to have category like below right

  <extension
        id="javaChainProposalCategory"
        name="%ChainProposalCategory"
        point="org.eclipse.jdt.ui.javaCompletionProposalComputer">
        <proposalCategory icon="icons/full/eview16/package.png"/>
  </extension>
  <extension
        point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
        id="org.eclipse.jdt.ui.javaCompletionProposalComputer.chain">
     <javaCompletionProposalComputer
           activate="true"
           categoryId="org.eclipse.jdt.ui.javaChainProposalCategory"
           class="org.eclipse.jdt.internal.ui.text.java.ChainCompletionProposalComputer"
           needsSortingAfterFiltering="false"
           requiresUIThread="false">
     </javaCompletionProposalComputer>
  </extension>
And should i add the category id in PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES  ?

Br,
Gayan.


On Tue, Apr 7, 2020 at 4:37 PM Roland Grunberg <[hidden email]> wrote:
On Tue, Apr 7, 2020 at 3:40 AM Gayan Perera <[hidden email]> wrote:
>
> Hi all,
>
> Any updates on this? I see that some proposal computers such as chain completions are by default not included. How to achieve this?

Hey Gayan,

I think the properties you care about are
PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES and
PreferenceConstants.CODEASSIST_CATEGORY_ORDER .

Their values are set in PreferenceConstants.initializeDefaultValues(..) .

When a completion proposal computer's ID is present in
CODEASSIST_EXCLUDED_CATEGORIES, it disables proposals
from being computed on the first completion invocation. When the
ID is present in CODEASSIST_CATEGORY_ORDER with a
'cyclestate' greater than 65535, then it will also be disabled from
appearing in its own "group" on subsequent invocations of content
assist (eg. hitting ctrl+space multiple times).

The above still won't work if a user has overridden the default
settings and a new completion proposal is being introduced so
we addressed this in http://eclip.se/550226 with the ability to
disable these newly introduced completions as well.

Hope this helps.

Roland Grunberg

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Disabling a IJavaCompletionProposalComputer as default

Roland Grunberg
On Tue, Apr 7, 2020 at 12:08 PM Gayan Perera <[hidden email]> wrote:

>
> Hi Roland,
> Thanks for the tips, by the way this to work i need to have category like below right
>
>   <extension
>         id="javaChainProposalCategory"
>         name="%ChainProposalCategory"
>         point="org.eclipse.jdt.ui.javaCompletionProposalComputer">
>         <proposalCategory icon="icons/full/eview16/package.png"/>
>   </extension>
>   <extension
>         point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
>         id="org.eclipse.jdt.ui.javaCompletionProposalComputer.chain">
>      <javaCompletionProposalComputer
>            activate="true"
>            categoryId="org.eclipse.jdt.ui.javaChainProposalCategory"
>            class="org.eclipse.jdt.internal.ui.text.java.ChainCompletionProposalComputer"
>            needsSortingAfterFiltering="false"
>            requiresUIThread="false">
>      </javaCompletionProposalComputer>
>   </extension>
> And should i add the category id in PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES  ?

Yes, the completion proposal computer would need to be contributed through the
org.eclipse.jdt.ui.javaCompletionProposalComputer extension point. To disable it
by default from contributing to the first content assist invocation
popup, you'd need
to add it to CODEASSIST_EXCLUDED_CATEGORIES.

You might need to do more to ensure it's disabled on subsequent invocations (eg.
multiple ctrl+space) but the above property should be a good start.

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Disabling a IJavaCompletionProposalComputer as default

Gayan Perera
Thanks Roland, I will try this out.

On Tue, Apr 7, 2020 at 7:49 PM Roland Grunberg <[hidden email]> wrote:
On Tue, Apr 7, 2020 at 12:08 PM Gayan Perera <[hidden email]> wrote:
>
> Hi Roland,
> Thanks for the tips, by the way this to work i need to have category like below right
>
>   <extension
>         id="javaChainProposalCategory"
>         name="%ChainProposalCategory"
>         point="org.eclipse.jdt.ui.javaCompletionProposalComputer">
>         <proposalCategory icon="icons/full/eview16/package.png"/>
>   </extension>
>   <extension
>         point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
>         id="org.eclipse.jdt.ui.javaCompletionProposalComputer.chain">
>      <javaCompletionProposalComputer
>            activate="true"
>            categoryId="org.eclipse.jdt.ui.javaChainProposalCategory"
>            class="org.eclipse.jdt.internal.ui.text.java.ChainCompletionProposalComputer"
>            needsSortingAfterFiltering="false"
>            requiresUIThread="false">
>      </javaCompletionProposalComputer>
>   </extension>
> And should i add the category id in PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES  ?

Yes, the completion proposal computer would need to be contributed through the
org.eclipse.jdt.ui.javaCompletionProposalComputer extension point. To disable it
by default from contributing to the first content assist invocation
popup, you'd need
to add it to CODEASSIST_EXCLUDED_CATEGORIES.

You might need to do more to ensure it's disabled on subsequent invocations (eg.
multiple ctrl+space) but the above property should be a good start.

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev