Browse files

documentation popups, persistant framework cache

  • Loading branch information...
johncsnyder committed Mar 19, 2016
1 parent 57bc99b commit 06cedfe371c7ba3fe6396660319db5008773de17
Showing with 241 additions and 32 deletions.
  1. +3 −1 .gitignore
  2. +2 −1 Default.sublime-commands
  3. +9 −0 Default.sublime-keymap
  4. +35 −23
  5. +182 −7
  6. +10 −0 SwiftKitten.sublime-settings
  7. BIN docdemo.gif
@@ -4,4 +4,6 @@
@@ -1,3 +1,4 @@
{ "caption": "SwiftKitten: Clear Cache", "command": "swift_kitten_clear_cache" }
{ "caption": "SwiftKitten: Clear Cache", "command": "swift_kitten_clear_cache" },
{ "caption": "SwiftKitten: Display Documentation", "command": "swift_kitten_display_documentation" }
@@ -0,0 +1,9 @@
"keys": ["ctrl+alt+d"], "command": "swift_kitten_display_documentation",
"context" : [
{ "key": "selector", "operator": "equal", "operand": "source.swift" }
@@ -15,6 +15,8 @@ free to fork and submit a pull request.
### Installation
First, make sure to install [SourceKitten]( !
SwiftKitten is not yet available via Package Control (soon hopefully).
To install manually, clone this repository into your packages directory:
@@ -24,6 +26,7 @@ To install manually, clone this repository into your packages directory:
In Sublime, run `Preferences: Browse Packages` from the command palette
to find your packages directory.
### Dependencies
The dependencies are included with the SwiftKitten package.
@@ -64,7 +67,7 @@ cache timeout of one second ensures you will always be shown up-to-date results,
while preventing a barrage of unnecessary requests to SourceKitten.
To clear the cache manually, run `SwiftKitten: Clear Cache` from the command
palette (this clears the framework cache also).
@@ -77,18 +80,35 @@ are only needed once and requesting them via SourceKitten can take a while
frameworks from autocompletion results (See `exclude_framework_globals` in
package settings).
*Now*: the framework cached is persistant between sessions. It is saved to
Sublime's cache folder on saving a view, and is loaded next time SwiftKitten
is loaded.
#### external frameworks
Please provide a list of pathes to external frameworks in settings under
`frameworks`. These are passed to SourceKitten via compilerargs.
### Documentation [experimental]
Running `SwiftKitten: Display Documentation` from the command palette,
or by pressing `ctrl+alt+d` will search a docset (path specified in settings)
via _docsetutil_ and display the most relevant entry in an html popup.
### Settings
See `SwiftKitten.sublime-settings` for more settings and information.
Copy this file to `[Packages]/User` to customize the settings.
SwiftKitten default settings.
@@ -143,9 +163,20 @@ Copy this file to `[Packages]/User` to customize the settings.
"suppress_word_completions" : true,
"suppress_explicit_completions" : true,
Path to docset.
Running `ctrl+alt+d` will search the docset for the
current word or selection and display the docs in
a popup.
"docsetutil_binary" : "/usr/local/bin/docsetutil",
"docset" : "/Applications/"
Additionally, settings can be overridden in a sublime project file.
@@ -163,27 +194,8 @@ console (``ctrl+` ``) and see if any error messages are reported.
### TO DO
- Add support for multi-file projects/modules. Be able to
specify a swift module and embedded frameworks in a sublime project file.
Then one could add a build system for the swift module, e.g.
"name": "Swift: Project",
"selector": "source.swift",
"shell_cmd": "swiftc -sdk {sdk} ... main.swift",
"name": "Run",
"shell_cmd": "./main"
- Add support for multi-file projects/modules (e.g. specified in
a sublime project file).
- Parse Xcode project to get file list and embedded frameworks
(similiar to SourceKittenDaemon).
@@ -193,6 +205,6 @@ console (``ctrl+` ``) and see if any error messages are reported.
necessary tools to build it. Tried briefly but could
not get it to work.
- Add settings option for extra compiler arguments.
- Add more flexibile options for compilerargs passed to sourcekitten.
Oops, something went wrong.

0 comments on commit 06cedfe

Please sign in to comment.