private static TextRange getRelatedRange(PsiElement owner, Editor editor) {
    TextRange range = owner.getTextRange();
    if (range == null) return null;
    Document document = editor.getDocument();
    if (!Registry.is("editor.keep.completion.hints.longer")) return range;
    return new TextRange(DocumentUtil.getLineStartOffset(range.getStartOffset(), document),
                         DocumentUtil.getLineEndOffset(range.getEndOffset(), document));
  }
private static TextRange getRelatedRange(PsiElement owner, Editor editor)