String (int startOffset, SliceUsage usage) { PsiFile file = usage.getElement().getContainingFile(); Editor editor = FileEditorManager.getInstance(file.getProject()).getSelectedTextEditor(); LogicalPosition position = editor.offsetToLogicalPosition(startOffset); return position + ": '" + StringUtil.first(file.getText().substring(startOffset), 100, true) + "'"; }