Only matter of time before CoPilot like systems (if they do not already) just reverse engineer the compilers to produce and link a dynamic syntax to know instances in plain-text source code of the “foreign” programming languages and render them within a language the user already understands; yes, there might be gaps in idioms, assuming a natively written language, but using example you provided, there in theory would not; ...and if need, return a final version in the target “foreign” programming language.
such systems might spring up, but the market is far more limited than for generalist CoPilot-like systems, and they will thus likely be less sophisticated and thus easier spot (by other automated solutions)
Might? This is the future of systems like CoPilot, reading existing source code only goes so far and it is only matter of time before the state of the art systems dynamically map compilers, even foreign ones, to source code. Once mapped, system will use its universal transcoder to remap the code to a know target language and even dynamically rewrite the compiler of the foreign language if appropriate to fill idiomatic gaps.
Ultimate end user for systems like these are not humans.