Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IEP-928: Workspace hangs if project is closed while indexer is running #812

Merged
merged 4 commits into from
Sep 15, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobGroup;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
Expand Down Expand Up @@ -124,7 +127,7 @@ public class IDFBuildConfiguration extends CBuildConfiguration
public static final String CMAKE_ENV = "cmake.environment"; //$NON-NLS-1$
public static final String BUILD_COMMAND = "cmake.command.build"; //$NON-NLS-1$
public static final String CLEAN_COMMAND = "cmake.command.clean"; //$NON-NLS-1$

private JobGroup jobGroup = new JobGroup("Parsing Job...", 1, 1); //$NON-NLS-1$
private ILaunchTarget launchtarget;
private Map<IResource, IScannerInfo> infoPerResource;
/**
Expand Down Expand Up @@ -971,11 +974,26 @@ public void clean(IConsole console, IProgressMonitor monitor) throws CoreExcepti
private void processCompileCommandsFile(IConsole console, IProgressMonitor monitor) throws CoreException
{
IFile file = getCompileCommandsJsonFile(monitor);

CompileCommandsJsonParser parser = new CompileCommandsJsonParser(
new ParseRequest(file, new CMakeIndexerInfoConsumer(this::setScannerInformation, getProject()),
CommandLauncherManager.getInstance().getCommandLauncher(this), console));
parser.parse(monitor);
Job parseJob = new Job("Parse Compile Commands File") //$NON-NLS-1$
{
protected IStatus run(IProgressMonitor monitor)
{
try
{
parser.parse(monitor);
}
catch (CoreException e)
{
Logger.log(e);
}
return Status.OK_STATUS;
}
};
parseJob.setJobGroup(jobGroup);
parseJob.schedule();
}

private IFile getCompileCommandsJsonFile(IProgressMonitor monitor) throws CoreException
Expand Down