mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
Cache the source file list for an executable and don't block the UI while getting it.
This commit is contained in:
parent
50b3346cec
commit
0387684e7d
1 changed files with 2 additions and 1 deletions
|
@ -15,6 +15,7 @@ import org.eclipse.cdt.core.model.ITranslationUnit;
|
|||
import org.eclipse.cdt.debug.core.executables.Executable;
|
||||
import org.eclipse.cdt.ui.CElementContentProvider;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
|
||||
public class SourceFilesContentProvider extends CElementContentProvider {
|
||||
|
||||
|
@ -35,7 +36,7 @@ public class SourceFilesContentProvider extends CElementContentProvider {
|
|||
public Object[] getElements(Object inputElement) {
|
||||
if (inputElement instanceof Executable) {
|
||||
Executable executable = (Executable) inputElement;
|
||||
ITranslationUnit[] sourceFiles = executable.getSourceFiles();
|
||||
ITranslationUnit[] sourceFiles = executable.getSourceFiles(new NullProgressMonitor());
|
||||
if (sourceFiles.length == 0)
|
||||
return new String[] { Messages.SourceFilesContentProvider_NoFilesFound + executable.getName() };
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue