use of com.jetbrains.python.psi.stubs.PyNamedParameterStub in project intellij-community by JetBrains.
the class PyNamedParameterImpl method getTypeCommentAnnotation.
@Nullable
@Override
public String getTypeCommentAnnotation() {
final PyNamedParameterStub stub = getStub();
if (stub != null) {
return stub.getTypeComment();
}
final PsiComment comment = getTypeComment();
if (comment != null) {
return PyTypingTypeProvider.getTypeCommentValue(comment.getText());
}
return null;
}
use of com.jetbrains.python.psi.stubs.PyNamedParameterStub in project intellij-community by JetBrains.
the class PyNamedParameterImpl method getDefaultValue.
@Nullable
public PyExpression getDefaultValue() {
final PyNamedParameterStub stub = getStub();
if (stub != null && !stub.hasDefaultValue()) {
return null;
}
ASTNode[] nodes = getNode().getChildren(PythonDialectsTokenSetProvider.INSTANCE.getExpressionTokens());
if (nodes.length > 0) {
return (PyExpression) nodes[0].getPsi();
}
return null;
}
Aggregations