Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Parsing Objective C syntax in a header file

> We've got a project nature that identifies the project as an objective
> c one - is that helpful? Unfortunately the CDT code tends to assume
> that "c && ! c++ => c" and "c && c++ => c++" in the natures. It would
> really be good to have a 'base c' nature that 'vanilla c' and 'c++'
> could both extend, as well as avoiding such hard-coded methods as
> isCLangauge() and IsCppLanguage() ...


Yes, this is something that should be fixed, especially now that Objective C is in the picture. It plays havok with the help-book system in the C editor as well as other things, see bug 237331.


> That sounds like something I could hook in for the Objecitve C wizard
> fairly easily and in advance of finding a better solution. Can you
> point me to the CVS location or source where that happens? I'm
> unfamiliar with the UPC project(s).


Look in the org.eclipse.cdt.managedbuilder.xlupc.ui plugin which is under the xlc folder in CVS. The class XLUpcSettingsWizardRunnable is responsible for mapping .c files to the UPC langauge.


Mike Kucera
Software Developer
IBM Eclipse CDT Team
mkucera@xxxxxxxxxx

Inactive hide details for Alex Blewitt ---07/09/2009 10:24:24 AM---On Thu, Jul 9, 2009 at 3:09 PM, Mike Kucera<mkucera@xxxxxx.cAlex Blewitt ---07/09/2009 10:24:24 AM---On Thu, Jul 9, 2009 at 3:09 PM, Mike Kucera<mkucera@xxxxxxxxxx> wrote:


From:

Alex Blewitt <alex.blewitt@xxxxxxxxx>

To:

"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

Date:

07/09/2009 10:24 AM

Subject:

Re: [cdt-dev] Parsing Objective C syntax in a header file




On Thu, Jul 9, 2009 at 3:09 PM, Mike Kucera<mkucera@xxxxxxxxxx> wrote:
> So to get this to work properly for Objective C you need that information in
> the index, which I'm guessing is not available at the moment.

No, not yet. We've got an ADT being parsed, but I don't know what
step(s) are needed to then move it to being indexed. As there are some
items which are concepts new to CDT (message sends, protocol
references, categories etc.) I imagine some additions would need to be
made to the closed-set world of the CDT's PDom indexer. The
alternative would be to write our own indexer?

> Otherwise you may need an Objective C project type.

We've got a project nature that identifies the project as an objective
c one - is that helpful? Unfortunately the CDT code tends to assume
that "c && ! c++ => c" and "c && c++ => c++" in the natures. It would
really be good to have a 'base c' nature that 'vanilla c' and 'c++'
could both extend, as well as avoiding such hard-coded methods as
isCLangauge() and IsCppLanguage() ...

> As a work around you can use the language mappings to force the language. Go
> to the project properties and choose C/C++ General > Language Mappings, then
> pick Objective C for the C header content type.

I tried that, but it didn't seem to have any effect. I may have found
a bug in my system or I may have corrupted my workspace. I'll try and
find out which.

> Language mappings can also be set up programatically using the LanguageManager,
> for example the new UPC project wizard maps .c files to the UPC language.

That sounds like something I could hook in for the Objecitve C wizard
fairly easily and in advance of finding a better solution. Can you
point me to the CVS location or source where that happens? I'm
unfamiliar with the UPC project(s).

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


GIF image

GIF image


Back to the top