atom feed15 messages in org.eclipse.cdt-devRe: [cdt-dev] Extend the C language C...
FromSent OnAttachments
Lambros PetrouMay 20, 2012 10:16 am 
Leherbauer, Anton (Toni)May 20, 2012 11:57 pm 
Lambros PetrouMay 21, 2012 9:48 am 
Leherbauer, Anton (Toni)May 22, 2012 12:11 am 
Lambros PetrouJun 5, 2012 4:01 am 
Leherbauer, Anton (Toni)Jun 5, 2012 4:40 am 
Lambros PetrouJun 5, 2012 6:15 am 
Lambros PetrouJun 5, 2012 9:05 am 
Leherbauer, Anton (Toni)Jun 6, 2012 1:50 am 
Lambros PetrouJun 7, 2012 3:41 am 
Leherbauer, Anton (Toni)Jun 8, 2012 4:48 am 
Lambros PetrouJun 10, 2012 5:00 am 
Leherbauer, Anton (Toni)Jun 11, 2012 12:43 am 
Lambros PetrouJun 11, 2012 6:07 am 
Sergey PrigoginJun 11, 2012 9:57 am 
Subject:Re: [cdt-dev] Extend the C language Content Assist in Eclipse to support custom commands
From:Leherbauer, Anton (Toni) (Anto@windriver.com)
Date:May 22, 2012 12:11:40 am
List:org.eclipse.cdt-dev

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-@eclipse.org [mailto:cdt-@eclipse.org] 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)
<Anto@windriver.com<mailto:Anto@windriver.com>> 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-@eclipse.org<mailto:cdt-@eclipse.org>
[mailto:cdt-@eclipse.org<mailto:cdt-@eclipse.org>] On
Behalf Of Lambros Petrou Sent: Sunday, May 20, 2012 19:17 To: cdt-@eclipse.org<mailto:cdt-@eclipse.org> 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

www.lambrospetrou.com<http://www.lambrospetrou.com/> lamb@yahoo.gr<mailto:lamb@yahoo.gr>

www.lambrospetrou.com<http://www.lambrospetrou.com/> lamb@yahoo.gr<mailto:lamb@yahoo.gr>