Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift Language support #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Packages/Swift/Comments.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.swift</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>// </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>/* </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string> */</string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>e4dfd8f5-d016-4899-b491-d46e5d32b3a3</string>
</dict>
</plist>
21 changes: 21 additions & 0 deletions Packages/Swift/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Matthew Alexander <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
41 changes: 41 additions & 0 deletions Packages/Swift/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Swift-Sublime-Package

Cloned from [Swift-Sublime-Package](https://github.com/quiqueg/Swift-Sublime-Package).

A [Sublime Text](http://www.sublimetext.com/) package for the [Swift programming language](https://developer.apple.com/swift/)

## Installation

### via Package Control (Recommended)
[Package Control](http://wbond.net/sublime_packages/package_control) is a package manager for Sublime Text 2 & 3. If you don't already have it installed, follow the [installation instructions here](https://sublime.wbond.net/installation).

Once Package Control is installed, restart Sublime and follow these steps:
* Open the Command Pallette (`cmd + shift + p` on OS X / Linux or `ctrl + shift + p` on Windows)
* Type "install" and select "Package Control: Install Package"
* Type "swift" and press Enter

All done! Package Control will automatically update the package whenever there's a new version.

## License

The MIT License (MIT)

Copyright (c) 2014 Matthew Alexander <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
7 changes: 7 additions & 0 deletions Packages/Swift/Snippets/Array.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<snippet>
<content><![CDATA[
Array<${1:Type}>
]]></content>
<tabTrigger>Array</tabTrigger>
<scope>source.swift</scope>
</snippet>
7 changes: 7 additions & 0 deletions Packages/Swift/Snippets/Dictionary.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<snippet>
<content><![CDATA[
Dictionary<${1:KeyType}, ${2:ValueType}>
]]></content>
<tabTrigger>Dictionary</tabTrigger>
<scope>source.swift</scope>
</snippet>
8 changes: 8 additions & 0 deletions Packages/Swift/Snippets/class-var.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<snippet>
<content><![CDATA[
class var ${1:name}
]]></content>
<tabTrigger>cv</tabTrigger>
<scope>source.swift</scope>
<description>class var ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/class.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
class ${1:name} {
$2
}
]]></content>
<tabTrigger>class</tabTrigger>
<scope>source.swift</scope>
<description>class ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/deinit.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
deinit {
$1
}
]]></content>
<tabTrigger>deinit</tabTrigger>
<scope>source.swift</scope>
<description>deinit {...}</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/didSet.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
didSet {
$1
}
]]></content>
<tabTrigger>didSet</tabTrigger>
<scope>source.swift</scope>
<description>didSet {...}</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/else-if.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
else if ${1:condition} {
$2
}
]]></content>
<tabTrigger>elif</tabTrigger>
<scope>source.swift</scope>
<description>else if ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/else.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
else {
$2
}
]]></content>
<tabTrigger>else</tabTrigger>
<scope>source.swift</scope>
<description>else ...</description>
</snippet>
9 changes: 9 additions & 0 deletions Packages/Swift/Snippets/enum.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
enum ${1:name} {
$2
}
]]></content>
<tabTrigger>enum</tabTrigger>
<scope>source.swift</scope>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/extension.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
extension ${1:name} {
$2
}
]]></content>
<tabTrigger>extension</tabTrigger>
<scope>source.swift</scope>
<description>extension ...</description>
</snippet>
9 changes: 9 additions & 0 deletions Packages/Swift/Snippets/func.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
func ${1:name}(${2:arguments}) -> ${3:ReturnType} {
$4
}
]]></content>
<tabTrigger>func</tabTrigger>
<scope>source.swift</scope>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/get.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
get {
$1
}
]]></content>
<tabTrigger>get</tabTrigger>
<scope>source.swift</scope>
<description>get {...}</description>
</snippet>
12 changes: 12 additions & 0 deletions Packages/Swift/Snippets/if-else.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<snippet>
<content><![CDATA[
if ${1:condition} {
$2
} else {
$3
}
]]></content>
<tabTrigger>ifelse</tabTrigger>
<scope>source.swift</scope>
<description>if ... else ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/if.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
if ${1:condition} {
$2
}
]]></content>
<tabTrigger>if</tabTrigger>
<scope>source.swift</scope>
<description>if ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/init.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
init(${1:parameters}) {
$2
}
]]></content>
<tabTrigger>init</tabTrigger>
<scope>source.swift</scope>
<description>init(...) {...}</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/operator.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
operator ${1:type} ${2:name} {
$3
}
]]></content>
<tabTrigger>operator</tabTrigger>
<scope>source.swift</scope>
<description>operator ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/protocol.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
protocol ${1:name} {
$2
}
]]></content>
<tabTrigger>protocol</tabTrigger>
<scope>source.swift</scope>
<description>protocol ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/set.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
set {
$1
}
]]></content>
<tabTrigger>set</tabTrigger>
<scope>source.swift</scope>
<description>set {...}</description>
</snippet>
8 changes: 8 additions & 0 deletions Packages/Swift/Snippets/static-var.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<snippet>
<content><![CDATA[
static var ${1:name}
]]></content>
<tabTrigger>sv</tabTrigger>
<scope>source.swift</scope>
<description>static var ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/struct.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
struct ${1:name} {
$2
}
]]></content>
<tabTrigger>struct</tabTrigger>
<scope>source.swift</scope>
<description>struct ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/subscript.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
subscript(${1:parameters}) -> ${2:ReturnType} {
$3
}
]]></content>
<tabTrigger>subscript</tabTrigger>
<scope>source.swift</scope>
<description>subscript ...</description>
</snippet>
9 changes: 9 additions & 0 deletions Packages/Swift/Snippets/swift.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
#!/usr/bin/env xcrun swift
$0
]]></content>
<tabTrigger>swift</tabTrigger>
<scope>source.swift</scope>
<description>#!/usr/bin/env xcrun swift</description>
</snippet>
11 changes: 11 additions & 0 deletions Packages/Swift/Snippets/switch.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<snippet>
<content><![CDATA[
switch ${1:control expression} {
case ${2:pattern}:
$3
}
]]></content>
<tabTrigger>switch</tabTrigger>
<scope>source.swift</scope>
<description>switch ...</description>
</snippet>
8 changes: 8 additions & 0 deletions Packages/Swift/Snippets/typealias.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<snippet>
<content><![CDATA[
typealias ${1:name} = ${2:Type}
]]></content>
<tabTrigger>typealias</tabTrigger>
<scope>source.swift</scope>
<description>typealias ... = ...</description>
</snippet>
10 changes: 10 additions & 0 deletions Packages/Swift/Snippets/willSet.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
willSet {
$1
}
]]></content>
<tabTrigger>willSet</tabTrigger>
<scope>source.swift</scope>
<description>willSet {...}</description>
</snippet>
Loading