mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Bug 534330 - Only create an index for the project containing the TU being analyzed in CxxModelsCache.getIndex()
Change-Id: I3391e1201b51ab32c35c73cfb2f861614da07057
This commit is contained in:
parent
77045f1942
commit
cc23d88b54
1 changed files with 1 additions and 4 deletions
|
@ -21,8 +21,6 @@ import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.index.IIndex;
|
import org.eclipse.cdt.core.index.IIndex;
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter;
|
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
|
@ -120,8 +118,7 @@ public class CxxModelsCache implements ICodanDisposable {
|
||||||
public synchronized IIndex getIndex() throws CoreException, OperationCanceledException {
|
public synchronized IIndex getIndex() throws CoreException, OperationCanceledException {
|
||||||
Assert.isTrue(!disposed, "CxxASTCache is already disposed."); //$NON-NLS-1$
|
Assert.isTrue(!disposed, "CxxASTCache is already disposed."); //$NON-NLS-1$
|
||||||
if (this.index == null) {
|
if (this.index == null) {
|
||||||
ICProject[] projects = CoreModel.getDefault().getCModel().getCProjects();
|
IIndex index = CCorePlugin.getIndexManager().getIndex(tu.getCProject());
|
||||||
IIndex index = CCorePlugin.getIndexManager().getIndex(projects);
|
|
||||||
try {
|
try {
|
||||||
index.acquireReadLock();
|
index.acquireReadLock();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue