Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Extend the C language Content Assist in Eclipse to support custom commands

One possible trap is that you need to export the package of your class such that it can be instantiated by cdt.ui.

You can do this on the Runtime tab of the plugin manifest editor.

 

Toni

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Lambros Petrou
Sent: Monday, May 21, 2012 18:49
To: CDT General developers list.
Subject: Re: [cdt-dev] Extend the C language Content Assist in Eclipse to support custom commands

 

Yes, I have been looking at  InclusionProposalComputer  since your reply and I have a draft ready but it seems there is a probem. How can I check if my plugin is enabled and i use, because I am trying the pragmas and nothing comes up in the suggestions.

 

My plugin.xml is like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<?eclipse version="3.4"?>

<plugin>

 

<extension

          id="DDMPragmasProposalComputer"

          point="org.eclipse.cdt.ui.completionProposalComputer">

       <completionProposalComputer

             categoryId="org.eclipse.cdt.ui.parserProposalCategory"

             class="ddmcontentassistance.DDMPragmasProposalComputer">

          <partition type="__c_preprocessor"/>

       </completionProposalComputer>

    </extension>

 

</plugin>

 

Thank you.

 

On 21 May 2012 09:57, Leherbauer, Anton (Toni) <Anton.Leherbauer@xxxxxxxxxxxxx> wrote:

Hi,

 

I’d suggest to look into the extension point “org.eclipse.cdt.ui.completionProposalComputer”.

All internal completion proposal computers are in fact implementations of this extension point.

The “InclusionProposalComputer” class and its plugin.xml extension snippet might provide some boilerplate code to get you started.

 

HTH

Toni

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Lambros Petrou
Sent: Sunday, May 20, 2012 19:17
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Extend the C language Content Assist in Eclipse to support custom commands

 

I am trying to extend the C/C++ language in Eclipse CDT in order to have auto-complete (Content Assist) for some custom commands ( mostly pragmas ).

Let's say I have the command: #pragma IAM THE_CUSTOM_COMMAND var1 var2

I' d like to make a plugin in order to have the ability the moment I type in #pragma and then SPACE to show the possible commands I have like when I am using regular functions. And if I press enter on one of the suggestions the whole command should be pasted with the default values in the variables.

I tried reading in the Eclipse FAQ and found many tutorials online but I only found how to make a completely new editor supporting my commands.

I just need to add 20-30 pragmas like this in the CDT editor currently being used in Eclipse.

I read that there is an Extension Point for CDT Language and if I could make an extension for that it would be sufficient but I haven't found a tutorial explaining this.

Is there any way to add these commands to the CDT Editor with the Auto-complete functionality I want without making my own editor ? The language we use is C and we have these pragmas and this feature would be great since we use them a lot.

Thank you all.


 

--

Lambros Petrou

 

 


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



 

--

Lambros Petrou

 

 


Back to the top