This repository was archived by the owner on Aug 24, 2019. It is now read-only.

Description
Hi, I was playing around with initial setup of the library.
It seems like the library recognises only a subset of the syntax (while the same file opened in TextMate is showing the full syntax highlight – not sure if it's relevant)

This is the code I used (more or less copied from the readme, slightly modified for Swift 2):
let samplePath = bundle.URLForResource("Sample", withExtension: "swift")!
let sample = try! String(contentsOfURL: samplePath)
let languagePath = bundle.URLForResource("Swift", withExtension: "tmLanguage")!
let languageDictionary = NSDictionary(contentsOfURL: languagePath) as! [NSObject: AnyObject]
let language = Language(dictionary: languageDictionary)!
let themeURL = bundle.URLsForResourcesWithExtension("tmTheme", subdirectory: nil)!.first!
let themeDictioanry = NSDictionary(contentsOfURL: themeURL) as! [NSObject: AnyObject]
let theme = Theme(dictionary: themeDictioanry)!
let parse = AttributedParser(language: language, theme: theme)
let attributedString = parse.attributedStringForString(sample)
Following is the playground (please rename to .zip and extract).
Is anything I'm doing look obviously wrong?
And a follow up question: is there a smarter way to figure out the language used for a file than the file extension? Extensions might be used by several languages: .h file might be either Objective-C or plain C; while .m is used for both Objective-C and Matlab.
Thanks a lot!