RangeMarker (@NotNull VirtualFile file, int line, int column, boolean persistent) { return ReadAction.compute(() -> { Document document = file.getFileType().isBinary() ? null : FileDocumentManager.getInstance().getCachedDocument(file); if (document != null) { int offset = DocumentUtil.calculateOffset(document, line, column, CodeStyle.getFacade(myProject, document, file.getFileType()).getTabSize()); return DocumentImpl.createRangeMarkerForVirtualFile(file, offset, line, column, line, column, persistent); } return DocumentImpl.createRangeMarkerForVirtualFile(file, 0, line, column, line, column, true); // must be persistent to be able to restore from line/col }); }