mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
Cosmetics.
This commit is contained in:
parent
a9f41ac547
commit
3d7537fca6
3 changed files with 11 additions and 18 deletions
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.callhierarchy;
|
||||
|
||||
|
@ -42,7 +42,6 @@ import org.eclipse.cdt.internal.ui.viewsupport.WorkingSetFilterUI;
|
|||
* This is the content provider for the call hierarchy.
|
||||
*/
|
||||
public class CHContentProvider extends AsyncTreeContentProvider {
|
||||
|
||||
private static final IProgressMonitor NPM = new NullProgressMonitor();
|
||||
private boolean fComputeReferencedBy = true;
|
||||
private WorkingSetFilterUI fFilter;
|
||||
|
@ -79,13 +78,12 @@ public class CHContentProvider extends AsyncTreeContentProvider {
|
|||
if (node.isInitializer()) {
|
||||
return NO_CHILDREN;
|
||||
}
|
||||
}
|
||||
else if (node.isVariableOrEnumerator() || node.isMacro()) {
|
||||
} else if (node.isVariableOrEnumerator() || node.isMacro()) {
|
||||
return NO_CHILDREN;
|
||||
}
|
||||
|
||||
}
|
||||
// allow for async computation
|
||||
// Allow for async computation
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -122,8 +120,7 @@ public class CHContentProvider extends AsyncTreeContentProvider {
|
|||
fView.reportNotIndexed(input);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
element= IndexUI.attemptConvertionToHandle(index, input);
|
||||
final ICElement finalElement= element;
|
||||
getDisplay().asyncExec(new Runnable() {
|
||||
|
@ -146,8 +143,7 @@ public class CHContentProvider extends AsyncTreeContentProvider {
|
|||
}
|
||||
}
|
||||
return new Object[] { new CHNode(null, tu, 0, element, -1) };
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
index.releaseReadLock();
|
||||
}
|
||||
}
|
||||
|
@ -158,8 +154,7 @@ public class CHContentProvider extends AsyncTreeContentProvider {
|
|||
index.acquireReadLock();
|
||||
try {
|
||||
return CHQueries.findCalledBy(this, parent, index, NPM);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
index.releaseReadLock();
|
||||
}
|
||||
}
|
||||
|
@ -170,8 +165,7 @@ public class CHContentProvider extends AsyncTreeContentProvider {
|
|||
index.acquireReadLock();
|
||||
try {
|
||||
return CHQueries.findCalls(this, parent, index, NPM);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
index.releaseReadLock();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import org.eclipse.cdt.internal.core.model.ext.ICElementHandle;
|
|||
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.IndexUI;
|
||||
|
||||
|
||||
/**
|
||||
* Access to high level queries in the index.
|
||||
* @since 4.0
|
||||
|
@ -100,7 +99,6 @@ public class CHQueries {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static void findCalledBy2(IIndex index, IBinding callee, boolean includeOrdinaryCalls,
|
||||
ICProject project, CalledByResult result) throws CoreException {
|
||||
IIndexName[] names= index.findNames(callee, IIndex.FIND_REFERENCES | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES);
|
||||
|
@ -130,7 +128,7 @@ public class CHQueries {
|
|||
for (IIndexName name : refs) {
|
||||
IBinding binding= index.findBinding(name);
|
||||
if (CallHierarchyUI.isRelevantForCallHierarchy(binding)) {
|
||||
for(;;) {
|
||||
while (true) {
|
||||
ICElement[] defs= null;
|
||||
if (binding instanceof ICPPMethod) {
|
||||
defs = findOverriders(index, (ICPPMethod) binding);
|
||||
|
@ -154,7 +152,8 @@ public class CHQueries {
|
|||
}
|
||||
|
||||
/**
|
||||
* Searches for overriders of method and converts them to ICElement, returns null, if there are none.
|
||||
* Searches for overriders of method and converts them to ICElement, returns null,
|
||||
* if there are none.
|
||||
*/
|
||||
static ICElement[] findOverriders(IIndex index, ICPPMethod binding) throws CoreException {
|
||||
IBinding[] virtualOverriders= ClassTypeHelper.findOverriders(index, binding);
|
||||
|
|
|
@ -80,7 +80,7 @@ public class CallHierarchyUI {
|
|||
private static CHViewPart internalOpen(IWorkbenchWindow window, ICElement input) {
|
||||
IWorkbenchPage page= window.getActivePage();
|
||||
try {
|
||||
CHViewPart result= (CHViewPart)page.showView(CUIPlugin.ID_CALL_HIERARCHY);
|
||||
CHViewPart result= (CHViewPart) page.showView(CUIPlugin.ID_CALL_HIERARCHY);
|
||||
result.setInput(input);
|
||||
return result;
|
||||
} catch (CoreException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue