Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Fix crash when trying to auto-complete line that ends with quote
Browse files Browse the repository at this point in the history
fixes #365
  • Loading branch information
anmonteiro committed May 11, 2018
1 parent ee76690 commit 9ce7c77
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- `clojure.reflect` not bundled ([#369](https://github.com/anmonteiro/lumo/issues/369)).
- `-e` with unfinished form hangs ([#375](https://github.com/anmonteiro/lumo/issues/375)).
- Fix crash when trying to auto-complete a line ending with `'` ([#365](https://github.com/anmonteiro/lumo/issues/365)).

### Changes

Expand Down
1 change: 1 addition & 0 deletions build.boot
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
:cljs-opts {:parallel-build true
:target :nodejs
:verbose true
:npm-deps false
:asset-path "test_suite.out"}
:update-fs? true
:exit? exit?
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/snapshot/lumo/repl.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ This was taken from the reader specification plus tests at the Clojure REPL."}
#js []
(if skip-suffix-check?
(completion-candidates top-level? ns-alias)
(filter #(is-completion? line-match-suffix %)
(filter #(some-> line-match-suffix (is-completion? %))
(completion-candidates top-level? ns-alias))))]
(cb (doto completions
.sort)))))
Expand Down
5 changes: 4 additions & 1 deletion src/test/lumo/lumo/repl_tests.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
(is-completion "foo-1.core/" ["foo-1.core/baz-3" "foo-1.core/bar2" "foo-1.core/xyz"])
(is-completion "foo-1.core/ba" ["foo-1.core/baz-3" "foo-1.core/bar2"])))
(testing "LUMO-362"
(is-contains-completion "(+" "(+"))))
(is-contains-completion "(+" "(+"))
(testing "LUMO-365"
(is-empty-completion "(require '")
(is-empty-completion "'"))))


(deftest test-root-resource
Expand Down

0 comments on commit 9ce7c77

Please sign in to comment.