-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from liquidz/dev
Next release
- Loading branch information
Showing
11 changed files
with
165 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
name: release | ||
on: workflow_dispatch | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: [closed] | ||
|
||
jobs: | ||
tag_and_release: | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
*elin.txt* A Clojure development environment for Vim/Neovim | ||
|
||
Version: 0.0.1 | ||
Author : Masashi Iizuka <[email protected]> | ||
License: MIT LICENSE | ||
|
||
|
@@ -10,6 +9,34 @@ CONTENTS *elin-contents* | |
Commands |elin-commands| | ||
Mappings |elin-mappings| | ||
Default mappings |elin-default-mappings| | ||
Customizing |elin-customizing| | ||
|
||
============================================================================== | ||
CUSTOMIZING *elin-customizing* | ||
|
||
*g:elin_auto_connect* | ||
g:elin_server_auto_connect | ||
If `v:true`, automatically connect to Elin server. | ||
Default value is `v:true`. | ||
|
||
*g:elin_server_port* | ||
g:elin_server_port | ||
Elin server port number. | ||
If `v:null`, automatically assing a empty port number. | ||
Default value is `v:null`. | ||
|
||
*g:elin_enable_default_key_mappings* | ||
g:elin_enable_default_key_mappings | ||
If `v:true`, enable default key mappings. | ||
|
||
*g:elin_default_key_mapping_leader* | ||
g:elin_default_key_mapping_leader | ||
Default value is `'<Leader>'`. | ||
|
||
*g:elin_enable_omni_completion* | ||
g:elin_enable_omni_completion | ||
If `v:true`, enable omni completion. | ||
Default value is `v:true`. | ||
|
||
============================================================================== | ||
vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,45 @@ | ||
(ns elin.function.sexpr-test | ||
(:require | ||
[clojure.core.async :as async] | ||
[clojure.test :as t] | ||
[elin.error :as e] | ||
[elin.function.sexpr :as sut] | ||
[elin.protocol.host :as e.p.host] | ||
[elin.test-helper :as h] | ||
[elin.test-helper.host])) | ||
|
||
(t/use-fixtures :once h/malli-instrument-fixture) | ||
|
||
(defn- get-namespace-elin | ||
(defn- mock-get-namespace-sexpr! | ||
[ns-form] | ||
(h/test-elin {:host {:get-namespace-sexpr! {:code ns-form :lnum 0 :col 0}}})) | ||
(fn [& _] | ||
(async/go | ||
{:code ns-form :lnum 0 :col 0}))) | ||
|
||
(t/deftest get-namespace-test | ||
(t/testing "no metadata" | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace (get-namespace-elin "(ns foo.bar)"))))) | ||
(let [test-elin (h/test-elin)] | ||
(t/testing "no metadata" | ||
(with-redefs [e.p.host/get-namespace-sexpr! (mock-get-namespace-sexpr! "(ns foo.bar)")] | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace test-elin))))) | ||
|
||
(t/testing "with metadata" | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace (get-namespace-elin "(ns ^:meta foo.bar)")))) | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace (get-namespace-elin "(ns ^{:meta true} foo.bar)"))))) | ||
(t/testing "with metadata" | ||
(with-redefs [e.p.host/get-namespace-sexpr! (mock-get-namespace-sexpr! "(ns ^:meta foo.bar)")] | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace test-elin)))) | ||
(with-redefs [e.p.host/get-namespace-sexpr! (mock-get-namespace-sexpr! "(ns ^{:meta true} foo.bar)")] | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace test-elin))))) | ||
|
||
(t/testing "in-ns" | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace (get-namespace-elin "(in-ns 'foo.bar)"))))) | ||
(t/testing "in-ns" | ||
(with-redefs [e.p.host/get-namespace-sexpr! (mock-get-namespace-sexpr! "(in-ns 'foo.bar)")] | ||
(t/is (= "foo.bar" | ||
(sut/get-namespace test-elin))))) | ||
|
||
(t/testing "no namespace" | ||
(t/is (e/not-found? | ||
(sut/get-namespace (get-namespace-elin "(foo)")))) | ||
(t/is (e/not-found? | ||
(sut/get-namespace (get-namespace-elin "")))))) | ||
(t/testing "no namespace" | ||
(with-redefs [e.p.host/get-namespace-sexpr! (mock-get-namespace-sexpr! "(foo)")] | ||
(t/is (e/not-found? | ||
(sut/get-namespace test-elin)))) | ||
(with-redefs [e.p.host/get-namespace-sexpr! (mock-get-namespace-sexpr! "")] | ||
(t/is (e/not-found? | ||
(sut/get-namespace test-elin))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
(ns elin.interceptor.connect.shadow-cljs-test | ||
(:require | ||
[clojure.core.async :as async] | ||
[clojure.java.io :as io] | ||
[clojure.test :as t] | ||
[elin.function.select :as e.f.select] | ||
[elin.interceptor.connect.shadow-cljs :as sut] | ||
[elin.protocol.host :as e.p.host] | ||
[elin.test-helper :as h] | ||
[elin.util.file :as e.u.file])) | ||
|
||
(t/use-fixtures :once h/malli-instrument-fixture) | ||
(t/use-fixtures :once h/warn-log-level-fixture) | ||
|
||
(def ^:private detect-shadow-cljs-port-enter | ||
(:enter sut/detect-shadow-cljs-port)) | ||
|
||
;; (def ^:private detect-shadow-cljs-port-leave | ||
;; (:leave sut/detect-shadow-cljs-port)) | ||
|
||
(t/deftest detect-shadow-cljs-port-enter-test | ||
(let [cwd (.getAbsolutePath (io/file ".")) | ||
test-elin (h/test-elin) | ||
detect-shadow-cljs-port-enter-test (fn [hostname port-file] | ||
(-> test-elin | ||
(assoc :hostname hostname | ||
:port-file port-file) | ||
(detect-shadow-cljs-port-enter) | ||
(select-keys [:hostname port-file])))] | ||
(t/testing "Positive" | ||
(t/testing "No shadow-cljs port file" | ||
(with-redefs [e.p.host/get-current-working-directory! (fn [& _] | ||
(async/go cwd)) | ||
e.f.select/select-from-candidates (fn [_ candidates] | ||
(first candidates))] | ||
(t/is (= {:hostname nil} | ||
(detect-shadow-cljs-port-enter-test nil nil))))) | ||
|
||
(t/testing "Exists shadow-cljs port file, but not selected") | ||
(t/testing "Exists shadow-cljs port file, and selected") | ||
|
||
(t/testing "Failed to fetch project root directory" | ||
(with-redefs [e.p.host/get-current-working-directory! (fn [& _] | ||
(async/go cwd)) | ||
e.u.file/get-project-root-directory (constantly nil)] | ||
(t/is (= {:hostname nil} | ||
(detect-shadow-cljs-port-enter-test nil nil)))))) | ||
|
||
(t/testing "Negative"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters