Files
codebase-memory-mcp/tests
Joshua Richter eb80a4ecff fix(extraction): reach a Swift URL built by a constructor
Swift has no URL literal, so almost no real code passes a bare string to a
request. It writes URL(string: "https://…")! instead, and the literal then
sits two levels below the argument list: past the trailing "!", which the
grammar models as a postfix_expression, and inside the constructor's own
value_arguments.

extract_url_or_topic_arg saw only the outer node and gave up, so the URL
never reached the service-pattern table and no Route node formed. That is
the shape issue #1892 reported from a real project — reaching a bare string
argument was only the layer underneath it.

swift_unwrap_url_constructor() steps past both wrappers. It unwraps only
URL, URLComponents and URLRequest, so any other constructor keeps its own
meaning and the outer call does not borrow the inner call's string. A
non-literal argument such as URL(string: base + path) falls through to the
ordinary handling unchanged.

The value_argument unwrap added for the bare-string case is now
swift_argument_value(), because the nested argument list needs the same
step and the code was identical.

Refs #1892

Signed-off-by: Joshua Richter <jrichter5781@gmail.com>
2026-09-06 00:43:50 -04:00
..