One difficulty is that dependency resolution need to be language-aware, to understand the semantics of #include, import, require, CLASSPATH, compiler -i flags etc etc.
Best would be if compiler could export this in a standard format for consumption by a build system. Like the language server.
Looking at build tools that try to be cross language, you have Bazel probably being the most serious contender, which often requires you to vendor your dependencies and rewrite the build files entirely in a different mindset than how upstream packaged it.
You are absolutely right, especially about understanding the semantics of importing code in each language. Fortunately, with few restrictions, it is possible to use hacks to simulate the effect, mostly.
Best would be if compiler could export this in a standard format for consumption by a build system. Like the language server.
Looking at build tools that try to be cross language, you have Bazel probably being the most serious contender, which often requires you to vendor your dependencies and rewrite the build files entirely in a different mindset than how upstream packaged it.