You could try submitting an Apple Feedback ticket for this.
Technically, since a lot of Xcode's knowledge of Swift source comes from the compiler toolchain (highlighting, code completion, refactoring, etc), and the compiler is capable of cross-compiling, it should be possible to allow you to set the flags which tell Xcode's compiler-driven tools to use a different target platform (and some form of this surely already exists to support iOS/watchOS/tvOS development on a Mac).
It would enable a lot of workflows just like yours - library and server developers could download a pre-packaged Linux cross-compile toolchain and quickly test that their code builds on Linux, while editing and prototyping on their Macs in the familiar Xcode interface.
So it seems like a reasonable thing to ask for, but it's ultimately up to Apple's Xcode team. Send a Feedback.