diff --git a/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeBuildConfiguration.java b/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeBuildConfiguration.java index c2ee6a5fc70..1dc38a215d2 100644 --- a/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeBuildConfiguration.java +++ b/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeBuildConfiguration.java @@ -237,6 +237,7 @@ public class CMakeBuildConfiguration extends CBuildConfiguration implements ICMa } // parse compile_commands.json file + getCompileCommandsFile().refreshLocal(IResource.DEPTH_ZERO, monitor); processCompileCommandsFile(console, monitor); infoStream.write(String.format(Messages.CMakeBuildConfiguration_BuildingIn, buildDir.toString())); @@ -346,6 +347,10 @@ public class CMakeBuildConfiguration extends CBuildConfiguration implements ICMa } } + private IFile getCompileCommandsFile() throws CoreException { + return getBuildContainer().getFile(new org.eclipse.core.runtime.Path("compile_commands.json")); //$NON-NLS-1$ + } + /** * @param console the console to print the compiler output during built-ins detection to or * null if no separate console is to be allocated. Ignored if @@ -353,7 +358,7 @@ public class CMakeBuildConfiguration extends CBuildConfiguration implements ICMa * @param monitor the job's progress monitor */ private void processCompileCommandsFile(IConsole console, IProgressMonitor monitor) throws CoreException { - IFile file = getBuildContainer().getFile(new org.eclipse.core.runtime.Path("compile_commands.json")); //$NON-NLS-1$ + IFile file = getCompileCommandsFile(); CompileCommandsJsonParser parser = new CompileCommandsJsonParser( new ParseRequest(file, new CMakeIndexerInfoConsumer(this::setScannerInformation), CommandLauncherManager.getInstance().getCommandLauncher(this), console));