chrisbarrett/swift-mode — pull request #23 by ap4y (2014-07-01 09:35:51+00:00)
Title: Make flycheck work with multiple sources

This PR improves `flycheck` support for projects. Current version doesn't provide referenced classes for checked buffer. I discovered that we can use underlying `parse` command from `swift` compiler fronted with `-primary-file` to resolve this issue.

The way I make it work with my project is to provide all `swift` sources to the compiler (`Xcode` compiles swift projects like that). It seems like `glob` syntax will be helpful in this case, so I make `flycheck` resolve provided `glob` before check. But I spotted couple issues related to globing:

- Globed results shouldn't contain file provided with `-primary-file` or compiler will complain about redeclaration;
- Globed results shouldn't contain emacs interlock file, it has `.swift` extension.

I had to filter this cases from the glob results.