String () { boolean needsParenthesis = PsiPrecedenceUtil.getPrecedence(myFileExpr) > PsiPrecedenceUtil.METHOD_CALL_PRECEDENCE; if (needsParenthesis) return "(" + myFileExpr.getText() + ").toPath()"; return myFileExpr.getText() + ".toPath()"; }