Return true iff func_node's name is __init__ or __post_init__. */
| 4415 | |
| 4416 | /* Return true iff func_node's name is __init__ or __post_init__. */ |
| 4417 | static bool py_is_init_method(PyLSPContext *ctx, TSNode func_node) { |
| 4418 | TSNode name = ts_node_child_by_field_name(func_node, "name", 4); |
| 4419 | if (ts_node_is_null(name)) |
| 4420 | return false; |
| 4421 | char *nm = py_node_text(ctx, name); |
| 4422 | return nm && (strcmp(nm, "__init__") == 0 || strcmp(nm, "__post_init__") == 0); |
| 4423 | } |
| 4424 | |
| 4425 | /* Decorator expressions of a decorated definition, in source order. They |
| 4426 | * evaluate in the scope enclosing the definition, before it is bound. A bare |
no test coverage detected