void (@NotNull VirtualFile vFile, @Nullable FileViewProvider viewProvider) { FileViewProvider prev = getRawCachedViewProvider(vFile); if (prev == viewProvider) return; if (prev != null) { DebugUtil.performPsiModification(null, () -> markInvalidated(prev)); } if (viewProvider == null) { getVFileToViewProviderMap().remove(vFile); vFile.putUserData(myPsiHardRefKey, null); } else if (vFile instanceof LightVirtualFile) { checkLightFileHasNoOtherPsi((LightVirtualFile)vFile); vFile.putUserData(myPsiHardRefKey, viewProvider); } else { getVFileToViewProviderMap().put(vFile, viewProvider); } }