FoundUsage (@NotNull Project project, @NotNull Usage usage) { PortableFilePath portableFilePath = null; Integer line = null; if (usage instanceof UsageInfo2UsageAdapter adapter) { VirtualFile file = ReadAction.compute(() -> adapter.getFile()); if (file != null) { portableFilePath = PortableFilePaths.INSTANCE.getPortableFilePath(file, project); } line = adapter.getLine() + 1; } String text = ReadAction.compute(() -> usage.getPresentation().getPlainText()); return new FoundUsage(text, portableFilePath, line); }