Result (@NotNull final String line, final int entireLength) { for (final TraceBackParser parser : TraceBackParser.PARSERS) { final LinkInTrace linkInTrace = parser.findLinkInTrace(line); if (linkInTrace == null) { continue; } final int lineNumber = linkInTrace.getLineNumber(); final VirtualFile vFile = findFileByName(linkInTrace.getFileName()); if (vFile != null) { if (!vFile.isDirectory()) { var extension = vFile.getExtension(); if (extension != null && !extension.equals("py")) { return null; } } final OpenFileHyperlinkInfo hyperlink = new OpenFileHyperlinkInfo(myProject, vFile, lineNumber - 1); final int textStartOffset = entireLength - line.length(); final int startPos = linkInTrace.getStartPos(); final int endPos = linkInTrace.getEndPos(); return new Result(startPos + textStartOffset, endPos + textStartOffset, hyperlink); } } return null; }