View | Details | Raw Unified | Return to bug 133386 | Differences between
and this patch

Collapse All | Expand All

(-)parser/org/eclipse/cdt/core/dom/ast/gnu/c/GCCLanguage.java (-1 / +7 lines)
Lines 19-24 Link Here
19
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
19
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
20
import org.eclipse.cdt.core.model.ILanguage;
20
import org.eclipse.cdt.core.model.ILanguage;
21
import org.eclipse.cdt.core.model.IWorkingCopy;
21
import org.eclipse.cdt.core.model.IWorkingCopy;
22
import org.eclipse.cdt.core.model.addl_langs.IContributedModelBuilder;
22
import org.eclipse.cdt.core.parser.CodeReader;
23
import org.eclipse.cdt.core.parser.CodeReader;
23
import org.eclipse.cdt.core.parser.IScanner;
24
import org.eclipse.cdt.core.parser.IScanner;
24
import org.eclipse.cdt.core.parser.IScannerInfo;
25
import org.eclipse.cdt.core.parser.IScannerInfo;
Lines 32-37 Link Here
32
import org.eclipse.cdt.internal.core.dom.parser.ISourceCodeParser;
33
import org.eclipse.cdt.internal.core.dom.parser.ISourceCodeParser;
33
import org.eclipse.cdt.internal.core.dom.parser.c.GCCParserExtensionConfiguration;
34
import org.eclipse.cdt.internal.core.dom.parser.c.GCCParserExtensionConfiguration;
34
import org.eclipse.cdt.internal.core.dom.parser.c.GNUCSourceParser;
35
import org.eclipse.cdt.internal.core.dom.parser.c.GNUCSourceParser;
36
import org.eclipse.cdt.internal.core.model.TranslationUnit;
35
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
37
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
36
import org.eclipse.cdt.internal.core.parser.scanner2.GCCScannerExtensionConfiguration;
38
import org.eclipse.cdt.internal.core.parser.scanner2.GCCScannerExtensionConfiguration;
37
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
39
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
Lines 129-133 Link Here
129
	public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset) {
131
	public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset) {
130
		return null;
132
		return null;
131
	}
133
	}
132
	
134
135
	public IContributedModelBuilder createModelBuilder(TranslationUnit tu) {
136
		// JO -- Use the default CDT model builder
137
		return null;
138
	}
133
}
139
}
(-)parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/GPPLanguage.java (+7 lines)
Lines 19-24 Link Here
19
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
19
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
20
import org.eclipse.cdt.core.model.ILanguage;
20
import org.eclipse.cdt.core.model.ILanguage;
21
import org.eclipse.cdt.core.model.IWorkingCopy;
21
import org.eclipse.cdt.core.model.IWorkingCopy;
22
import org.eclipse.cdt.core.model.addl_langs.IContributedModelBuilder;
22
import org.eclipse.cdt.core.parser.CodeReader;
23
import org.eclipse.cdt.core.parser.CodeReader;
23
import org.eclipse.cdt.core.parser.IScanner;
24
import org.eclipse.cdt.core.parser.IScanner;
24
import org.eclipse.cdt.core.parser.IScannerInfo;
25
import org.eclipse.cdt.core.parser.IScannerInfo;
Lines 32-37 Link Here
32
import org.eclipse.cdt.internal.core.dom.parser.ISourceCodeParser;
33
import org.eclipse.cdt.internal.core.dom.parser.ISourceCodeParser;
33
import org.eclipse.cdt.internal.core.dom.parser.cpp.GNUCPPSourceParser;
34
import org.eclipse.cdt.internal.core.dom.parser.cpp.GNUCPPSourceParser;
34
import org.eclipse.cdt.internal.core.dom.parser.cpp.GPPParserExtensionConfiguration;
35
import org.eclipse.cdt.internal.core.dom.parser.cpp.GPPParserExtensionConfiguration;
36
import org.eclipse.cdt.internal.core.model.TranslationUnit;
35
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
37
import org.eclipse.cdt.internal.core.parser.scanner2.DOMScanner;
36
import org.eclipse.cdt.internal.core.parser.scanner2.GPPScannerExtensionConfiguration;
38
import org.eclipse.cdt.internal.core.parser.scanner2.GPPScannerExtensionConfiguration;
37
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
39
import org.eclipse.cdt.internal.core.parser.scanner2.IScannerExtensionConfiguration;
Lines 128-131 Link Here
128
		return null;
130
		return null;
129
	}
131
	}
130
	
132
	
133
134
	public IContributedModelBuilder createModelBuilder(TranslationUnit tu) {
135
		// JO -- Use the default CDT model builder
136
		return null;
137
	}
131
}
138
}
(-)src/org/eclipse/cdt/core/CCorePlugin.java (-1 / +3 lines)
Lines 882-892 Link Here
882
	 * @return
882
	 * @return
883
	 */
883
	 */
884
	public static IContentType getContentType(IProject project, String filename) {
884
	public static IContentType getContentType(IProject project, String filename) {
885
		// JO -- Always try in the workspace
885
		// try with the project settings
886
		// try with the project settings
886
		if (project != null) {
887
		if (project != null) {
887
			try {
888
			try {
888
				IContentTypeMatcher matcher = project.getContentTypeMatcher();
889
				IContentTypeMatcher matcher = project.getContentTypeMatcher();
889
				return matcher.findContentTypeFor(filename);
890
				IContentType ct = matcher.findContentTypeFor(filename);
891
				if (ct != null) return ct;
890
			} catch (CoreException e) {
892
			} catch (CoreException e) {
891
				// ignore. 
893
				// ignore. 
892
			}
894
			}
(-)META-INF/MANIFEST.MF (+1 lines)
Lines 19-24 Link Here
19
 org.eclipse.cdt.core.formatter,
19
 org.eclipse.cdt.core.formatter,
20
 org.eclipse.cdt.core.index,
20
 org.eclipse.cdt.core.index,
21
 org.eclipse.cdt.core.model,
21
 org.eclipse.cdt.core.model,
22
 org.eclipse.cdt.core.model.addl_langs,
22
 org.eclipse.cdt.core.parser,
23
 org.eclipse.cdt.core.parser,
23
 org.eclipse.cdt.core.parser.ast,
24
 org.eclipse.cdt.core.parser.ast,
24
 org.eclipse.cdt.core.parser.ast.gcc,
25
 org.eclipse.cdt.core.parser.ast.gcc,
(-)model/org/eclipse/cdt/core/model/CoreModel.java (-25 / +17 lines)
Lines 11-16 Link Here
11
package org.eclipse.cdt.core.model;
11
package org.eclipse.cdt.core.model;
12
12
13
13
14
import java.util.ArrayList;
15
14
import org.eclipse.cdt.core.CCProjectNature;
16
import org.eclipse.cdt.core.CCProjectNature;
15
import org.eclipse.cdt.core.CCorePlugin;
17
import org.eclipse.cdt.core.CCorePlugin;
16
import org.eclipse.cdt.core.CProjectNature;
18
import org.eclipse.cdt.core.CProjectNature;
Lines 41-46 Link Here
41
import org.eclipse.core.runtime.CoreException;
43
import org.eclipse.core.runtime.CoreException;
42
import org.eclipse.core.runtime.IPath;
44
import org.eclipse.core.runtime.IPath;
43
import org.eclipse.core.runtime.IProgressMonitor;
45
import org.eclipse.core.runtime.IProgressMonitor;
46
import org.eclipse.core.runtime.Plugin;
44
import org.eclipse.core.runtime.content.IContentType;
47
import org.eclipse.core.runtime.content.IContentType;
45
import org.eclipse.core.runtime.jobs.ISchedulingRule;
48
import org.eclipse.core.runtime.jobs.ISchedulingRule;
46
49
Lines 185-197 Link Here
185
	 * @return String[] ids
188
	 * @return String[] ids
186
	 */
189
	 */
187
	public static String[] getRegistedContentTypeIds() {
190
	public static String[] getRegistedContentTypeIds() {
188
		return new String[] {
191
		ArrayList a = LanguageManager.getInstance().getAllContentTypes();
189
				CCorePlugin.CONTENT_TYPE_ASMSOURCE,
192
		String[] result = new String[a.size()];
190
				CCorePlugin.CONTENT_TYPE_CHEADER,
193
		a.toArray(result);
191
				CCorePlugin.CONTENT_TYPE_CSOURCE,
194
		return result;
192
				CCorePlugin.CONTENT_TYPE_CXXHEADER,
193
				CCorePlugin.CONTENT_TYPE_CXXSOURCE
194
		};
195
	}
195
	}
196
196
197
	/**
197
	/**
Lines 201-217 Link Here
201
		IContentType contentType = CCorePlugin.getContentType(project, name);
201
		IContentType contentType = CCorePlugin.getContentType(project, name);
202
		if (contentType != null) {
202
		if (contentType != null) {
203
			String id = contentType.getId();
203
			String id = contentType.getId();
204
			if (CCorePlugin.CONTENT_TYPE_CHEADER.equals(id)) {
204
			return CCorePlugin.CONTENT_TYPE_CHEADER.equals(id)
205
				return true;
205
				|| CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(id)
206
			} else if (CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(id)) {
206
				|| CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)
207
				return true;
207
				|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)
208
			} else if (CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)) {
208
				|| CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id)
209
				return true;
209
				|| LanguageManager.getInstance().isContributedContentType(id);
210
			} else if (CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)) {
211
				return true;
212
			} else if (CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id)) {
213
				return true;
214
			}
215
		}
210
		}
216
		return false;
211
		return false;
217
	}
212
	}
Lines 239-251 Link Here
239
		IContentType contentType = CCorePlugin.getContentType(project, name);
234
		IContentType contentType = CCorePlugin.getContentType(project, name);
240
		if (contentType != null) {
235
		if (contentType != null) {
241
			String id = contentType.getId();
236
			String id = contentType.getId();
242
			if (CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)) {
237
			return CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)
243
				return true;
238
				|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)
244
			} else if (CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)) {
239
				|| CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id)
245
				return true;
240
				|| LanguageManager.getInstance().isContributedContentType(id);
246
			} else if (CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id)) {
247
				return true;
248
			}
249
		}
241
		}
250
		return false;
242
		return false;
251
	}
243
	}
(-)model/org/eclipse/cdt/core/model/ILanguage.java (+10 lines)
Lines 13-18 Link Here
13
13
14
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
14
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
15
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
15
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
16
import org.eclipse.cdt.core.model.addl_langs.IContributedModelBuilder;
16
import org.eclipse.core.resources.IFile;
17
import org.eclipse.core.resources.IFile;
17
import org.eclipse.core.resources.IProject;
18
import org.eclipse.core.resources.IProject;
18
import org.eclipse.core.resources.IStorage;
19
import org.eclipse.core.resources.IStorage;
Lines 95-98 Link Here
95
	 */
96
	 */
96
	public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset);
97
	public ASTCompletionNode getCompletionNode(IWorkingCopy workingCopy, int offset);
97
98
99
	/**
100
	 * Used to override the default model building behavior for a translation unit.
101
	 * 
102
	 * @param  tu  the <code>TranslationUnit</code> to be parsed (non-<code>null</code>)
103
	 * @return an <code>IModelBuilder</code>, which parses the given translation unit and
104
	 *         returns the <code>ICElement</code>s of its model, or <code>null</code>
105
	 *         to parse using the default CDT model builder
106
	 */
107
	public IContributedModelBuilder createModelBuilder(org.eclipse.cdt.internal.core.model.TranslationUnit tu);
98
}
108
}
(-)model/org/eclipse/cdt/core/model/LanguageManager.java (+43 lines)
Lines 11-17 Link Here
11
11
12
package org.eclipse.cdt.core.model;
12
package org.eclipse.cdt.core.model;
13
13
14
import java.util.ArrayList;
15
14
import org.eclipse.cdt.core.CCorePlugin;
16
import org.eclipse.cdt.core.CCorePlugin;
17
import org.eclipse.cdt.core.model.addl_langs.IContributedModelBuilder;
18
import org.eclipse.cdt.internal.core.model.TranslationUnit;
15
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IConfigurationElement;
17
import org.eclipse.core.runtime.IExtension;
21
import org.eclipse.core.runtime.IExtension;
Lines 70-73 Link Here
70
		}
74
		}
71
		return null;
75
		return null;
72
	}
76
	}
77
	
78
	public ArrayList/*<String>*/ getAllContentTypes() {
79
		ArrayList/*<String>*/ allTypes = new ArrayList();
80
		allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE);
81
		allTypes.add(CCorePlugin.CONTENT_TYPE_CHEADER);
82
		allTypes.add(CCorePlugin.CONTENT_TYPE_CSOURCE);
83
		allTypes.add(CCorePlugin.CONTENT_TYPE_CXXHEADER);
84
		allTypes.add(CCorePlugin.CONTENT_TYPE_CXXSOURCE);
85
86
		IContentTypeManager manager = Platform.getContentTypeManager(); 
87
		IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, ILanguage.KEY);
88
		IExtension[] extensions = point.getExtensions();
89
		for (int i = 0; i < extensions.length; ++i) {
90
			IConfigurationElement[] languages = extensions[i].getConfigurationElements();
91
			for (int j = 0; j < languages.length; ++j) {
92
				IConfigurationElement language = languages[j];
93
				IConfigurationElement[] contentTypes = language.getChildren("contentType"); //$NON-NLS-1$
94
				for (int k = 0; k < contentTypes.length; ++k) {
95
					IContentType langContType = manager.getContentType(contentTypes[k].getAttribute("id")); //$NON-NLS-1$
96
					allTypes.add(langContType.getId());
97
				}
98
			}
99
		}
100
		
101
		return allTypes;
102
	}
103
104
	public boolean isContributedContentType(String contentTypeId) {
105
		return getAllContentTypes().contains(contentTypeId);
106
	}
107
	
108
	public IContributedModelBuilder getContributedModelBuilderFor(TranslationUnit tu) {
109
		try {
110
			ILanguage lang = tu.getLanguage();
111
			return lang == null ? null : lang.createModelBuilder(tu);
112
		} catch (CoreException e) {
113
			return null;
114
		}
115
	}
73
}
116
}
(-)model/org/eclipse/cdt/internal/core/model/TranslationUnit.java (-3 / +43 lines)
Lines 14-19 Link Here
14
import java.util.ArrayList;
14
import java.util.ArrayList;
15
import java.util.HashMap;
15
import java.util.HashMap;
16
import java.util.Map;
16
import java.util.Map;
17
import java.util.Set;
17
18
18
import org.eclipse.cdt.core.CCorePlugin;
19
import org.eclipse.cdt.core.CCorePlugin;
19
import org.eclipse.cdt.core.model.CModelException;
20
import org.eclipse.cdt.core.model.CModelException;
Lines 31-36 Link Here
31
import org.eclipse.cdt.core.model.IUsing;
32
import org.eclipse.cdt.core.model.IUsing;
32
import org.eclipse.cdt.core.model.IWorkingCopy;
33
import org.eclipse.cdt.core.model.IWorkingCopy;
33
import org.eclipse.cdt.core.model.LanguageManager;
34
import org.eclipse.cdt.core.model.LanguageManager;
35
import org.eclipse.cdt.core.model.addl_langs.IContributedModelBuilder;
34
import org.eclipse.core.resources.IFile;
36
import org.eclipse.core.resources.IFile;
35
import org.eclipse.core.resources.IResource;
37
import org.eclipse.core.resources.IResource;
36
import org.eclipse.core.runtime.CoreException;
38
import org.eclipse.core.runtime.CoreException;
Lines 279-285 Link Here
279
		return location;
281
		return location;
280
	}
282
	}
281
283
282
	protected IFile getFile() {
284
	public IFile getFile() {
283
		IResource res = getResource();
285
		IResource res = getResource();
284
		if (res instanceof IFile) {
286
		if (res instanceof IFile) {
285
			return (IFile)res;
287
			return (IFile)res;
Lines 580-589 Link Here
580
	/**
582
	/**
581
	 * Parse the buffer contents of this element.
583
	 * Parse the buffer contents of this element.
582
	 */
584
	 */
583
	private void parse(Map newElements){
585
	private void parse(Map newElements) {
586
		boolean quickParseMode = ! (CCorePlugin.getDefault().useStructuralParseMode());
587
		IContributedModelBuilder mb = LanguageManager.getInstance().getContributedModelBuilderFor(this);
588
		if (mb == null) {
589
			parseUsingCModelBuilder(newElements, quickParseMode);
590
		} else {
591
			parseUsingContributedModelBuilder(mb, quickParseMode);
592
		}
593
	}
594
595
	/**
596
	 * Parse the buffer contents of this element.
597
	 */
598
	private void parseUsingCModelBuilder(Map newElements, boolean quickParseMode) {
584
		try {
599
		try {
585
			CModelBuilder modelBuilder = new CModelBuilder(this, newElements);
600
			CModelBuilder modelBuilder = new CModelBuilder(this, newElements);
586
			boolean quickParseMode = ! (CCorePlugin.getDefault().useStructuralParseMode());
587
			modelBuilder.parse(quickParseMode);
601
			modelBuilder.parse(quickParseMode);
588
		} catch (Exception e) {
602
		} catch (Exception e) {
589
			// use the debug log for this exception.
603
			// use the debug log for this exception.
Lines 591-596 Link Here
591
		}							
605
		}							
592
	}
606
	}
593
	
607
	
608
	private void parseUsingContributedModelBuilder(IContributedModelBuilder mb, boolean quickParseMode) {
609
		try {
610
			mb.parse(quickParseMode);
611
		} catch (Exception e) {
612
			// use the debug log for this exception.
613
			Util.debugLog( "Exception in contributed model builder", IDebugLogConstants.MODEL);  //$NON-NLS-1$
614
		}
615
	}
616
	
594
	public IProblemRequestor getProblemRequestor() {
617
	public IProblemRequestor getProblemRequestor() {
595
		return problemRequestor;
618
		return problemRequestor;
596
	}
619
	}
Lines 613-618 Link Here
613
				CCorePlugin.CONTENT_TYPE_CSOURCE.equals(contentTypeId)
636
				CCorePlugin.CONTENT_TYPE_CSOURCE.equals(contentTypeId)
614
				|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(contentTypeId)
637
				|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(contentTypeId)
615
				|| CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(contentTypeId)
638
				|| CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(contentTypeId)
639
				|| LanguageManager.getInstance().isContributedContentType(contentTypeId)
616
				);
640
				);
617
	}
641
	}
618
642
Lines 695-698 Link Here
695
		}
719
		}
696
		super.closing(info);
720
		super.closing(info);
697
	}
721
	}
722
723
	/**
724
	 * Contributed languages' model builders need to be able to indicate whether or
725
	 * not the parse of a translation unit was successful without having access to
726
	 * the <code>CElementInfo</code> object associated with the translation unit
727
	 * 
728
	 * @param wasSuccessful
729
	 * @throws CModelException
730
	 */
731
	public void setIsStructureKnown(boolean wasSuccessful) {
732
		try {
733
			this.getElementInfo().setIsStructureKnown(wasSuccessful);
734
		} catch (CModelException e) {
735
			;
736
		}
737
	}
698
}
738
}
(-)model/org/eclipse/cdt/core/model/addl_langs/IContributedCElement.java (+40 lines)
Added Link Here
1
package org.eclipse.cdt.core.model.addl_langs;
2
3
import org.eclipse.cdt.core.model.ICElement;
4
5
/**
6
 * Additions to the <code>ICElement</code> hierarchy provided by
7
 * contributed languages.
8
 * 
9
 * @author Jeff Overbey
10
 */
11
public interface IContributedCElement extends ICElement {
12
	/**
13
	 * @return an <code>ImageDescriptor</code> for displaying alongside the
14
	 *         element in the Outline (or similar view)
15
	 *         
16
	 * The return type is <code>Object</code> for now so that we don't
17
	 * have JFace as a dependency.
18
	 * 
19
	 * Note...
20
	 * 
21
	 * In the <code>ICElement</code> hierarchy, icons are determined by a
22
	 * giant <code>case</code> statement in
23
	 * <code>CElementImageProvider#getBaseImageDescriptor</code>. Since
24
	 * <code>case</code> statements based on types are bad (and error-prone)
25
	 * and we prefer to have everything in one place, we simply ask each
26
	 * <code>FortranElement</code> to tell us what its pictorial
27
	 * representation is. Yeah, if you want to argue that this is user interface
28
	 * stuff, it's in the wrong place... but for us, the chances are much higher
29
	 * that we will change the hierarchy than change the icons, so putting
30
	 * everything in one place is a better move.
31
	 * 
32
	 * To make this work, at the top of
33
	 * <code>CElementImageProvider#getBaseImageDescriptor</code>, I added
34
	 * these lines: <code>
35
	 * if (celement instanceof FortranElement)
36
	 *     return ((FortranElement)celement).getBaseImageDescriptor();
37
	 * </code>
38
	 */
39
	public abstract Object getBaseImageDescriptor();
40
}
(-)model/org/eclipse/cdt/core/model/addl_langs/IContributedModelBuilder.java (+26 lines)
Added Link Here
1
package org.eclipse.cdt.core.model.addl_langs;
2
3
/**
4
 * Interface supported by model builders for contributed languages.
5
 * 
6
 * Model builders parse a <code>TranslationUnit</code> (i.e., a file) and
7
 * return a hierarchy of <code>ICElement</code>s which represent the high-level
8
 * structure of that file (what modules, classes, functions, and similar
9
 * constructs are contained in it, and on what line(s) the definition occurs).
10
 * 
11
 * The translation unit to parse and the initial element map are given to
12
 * <code>IAdditionalLanguage#createModelBuilder</code>, which will presumably
13
 * pass that information on to the model builder constructor.
14
 * 
15
 * @author Jeff Overbey
16
 */
17
public interface IContributedModelBuilder {
18
	/**
19
	 * Callback used when a <code>TranslationUnit</code> needs to be parsed.
20
	 * 
21
	 * The translation unit to parse is given to
22
	 * <code>ILanguage#createModelBuilder</code>, which will presumably
23
	 * pass it on to the model builder constructor.
24
	 */
25
	public abstract void parse(boolean quickParseMode) throws Exception;
26
}
(-)src/org/eclipse/cdt/internal/ui/viewsupport/CElementImageProvider.java (-1 / +6 lines)
Lines 19-30 Link Here
19
import org.eclipse.cdt.core.model.ICProject;
19
import org.eclipse.cdt.core.model.ICProject;
20
import org.eclipse.cdt.core.model.IDeclaration;
20
import org.eclipse.cdt.core.model.IDeclaration;
21
import org.eclipse.cdt.core.model.IField;
21
import org.eclipse.cdt.core.model.IField;
22
import org.eclipse.cdt.core.model.ILibraryReference;
23
import org.eclipse.cdt.core.model.IIncludeReference;
22
import org.eclipse.cdt.core.model.IIncludeReference;
23
import org.eclipse.cdt.core.model.ILibraryReference;
24
import org.eclipse.cdt.core.model.IMethodDeclaration;
24
import org.eclipse.cdt.core.model.IMethodDeclaration;
25
import org.eclipse.cdt.core.model.ISourceRoot;
25
import org.eclipse.cdt.core.model.ISourceRoot;
26
import org.eclipse.cdt.core.model.ITemplate;
26
import org.eclipse.cdt.core.model.ITemplate;
27
import org.eclipse.cdt.core.model.ITranslationUnit;
27
import org.eclipse.cdt.core.model.ITranslationUnit;
28
import org.eclipse.cdt.core.model.addl_langs.IContributedCElement;
28
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
29
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
29
import org.eclipse.cdt.internal.ui.CPluginImages;
30
import org.eclipse.cdt.internal.ui.CPluginImages;
30
import org.eclipse.cdt.ui.CElementImageDescriptor;
31
import org.eclipse.cdt.ui.CElementImageDescriptor;
Lines 267-272 Link Here
267
	 * Returns an image descriptor for a C element. This is the base image, no overlays.
268
	 * Returns an image descriptor for a C element. This is the base image, no overlays.
268
	 */
269
	 */
269
	public ImageDescriptor getBaseImageDescriptor(ICElement celement, int renderFlags) {
270
	public ImageDescriptor getBaseImageDescriptor(ICElement celement, int renderFlags) {
271
		// JO -- Allow contributed languages to provide icons for their extensions to the ICElement hierarchy
272
		if (celement instanceof IContributedCElement)
273
		    return (ImageDescriptor)((IContributedCElement)celement).getBaseImageDescriptor();
274
		
270
		int type = celement.getElementType();
275
		int type = celement.getElementType();
271
		switch (type) {
276
		switch (type) {
272
			case ICElement.C_VCONTAINER:
277
			case ICElement.C_VCONTAINER:

Return to bug 133386