FileViewProvider (@NotNull VirtualFile vFile) { assert !vFile.isDirectory(); FileViewProvider viewProvider = findCachedViewProvider(vFile); if (viewProvider != null) return viewProvider; if (vFile instanceof VirtualFileWindow) { throw new IllegalStateException("File " + vFile + " is invalid"); } Map<VirtualFile, FileViewProvider> tempMap = myTempProviders.get(); if (tempMap.containsKey(vFile)) { return Objects.requireNonNull(tempMap.get(vFile), "Recursive file view provider creation"); } viewProvider = createFileViewProvider(vFile, !LightVirtualFile.shouldSkipEventSystem(vFile)); if (vFile instanceof LightVirtualFile) { checkLightFileHasNoOtherPsi((LightVirtualFile)vFile); return vFile.putUserDataIfAbsent(myPsiHardRefKey, viewProvider); } return ConcurrencyUtil.cacheOrGet(getVFileToViewProviderMap(), vFile, viewProvider); }