From b453ede83c7ad1614ffd9546b9be6cf97af609f6 Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Fri, 27 May 2005 18:16:29 +0000 Subject: [PATCH] Return search results for include references --- .../core/search/matching/IncludePattern.java | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java index d2f1c7c4ffb..50e32794b75 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java @@ -13,15 +13,25 @@ package org.eclipse.cdt.internal.core.search.matching; import java.io.IOException; +import org.eclipse.cdt.core.browser.PathUtil; +import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; import org.eclipse.cdt.core.parser.ast.IASTInclusion; +import org.eclipse.cdt.core.search.BasicSearchMatch; import org.eclipse.cdt.core.search.ICSearchScope; +import org.eclipse.cdt.core.search.LineLocatable; +import org.eclipse.cdt.core.search.OffsetLocatable; import org.eclipse.cdt.internal.core.CharOperation; import org.eclipse.cdt.internal.core.index.IEntryResult; +import org.eclipse.cdt.internal.core.index.IIndex; import org.eclipse.cdt.internal.core.index.cindexstorage.Index; import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry; import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput; import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; /** * @author bgheorgh @@ -51,10 +61,37 @@ public class IncludePattern extends CSearchPattern { for (int i = 0, max = fileRefs.length; i < max; i++) { IndexedFileEntry file = input.getIndexedFile(fileRefs[i]); - String path; + String path=null; if (file != null && scope.encloses(path =file.getPath())) { requestor.acceptIncludeDeclaration(path, decodedSimpleName); } + + for (int j=0; j