Summary: | Photran-based patch for superficial multilanguage support | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] CDT | Reporter: | Jeffrey Overbey <com-eclipse-dot-org> | ||||||
Component: | cdt-core | Assignee: | Doug Schaefer <cdtdoug> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | enhancement | ||||||||
Priority: | P3 | CC: | beth, com-eclipse-dot-org, dinglis, leo.treggiari, mikhail.sennikovskiy, mschorn.eclipse | ||||||
Version: | 3.1 | Keywords: | contributed | ||||||
Target Milestone: | 3.1 | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
See Also: | https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/171714 | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Jeffrey Overbey
2006-03-27 11:43:23 EST
Created attachment 36996 [details]
Photran-based patch for superficial multilanguage support
Thanks Jeff. Looks pretty good. I have a few requests, though, to start. - Move IContributed* to the org.eclipse.cdt.core.model package (i.e. no need for a separate package). - Change the parameter in ILanguage.createModelBulider to be ITranslationUnit instead of TranslationUnit which is an interal class. I'm not sure how that will impact your code. - Instead of getting the baseImageDescriptor from the ICElement, which is a non-UI class, you should probably create an adapter to get a UI class and get the image descriptor that way. That'll reduce the crazy casts you've got going there. Comment on attachment 36996 [details]
Photran-based patch for superficial multilanguage support
Replaced with 3/27 patch
Created attachment 37020 [details]
Revised patch (3/27/06)
Thanks Doug. Please see the revised patch.
I have committed the new patch. I am a bit concerned about the setter in ITranslationUnit. I'm not sure it fits there since it isn't intended to be used by general clients of this interface. But we can revisit it when we do an API review of the CModel for CDT 4.0. Thanks for your help. We are obviously nowhere near a "complete" (or "good") API for language integration (our FortranElement hierarchy is a great example of what a hack looks like), but this is a tremendous help for us Photran folk. I noticed this change that went in for contributed model elements and I'm curious how this works for more then one contribution within the model since only one adapter factory can provide the interfaces for a given interface. Seems to me that this need some type of language registry with a delegating presentation mechanism, kinda like the debug model. BTW, I'm specifically referring to the image provider class. (In reply to comment #7) > I noticed this change that went in for contributed model elements and I'm > curious how this works for more then one contribution within the model since > only one adapter factory can provide the interfaces for a given interface. > Seems to me that this need some type of language registry with a delegating > presentation mechanism, kinda like the debug model. > Good point. In Photran, we don't register an adapter factory; we just implement getAdapter on the new elements directly. We can get away with that since we dumped all the CDT integration stuff--core and UI--in a single plug-in. (From Photran's perspective, the CModel is just infrastructure to get the eye candy we want, so all of this is UI for us. For now, anyway...) But that's a pretty idiosyncratic approach. Your point stands... New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/171714 |