@@ -2192,9 +2192,9 @@ static void extract_call_args(CBMExtractCtx *ctx, TSNode args, CBMCall *call) {
21922192 if (is_string_like (ak ) && ca -> expr ) {
21932193 ca -> value = strip_quotes (ctx -> arena , ca -> expr );
21942194 } else if (strcmp (ak , "template_string" ) == 0 ) {
2195- /* Flattened {} form so downstream url-arg detection joins the
2196- * canonical server route shape (issue #1006/#1009). */
2197- ca -> value = cbm_template_string_text ( ctx -> arena , arg_node , ctx -> source );
2195+ /* Resolve known constants; dynamic substitutions keep the route placeholder. */
2196+ ca -> value = cbm_template_string_text ( ctx -> arena , arg_node , ctx -> source ,
2197+ & ctx -> string_constants );
21982198 } else if (strcmp (ak , "identifier" ) == 0 && ca -> expr ) {
21992199 ca -> value = lookup_string_constant (ctx , ca -> expr );
22002200 } else if (strcmp (ak , "object" ) == 0 ) {
@@ -2259,7 +2259,8 @@ static bool is_queue_topic_field(const char *key) {
22592259static const char * extract_string_value (CBMExtractCtx * ctx , TSNode val_node ) {
22602260 const char * vk = ts_node_type (val_node );
22612261 if (strcmp (vk , "template_string" ) == 0 ) {
2262- return cbm_template_string_text (ctx -> arena , val_node , ctx -> source );
2262+ return cbm_template_string_text (ctx -> arena , val_node , ctx -> source ,
2263+ & ctx -> string_constants );
22632264 }
22642265 if (is_string_like (vk )) {
22652266 char * text = cbm_node_text (ctx -> arena , val_node , ctx -> source );
@@ -2434,10 +2435,10 @@ static TSNode swift_unwrap_url_constructor(CBMExtractCtx *ctx, TSNode arg) {
24342435}
24352436
24362437static const char * extract_positional_url (CBMExtractCtx * ctx , TSNode arg , const char * ak ) {
2437- /* JS/TS template literals: `/things/${id}` normalizes to "/things/{}" so the
2438- * client URL joins the server route's canonical placeholder (issue #1006). */
2438+ /* Resolve constants while keeping dynamic route parts in canonical form. */
24392439 if (strcmp (ak , "template_string" ) == 0 ) {
2440- const char * flat = cbm_template_string_text (ctx -> arena , arg , ctx -> source );
2440+ const char * flat = cbm_template_string_text (ctx -> arena , arg , ctx -> source ,
2441+ & ctx -> string_constants );
24412442 if (flat ) {
24422443 return strip_and_validate_string_arg (ctx -> arena , (char * )flat );
24432444 }
0 commit comments