Swift Language support#11
Conversation
-Cloned from https://github.com/quiqueg/Swift-Sublime-Package.git -Removed the .git folder. (I'm thinking it doesn't make sense for it to be a submodule, it makes more sense to be a copy.) -Converted with sublime_syntax_convertor
Removes JSON-tmLanguage and YAML-tmLanguge files. These files aren't used or recognized by Xi. The .tmPreferences and .tmLangage files were moved into the Swift folder instead of a subfolder.
|
@matthiassaihttam Cool, thanks, this will be a good addition. Do you have a sense of how up-to-date this syntax is? 2014 is a while ago, but I guess most major language features were in place by then? @mmatoszko Would you like to take a look at this? You were mentioning swift syntax support at some point. @naclcaleb would also be curious for you to try this out. :) |
|
That's a good point; Apple has been iterating with Swift relatively quickly. This the most recent I could quickly find, and I think it's still the most popular Sublime Swift package. (So think this would be the same syntax Sublime users are getting, but it would nice if someone could confirm.) I could check what Atom uses for syntax highlighting, and if that's more up to date, but I still don't know if that could be converted to .sublime-syntax easily. |
|
I believe both atom and vscode use some variant of textmate syntaxes, so conversion should be possible with some utility? |
|
Atom's primary Swift package was last updated 3 years ago (late 2016). I am skeptical that there's a advantage to using a slightly newer version; the Sublime package I used was last updated 3 years ago (2016), and mentions Swift 3. (But I also don't use Swift enough to really know what features could be missing.) |
|
I believe the current version is Swift 5, though I think the jump from 2 to 3 was the most dramatic change. |
|
@cmyr, are you saying you want me to try the new syntax highlighting in the PR? I would try it, but I haven't actually been able to get Xi to compile because my Mac uses Swift 5 and it only supports up to 3 (or 4?) |
|
@naclcaleb To clarify, you're using Xcode 10.x, and you can't get xi-mac to compile? |
|
@cmyr Yes, I'm using Xcode v10.1 |
|
Okay, well xi-mac should compile fine there. Maybe open an issue in the xi-mac repo and we can figure out what's going on? |
|
Ok, here you go: xi-editor/xi-mac#465 |
|
I feel like the Swift syntax highlighting isn't that different from some other ones like JS. |
|
@naclcaleb oops, missed this comment, sorry! You could certainly try to start a new sytanx def based on JS, but I think you would have better luck starting with an existing swift syntax and updating that? |

Similar procedure and reasoning to #9. Will close #8, and replaces #10.