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