1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

use getTranslationUnitextensions()

This commit is contained in:
Alain Magloire 2003-01-23 16:55:58 +00:00
parent b75ef61e20
commit 61fca42a17

View file

@ -5,6 +5,7 @@ package org.eclipse.cdt.internal.ui.editor;
* All Rights Reserved.
*/
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.internal.ui.CPluginImages;
import org.eclipse.cdt.ui.CUIPlugin;
@ -85,10 +86,15 @@ public class SearchForReferencesAction extends Action {
//TextSearchEngine engine = new TextSearchEngine();
TextSearchScope scope= TextSearchScope.newWorkspaceScope();
// Add the extensions from the C editor definition for now
scope.addExtension("c");
scope.addExtension("h");
scope.addExtension("cc");
scope.addExtension("hh");
// FIXME: For C/C++ not all files rely on extension to be C++ for <cstring>
String[] cexts = CoreModel.getDefault().getTranslationUnitExtensions();
for (int i = 0; i < cexts.length; i++) {
scope.addExtension("*." + cexts[i]);
}
// scope.addExtension("*.c");
// scope.addExtension("*.h");
// scope.addExtension("*.cc");
// scope.addExtension("*.hh");
TextSearchOperation op= new TextSearchOperation(
CUIPlugin.getWorkspace(),