@@ -130,7 +130,8 @@ impl Backend {
130130 /// `paren_end` is the position one past the closing `)`.
131131 ///
132132 /// Returns subjects such as:
133- /// - `"app()"` for a standalone function call
133+ /// - `"app()"` for a standalone function call without arguments
134+ /// - `"app(A::class)"` for a function call with arguments (preserved)
134135 /// - `"$this->getService()"` for an instance method call
135136 /// - `"ClassName::make()"` for a static method call
136137 /// - `"ClassName"` for `new ClassName()` instantiation
@@ -140,6 +141,11 @@ impl Backend {
140141 return None ;
141142 }
142143
144+ // Capture the argument text between the parentheses for later use
145+ // in conditional return-type resolution (e.g. `app(A::class)`).
146+ let args_text: String = chars[ open + 1 ..paren_end - 1 ] . iter ( ) . collect ( ) ;
147+ let args_text = args_text. trim ( ) ;
148+
143149 // Read the function / method name before `(`
144150 let mut i = open;
145151 while i > 0
@@ -187,8 +193,13 @@ impl Backend {
187193 }
188194 }
189195
190- // Standalone function call: `app()`
191- Some ( format ! ( "{}()" , func_name) )
196+ // Standalone function call: preserve arguments for conditional
197+ // return-type resolution (e.g. `app(A::class)` instead of `app()`).
198+ if args_text. is_empty ( ) {
199+ Some ( format ! ( "{}()" , func_name) )
200+ } else {
201+ Some ( format ! ( "{}({})" , func_name, args_text) )
202+ }
192203 }
193204
194205 /// Raw helper: extract identifier/keyword before `::` without going
0 commit comments