From 203c2e4500a65a250904d6439d5582f6d7b2ecc8 Mon Sep 17 00:00:00 2001 From: David Mohl Date: Sat, 19 Mar 2016 09:45:28 +0900 Subject: [PATCH] feat(swift): add swift layer this adds basic swift support with highlighting, linting and xcodebuild. No keybinding supported yet. --- src/cljs/proton/core.cljs | 1 + src/cljs/proton/layers/lang/swift/README.md | 18 +++++++++++++++++ src/cljs/proton/layers/lang/swift/core.cljs | 22 +++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 src/cljs/proton/layers/lang/swift/README.md create mode 100644 src/cljs/proton/layers/lang/swift/core.cljs diff --git a/src/cljs/proton/core.cljs b/src/cljs/proton/core.cljs index 17c3aac..5213418 100644 --- a/src/cljs/proton/core.cljs +++ b/src/cljs/proton/core.cljs @@ -25,6 +25,7 @@ ;; langs [proton.layers.lang.clojure.core] + [proton.layers.lang.swift.core] [proton.layers.lang.csharp.core] [proton.layers.lang.python.core] [proton.layers.lang.julia.core] diff --git a/src/cljs/proton/layers/lang/swift/README.md b/src/cljs/proton/layers/lang/swift/README.md new file mode 100644 index 0000000..ca424d7 --- /dev/null +++ b/src/cljs/proton/layers/lang/swift/README.md @@ -0,0 +1,18 @@ +## Swift configuration layer + +Adds supports for the swift programming language. + +Includes following packages: + +- [language-swift](https://atom.io/packages/language-swift) +- [autocomplete-swift](https://atom.io/packages/autocomplete-swift) +- [linter-swiftlint](https://atom.io/packages/linter-swiftlint) +- [build-xcodebuild](https://atom.io/packages/build-xcodebuild) + +### Install + +Add `:lang/swift` to your `~/.proton`. + +For linter support add `:tools/linter` to your `~/.proton` + + diff --git a/src/cljs/proton/layers/lang/swift/core.cljs b/src/cljs/proton/layers/lang/swift/core.cljs new file mode 100644 index 0000000..7c44dd7 --- /dev/null +++ b/src/cljs/proton/layers/lang/swift/core.cljs @@ -0,0 +1,22 @@ +(ns proton.layers.lang.swift.core + (:require [proton.lib.mode :as mode] + [proton.lib.helpers :refer [console!]] + [proton.layers.core.actions :refer [get-active-editor]]) + (:use [proton.layers.base :only [init-layer! get-packages register-layer-dependencies describe-mode init-package]])) + +(defmethod get-packages :lang/swift [] + [:language-swift + :autocomplete-swift]) + +(defmethod init-layer! :lang/swift [] + (console! "init" :lang/swift) + (register-layer-dependencies :tools/linter + [:linter-swiftlint]) + + (register-layer-dependencies :tools/build + [:build-xcodebuild])) + +(defmethod describe-mode :lang/swift [] + {:mode-name :swift-major-mode + :atom-grammars ["Swift"] + :atom-scope ["source.swift"]})