-
Notifications
You must be signed in to change notification settings - Fork 65
Only a subset of syntax is highlighted #5
Comments
I got the exact same problem. Only parts are highlighted. Other are recognized but the attributes array is nil. Or do you think that this is a problem concerning the tmLanguage, tmTheme files ? When I open my test file in Textmate a lot more is colored than in my own NSTextView. |
Just had a look at this this morning and for me it looks like the library is working just fine. It seems like the plist(tmLanguage) file is missing entries and therefore the code is only party highlighted. |
I think I copied the bundle from the official repo. However I'll need to
|
Sure please report back. I only had a look at the Latex.tmLanguage file and it occured to me that there was no pattern for highlighting comments for example. |
Yeah, as I suspected, I just copied the language file from the official On Sat, Jul 25, 2015 at 11:43 AM David Ehlen notifications@github.com
|
Hi, Same for me. I have downloaded Swift.tmLanguage from the tm gh repo as well as the twilight theme. Tried a different tmLanguage, like markdown => No recognized pattern at all when parsing a md file Let me know if I can help in any way. Regards, |
Adding to my comments: The following Language initialization log is taken from Language() for Swift.tmLanguage. Here is an excerpt of the plist parsing which results from the execution of the "repository" parsing block at Language.swift:34: The log shows how the Swift.tmLanguage 'repository.optional-type' keyPath is parsed:
On the other hand, the plist itself for the same keyPath is:
I have no knowledge of the tmLanguage format but I noticed that the patterns keyPath within the repository.optional-type keyPath is translated as an array of 1 pattern with all nil values which seems to be a false interpretation of the plist data. Now, I'm pretty sure many other keyPaths are not parsed correctly. Which may have significant side effects on the recognition of patterns when the parser runs. Also the Language.patterns (for both Swift.tmLanguage and markdown) does contain many all-nil-values Pattern-s which seems to confirm that the parsing of tmLanguage files is not optimal Thanks and regards, |
Ya there's definitely some outstanding bugs. |
Here is a definition of the textmate grammar: http://manual.macromates.com/en/language_grammars#language_grammars. It looks like the include key is not parsed correctly in SyntaxKit. The different values a include key can hold are described in the link above. Is there any plan to fix this issue in the future ? It seems like this library was last updated quite a time ago. Cheers, |
This is amazingly helpful @dehlen! I didn't know this existed. I'll be using this library again in a project I'm working on in about 2 months, so I'll get started with some some tests and full support when I start using it again. Sorry I've been slow to work on this everyone. Watch the linked video above if you want to know why :) |
You don't have to be sorry. Open-Source is sharing and caring :) I am myself a bit stressed at the moment writing my thesis. However if I'll find time I'll might have a look at the outstanding bug. Keep up the amazingly good work. |
Thanks <3 |
The timing on this thread is really good. I came across this project last week and spent some time looking at the missing features in the |
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):
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!
The text was updated successfully, but these errors were encountered: