{"id":3142,"url":"https://github.com/johncsnyder/SwiftKitten","last_synced_at":"2025-08-03T13:31:56.625Z","repository":{"id":87732726,"uuid":"54219055","full_name":"johncsnyder/SwiftKitten","owner":"johncsnyder","description":"Swift autocompleter for Sublime Text, via the adorable SourceKitten framework","archived":true,"fork":false,"pushed_at":"2019-08-18T22:59:40.000Z","size":1115,"stargazers_count":139,"open_issues_count":10,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-16T10:42:13.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johncsnyder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-18T17:19:41.000Z","updated_at":"2024-03-04T05:02:22.000Z","dependencies_parsed_at":"2023-04-11T04:34:25.205Z","dependency_job_id":null,"html_url":"https://github.com/johncsnyder/SwiftKitten","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncsnyder%2FSwiftKitten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncsnyder%2FSwiftKitten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncsnyder%2FSwiftKitten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johncsnyder%2FSwiftKitten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johncsnyder","download_url":"https://codeload.github.com/johncsnyder/SwiftKitten/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228548567,"owners_count":17935221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:32.619Z","updated_at":"2024-12-07T01:30:36.133Z","avatar_url":"https://github.com/johncsnyder.png","language":"Python","funding_links":[],"categories":["Tools","WebSocket"],"sub_categories":["Web View","Other free courses"],"readme":"## SwiftKitten\n\nSwiftKitten is a Swift autocompleter for Sublime Text, via the adorable \n[SourceKitten](https://github.com/jpsim/SourceKitten.git) framework.\nFaster than XCode !\n\n\n![](demo.gif)\n\n\nThis package is new and still in beta! I welcome any suggestions. If\nyou find a bug, please open an issue. If you want to contribute, feel\nfree to fork and submit a pull request.\n\n\n### Installation\n\nFirst, make sure to install [SourceKitten](https://github.com/jpsim/SourceKitten.git) !\n\nSwiftKitten is available via Package Control.\n\nTo install manually, clone this repository into your packages directory:\n\n`git clone https://github.com/johncsnyder/SwiftKitten.git`\n\nIn Sublime, run `Preferences: Browse Packages`  from the command palette \nto find your packages directory. \n\n\n### Dependencies\n\nThe dependencies are included with the SwiftKitten package.\n\n#### ijson\n\nSwiftKitten uses [ijson](https://pypi.python.org/pypi/ijson) to parse\ncompletions results from SourceKitten. By default, SwiftKitten will use\nthe pure python backend. If the faster `yajl2_cffi` backend is available,\nSwiftKitten will automatically load it. It is highly recommended that\nyou build the cffi backend.\n\n\n#### cffi [optional]\n\nNavigate to `[Packages]/SwiftKitten/cffi/` and run `python setup.py build`.\nThis will build cffi in place. Maybe sure to run this command with `python3.3`.\nMust be compatible with Sublime. Next time you start Sublime, SwiftKitten will\nload the `yajl2_cffi` backend. \n\n\n\n### Caching\n\nSwiftKitten uses [pygments](http://pygments.org) to parse autocomplete\nprefixes and caches the result for the next time you request it. There will\nbe a slight delay the first time you autocomplete a function, but the next\ntime, it will be instantaneous. For example\n\n![](example.png)\n\nSwiftKitten will remember the autocomplete results for `foo` and cache them.\nThe next time you type `foo.`, SwiftKitten will return the cached results.\nAlso, an autocomplete request will be sent if the cached results have timed\nout (See `cache_timeout` in package settings). If the results\nhave changed, SwiftKitten will update the autocomplete window. A default\ncache timeout of one second ensures you will always be shown up-to-date results,\nwhile preventing a barrage of unnecessary requests to SourceKitten.\n\nTo clear the cache manually, run `SwiftKitten: Clear Cache` from the command\npalette (this clears the framework cache also).\n\n\n\n### Frameworks\n\nSwiftKitten parses your file to find imported frameworks automatically.\nSwiftKitten requests and caches framework globals separately, since they\nare only needed once and requesting them via SourceKitten can take a while\n(e.g. 20-30 seconds for Foundation).  It is possible to exclude specific \nframeworks from autocompletion results (See `exclude_framework_globals` in \npackage settings).\n\nThe framework cache is persistant between sessions. It is saved to\nSublime's cache folder on saving a view, and is loaded next time SwiftKitten\nis loaded.\n\n\n##### External frameworks\n\nPlease provide a list of paths to external frameworks in settings under\n`extra_framework_paths`. These are passed to SourceKitten via compilerargs.\n\n\n\n\n### Documentation [experimental]\n\nRunning `SwiftKitten: Display Documentation` from the command palette,\nor by pressing `ctrl+alt+d` will search a docset (path specified in settings)\nvia _docsetutil_ and display the most relevant entry in an html popup.\n\n\n![](docdemo.gif)\n\n\n### Settings\n\nSee `SwiftKitten.sublime-settings` for more settings and information.\nCopy this file to `[Packages]/User` to customize the settings.\n\n\n```js\n/*\n    SwiftKitten default settings.\n\n    All settings can be overriden in a sublime project file.\n*/\n{\n\t/* \n\t\tPath to SourceKitten binary.\n\t\tSee `https://github.com/jpsim/SourceKitten`.\n\t*/\n\t\"sourcekitten_binary\" : \"/usr/local/bin/sourcekitten\",\n\n\t/*\n\t\tsdk to link with. SourceKitten will find the \n\t\tdefault sdk (OS X) if left blank.\n\t*/\n\t\"sdk\" : \"\",\n\n\t/*\n\t\tExtra framework search paths.\n\n\t\tTo enable autocompletion for external frameworks, \n\t\tadd the path to the directory containing the \n\t\tframework here.\n\t*/\n\t\"extra_framework_paths\" : [],\n\n\t/*\n\t\tExtra compiler arguments to SourceKitten.\n\t*/\n\t\"extra_compilerargs\" : \"\",\n\n\t/*\n\t\tExclude globals from specific frameworks in auto-\n\t\tcompletion results. For example, `import Foundation`\n\t\tadds a lot of bloat to autocomplete results, and can \n\t\tslow down typing.\n\t*/\n\t\"exclude_framework_globals\" : [\"Foundation\"],\n\n\t/*\n\t\tTimeout for cached completion data (in seconds).\n\t*/\n\t\"cache_timeout\" : 1.0,\n\t\n\t/*\n\t\tLimit to number of concurrent completion requests.\n\t*/\n\t\"concurrent_request_limit\" : 4,\n\n\t/*\n\t\tEnable linting. This will query structure info via\n\t\tSourceKitten, and underline any parse errors. Move \n\t\tthe cursor to the error position to see the error \n\t\tdescription in the status bar.\n\t*/\n\t\"linting\" : true,\n\n\t/*\n        Supress Sublime Text regular completions.\n    */\n\t\"suppress_word_completions\" : true,\n\t\"suppress_explicit_completions\" : true,\n\n\t/*\n\t\tPath to docset.\n\n\t\tRunning `ctrl+alt+d` will search the docset for the\n\t\tcurrent word or selection and display the docs in\n\t\ta popup.\n\t*/\n\t\"docsetutil_binary\" : \"/usr/local/bin/docsetutil\",\n\t\"docset\" : \"/Applications/Xcode.app/Contents/Developer/Documentation/DocSets/com.apple.adc.documentation.OSX.docset\"\n}\n```\n\n\nAdditionally, settings can be overridden in a sublime project file.\n\nIt is recommended to add the following to user or Swift syntax specific preferences:\n\n```js\n\"auto_complete_triggers\": [ {\"selector\": \"source.swift\", \"characters\": \".\"} ]\n```\n\n\n\n### Troubleshooting\n\n\nIf autocompletion is not working, pull up the Sublime python\nconsole (``ctrl+` ``) and see if any error messages are reported.\n\n\n\n\n### TO DO\n\n\n- Add support for multi-file projects/modules (e.g. specified in\n\ta sublime project file).\n\n- Parse Xcode project to get file list and embedded frameworks \n\t(similiar to SourceKittenDaemon).\n\n- Add Xcode build, run and debug commands. Build system is not\n\tflexible enough. Specify the xcode project in sublime project\n\tfile. Or if xcode project in same folder as sublime project,\n\tuse this one as default.\n\n- Build cffi automatically on sublime package install ?\n\tI'm not sure if sublime's python interpreter has the\n\tnecessary tools to build it. Tried briefly but could\n\tnot get it to work.\n\n- Add support for multiple docsets. Make documentation context\n\taware. Add support for api links, so that documentation \n\tcan be navigated.\n\n\n\n### License\n\nSwiftKitten is MIT licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohncsnyder%2FSwiftKitten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohncsnyder%2FSwiftKitten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohncsnyder%2FSwiftKitten/lists"}