mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
Removed use of deprecated SubProgressMonitor .
Change-Id: I3d89d91f392ec914c69de086b2184ff3eef482ec
This commit is contained in:
parent
4303bc5cbb
commit
e68e933a2e
1 changed files with 8 additions and 6 deletions
|
@ -51,7 +51,7 @@ import org.eclipse.cdt.internal.core.index.composite.cpp.CPPCompositesFactory;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
import org.eclipse.core.runtime.SubMonitor;
|
||||||
|
|
||||||
public class CIndex implements IIndex {
|
public class CIndex implements IIndex {
|
||||||
/**
|
/**
|
||||||
|
@ -454,14 +454,15 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
List<IIndexBinding[]> result = new ArrayList<>();
|
List<IIndexBinding[]> result = new ArrayList<>();
|
||||||
ILinkage[] linkages = Linkage.getIndexerLinkages();
|
ILinkage[] linkages = Linkage.getIndexerLinkages();
|
||||||
monitor.beginTask(Messages.CIndex_FindBindingsTask_label, fFragments.length * linkages.length);
|
SubMonitor loopMonitor =
|
||||||
|
SubMonitor.convert(monitor, Messages.CIndex_FindBindingsTask_label, fFragments.length * linkages.length);
|
||||||
for (ILinkage linkage : linkages) {
|
for (ILinkage linkage : linkages) {
|
||||||
if (filter.acceptLinkage(linkage)) {
|
if (filter.acceptLinkage(linkage)) {
|
||||||
IIndexFragmentBinding[][] fragmentBindings = new IIndexFragmentBinding[fFragments.length][];
|
IIndexFragmentBinding[][] fragmentBindings = new IIndexFragmentBinding[fFragments.length][];
|
||||||
for (int i = 0; i < fFragments.length; i++) {
|
for (int i = 0; i < fFragments.length; i++) {
|
||||||
try {
|
try {
|
||||||
IBinding[] part = fFragments[i].findBindings(names,
|
IBinding[] part = fFragments[i].findBindings(names,
|
||||||
retargetFilter(linkage, filter), new SubProgressMonitor(monitor, 1));
|
retargetFilter(linkage, filter), loopMonitor.newChild(1));
|
||||||
fragmentBindings[i] = new IIndexFragmentBinding[part.length];
|
fragmentBindings[i] = new IIndexFragmentBinding[part.length];
|
||||||
System.arraycopy(part, 0, fragmentBindings[i], 0, part.length);
|
System.arraycopy(part, 0, fragmentBindings[i], 0, part.length);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
|
@ -685,12 +686,13 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
List<IIndexMacro> result = new ArrayList<>();
|
List<IIndexMacro> result = new ArrayList<>();
|
||||||
HashSet<IIndexFileLocation> handledIFLs= new HashSet<>();
|
HashSet<IIndexFileLocation> handledIFLs= new HashSet<>();
|
||||||
monitor.beginTask(Messages.CIndex_FindBindingsTask_label, fFragments.length);
|
SubMonitor loopMonitor =
|
||||||
|
SubMonitor.convert(monitor, Messages.CIndex_FindBindingsTask_label, fFragments.length);
|
||||||
for (IIndexFragment fragment : fFragments) {
|
for (IIndexFragment fragment : fFragments) {
|
||||||
HashSet<IIndexFile> allowedFiles= new HashSet<>();
|
HashSet<IIndexFile> allowedFiles= new HashSet<>();
|
||||||
try {
|
try {
|
||||||
IIndexMacro[] macros= fragment.findMacros(name, isPrefix, caseSensitive, filter,
|
IIndexMacro[] macros=
|
||||||
new SubProgressMonitor(monitor, 1));
|
fragment.findMacros(name, isPrefix, caseSensitive, filter, loopMonitor.newChild(1));
|
||||||
for (IIndexMacro indexMacro : macros) {
|
for (IIndexMacro indexMacro : macros) {
|
||||||
IIndexFile file= indexMacro.getFile();
|
IIndexFile file= indexMacro.getFile();
|
||||||
if (!allowedFiles.contains(file)) {
|
if (!allowedFiles.contains(file)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue