Skip to content

Commit

Permalink
fix: prevent IJ from reporting an error when config file is deleted
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed May 3, 2024
1 parent 25ce1d6 commit 017b77b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.redhat.devtools.intellij.lsp4mp4ij.psi.internal.core.project.ConfigSourcePropertiesProvider;
import com.redhat.devtools.lsp4ij.LSPIJUtils;
import org.eclipse.lsp4mp.commons.utils.ConfigSourcePropertiesProviderUtils;
import org.eclipse.lsp4mp.commons.utils.IConfigSourcePropertiesProvider;
import org.eclipse.lsp4mp.commons.utils.PropertyValueExpander;
Expand Down Expand Up @@ -195,7 +196,7 @@ public void evictConfigSourcesCache(VirtualFile file) {
if (existingConfigSource != null) {
// The config source file exists, update / delete it from the cache
boolean updated = ReadAction.compute(() -> {
PsiFile psiFile = PsiManager.getInstance(javaProject.getProject()).findFile(file);
PsiFile psiFile = LSPIJUtils.getPsiFile(file, javaProject.getProject());
if (psiFile != null) {
// The config source file has been updated, reload it
existingConfigSource.reload(psiFile);
Expand Down

0 comments on commit 017b77b

Please sign in to comment.