MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / is_fish_function_parameter

Function is_fish_function_parameter

internal/cbm/extract_usages.c:765–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763}
764
765static bool is_fish_function_parameter(CBMExtractCtx *ctx, TSNode node, WalkState *state) {
766 if (strcmp(ts_node_type(node), "word") != 0) {
767 return false;
768 }
769 TSNode definition = ts_node_parent(node);
770 const char *field =
771 ts_node_is_null(definition) ? NULL : field_name_for_walk_node(state, definition, node);
772 if (!field || strcmp(field, "option") != 0 ||
773 strcmp(ts_node_type(definition), "function_definition") != 0) {
774 return false;
775 }
776 for (TSNode previous = ts_node_prev_named_sibling(node); !ts_node_is_null(previous);
777 previous = ts_node_prev_named_sibling(previous)) {
778 char *text = cbm_node_text(ctx->arena, previous, ctx->source);
779 if (!text || text[0] != '-') {
780 continue;
781 }
782 return fish_argument_marker(ctx, previous);
783 }
784 return false;
785}
786
787static bool is_tcl_procedure_parameter(TSNode node) {
788 TSNode argument = ts_node_parent(node);

Callers 1

Calls 3

field_name_for_walk_nodeFunction · 0.85
cbm_node_textFunction · 0.85
fish_argument_markerFunction · 0.85

Tested by

no test coverage detected