diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java index cd96e5888..c0545fe50 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java @@ -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; @@ -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 infoPerResource; /** @@ -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(Messages.IDFBuildConfiguration_ParseCommand) + { + 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 diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java index 21a634190..61ae9345b 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java @@ -23,6 +23,7 @@ public class Messages extends NLS public static String CMakeBuildConfiguration_Failure; public static String CMakeErrorParser_NotAWorkspaceResource; public static String IDFBuildConfiguration_CMakeBuildConfiguration_NoToolchainFile; + public static String IDFBuildConfiguration_ParseCommand; public static String IncreasePartitionSizeTitle; public static String IncreasePartitionSizeMessage; diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties index 5ded13421..60334dc76 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties @@ -15,6 +15,7 @@ CMakeBuildConfiguration_ProcCompJson=Processing compile_commands.json CMakeBuildConfiguration_Failure=Failure running cmake: %s\n CMakeErrorParser_NotAWorkspaceResource=Could not map %s to a workspace resource. Did the build run in a container? IDFBuildConfiguration_CMakeBuildConfiguration_NoToolchainFile=No toolchain file found +IDFBuildConfiguration_ParseCommand=Parse Compile Commands File IncreasePartitionSizeTitle=Low Application Partition Size IncreasePartitionSizeMessage=Less than 30% of application partition size is free({0} of {1} bytes), would you like to increase it? Please click here to check more details. ToolsInitializationDifferentPathMessageBoxTitle=Different IDF path found in the config file