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

Function doc_nearest_comment

internal/cbm/extract_defs.c:2119–2125  ·  view source on GitHub ↗

Index of the comment nearest the item, above its Rust attributes, or -1. */

Source from the content-addressed store, hash-verified

2117
2118/* Index of the comment nearest the item, above its Rust attributes, or -1. */
2119static int doc_nearest_comment(const doc_trivia_t *t) {
2120 int k = t->count - SKIP_ONE;
2121 while (k >= 0 && t->items[k].kind == DOC_SPAN_ATTR) {
2122 k--;
2123 }
2124 return (k >= 0 && t->items[k].kind == DOC_SPAN_COMMENT) ? k : CBM_NOT_FOUND;
2125}
2126
2127/* A nearer plain comment does not hide a doc-style comment directly above it
2128 * (a javadoc, then `// NOSONAR`): the index of that doc comment, else `near`. */

Callers 1

doc_from_triviaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected