Skip to content

Commit

Permalink
feat(swift): add swift layer
Browse files Browse the repository at this point in the history
this adds basic swift support with highlighting, linting and xcodebuild.
No keybinding supported yet.
  • Loading branch information
dvcrn committed Mar 22, 2016
1 parent 00b7ff9 commit 203c2e4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cljs/proton/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
18 changes: 18 additions & 0 deletions src/cljs/proton/layers/lang/swift/README.md
Original file line number Diff line number Diff line change
@@ -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`


22 changes: 22 additions & 0 deletions src/cljs/proton/layers/lang/swift/core.cljs
Original file line number Diff line number Diff line change
@@ -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"]})

0 comments on commit 203c2e4

Please sign in to comment.