Awesome
TextMate Swift Completions
This is a plugin which enables Swift Auto Completions from within TextMate.
This is still very basic, and more or less a proof-of-concept. I don't use TextMate anymore, so I doubt I'll continue working on this, however I hope avid TextMate users pick up where I stopped. If you'd like to extend this, feel free to create a pull request.
Features
- Auto Completions using SourceKittenDaemon
- Select Daemon with Configuration (i.e. allows working on multiple projects at the same time)
Installation
-
You'll need SourceKittenDaemon installed, so head over there and install the latest release.
-
Download the TextMateSwiftCompletion.tmbundle, and double-click it, so that it can be installed in TextMate
Usage
-
Once TextMate started, there should be a new menu entry under the
Window
namedSwift Completion
. There're two menu entries, the second will be grayed out. -
Click the
Swift Project Settings
Menu Entry. -
Now you'll have to open a Terminal and start the SourceKittenDaemon for an Xcode project of your choice on a free local port:
Example:
SourceKittenDaemon start --port 44876 --project /private/tmp/abcde/abcde.xcodeproj
-
Enter the selected port in the TextMate Swift Setup window
-
Click
Test Connection
. If the connection fails, open an Issue on GitHub ;) -
Click "Close"
-
Now you can open a Swift file from your Xcode project.
-
Navigate somewhere and get completions via the "Command-Shift-." (Period) keyboard shortcut.
State
This is more or less a proof of concept, so the code is really awful. Also, since TextMate has no official plugin API or Completion API (which I could find), completions do not look very integrated into the editor. Still, they work. Also, I don't use TextMate. I've developed this more or less to have a reference implementation people can build on.
Contributing
Just check out the repository. It expects TextMate to be installed in /Applications. When you build the repository, it will kill the current TextMate app, so make sure you don't have anything important in there. Building the Bundle will automatically install it in TextMate, that way you can just restart TextMate and try it out.
Pull Requests very Welcome.