mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-25 06:33:13 +08:00
fix(extract): parse the first-branch projection under the terminated-last-line rule
Merging main brought #2340's virtual_newline field in CBMStringInput. cbm_rescue_defs_from_projection still built its input with the two-field initializer, a missing-field-initializers error under -Werror. The projection keeps the raw source's length and line structure, so it now goes through cbm_parse_source like the raw parse and the C++ branch views: the same virtual newline, and the same edit that removes it again. extraction pipeline graph_buffer store_search mcp registry edge_types_probe parse_coverage c_lsp test_impact_engine conditional_variants on the merge result: 2277 passed, 4 skipped. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
+3
-3
@@ -2571,10 +2571,10 @@ static void cbm_rescue_defs_from_projection(CBMExtractCtx *raw_ctx, const TSLang
|
||||
TSTree *tree = NULL;
|
||||
if (parser) {
|
||||
ts_parser_reset(parser);
|
||||
CBMStringInput input = {projected, (uint32_t)raw_ctx->source_len};
|
||||
TSInput ts_input = {&input, cbm_string_read, TSInputEncodingUTF8, NULL};
|
||||
TSParseOptions opts = {0};
|
||||
tree = ts_parser_parse_with_options(parser, NULL, ts_input, opts);
|
||||
/* The projection keeps the raw source's length and line structure,
|
||||
* so it is parsed under the same terminated-last-line rule (#2078). */
|
||||
tree = cbm_parse_source(parser, projected, (uint32_t)raw_ctx->source_len, opts);
|
||||
}
|
||||
CBMHashTable *held = tree ? cbm_ht_create(CBM_SZ_256) : NULL;
|
||||
if (held) {
|
||||
|
||||
Reference in New Issue
Block a user