Fork me on GitHub
#announcements
<
2021-08-17
>
bozhidar10:08:22

Introducing incomplete, a new simple Clojure code completion library https://metaredux.com/posts/2021/08/17/introducing-incomplete-a-simple-clojure-code-completion-library.html

👏 54
cider 27
6
3
clojure-spin 12
sheepy 3
vemv11:08:28

what would be a use case for using incomplete but not compliment?

bozhidar11:08:06

It will be fairly easy to replace clojure-complete with incomplete when such remote code loading happens (which I assume is very rarely).

bozhidar11:08:34

But if someone can use compliment, they should use compliment - it's a great library.

rickmoynihan11:08:55

@U051BLM8F: so is the plan to eventually replace nrepl.util.completion with this dependency?

bozhidar11:08:32

No, it's not. nREPL can't have any runtime dependencies.

bozhidar11:08:17

I'll just keep the code of nrepl.util.completion and the standalone library in sync. Same as I do for https://github.com/nrepl/bencode

rickmoynihan11:08:18

That was my suspicion; thanks for clarifying

rickmoynihan11:08:40

I’m guessing there’s no support for ::alias/keywords?

bozhidar12:08:54

(deftest keyword-completions-test
  (testing "colon prefix"
    (is (set/subset? #{":doc" ":refer" ":refer-clojure"}
                     (set (candidates ":" *ns*)))))

  (testing "unqualified keywords"
    (do #{:t-key-foo :t-key-bar :t-key-baz :t-key/quux}
        (is (set/subset? #{":t-key-foo" ":t-key-bar" ":t-key-baz" ":t-key/quux"}
                         (set (candidates ":t-key" *ns*))))))

  (testing "auto-resolved unqualified keywords"
    (do #{::foo ::bar ::baz}
        (is (set/subset? #{":incomplete.core-test/bar" ":incomplete.core-test/baz"}
                         (set (candidates ":incomplete.core-test/ba" *ns*))))
        (is (set/subset? #{"::bar" "::baz"}
                         (set (candidates "::ba" 'incomplete.core-test))))))

  (testing "auto-resolved qualified keywords"
    (do #{:nrepl.core/aliased-one :nrepl.core/aliased-two}
        (require '[nrepl.core :as core])
        (is (set/subset? #{"::core/aliased-one" "::core/aliased-two"}
                         (set (candidates "::core/ali" *ns*))))))

  (testing "namespace aliases"
    (is (set/subset? #{"::set"}
                     (set (candidates "::s" 'incomplete.core-test)))))

  (testing "namespace aliases without namespace"
    (is (empty? (candidates "::/" *ns*)))))

bozhidar12:08:11

That's the extent of the keywords support currently.

👍 3
blueberry15:08:35

[New release - RC4] Deep Learning for Programmers: An Interactive Tutorial with CUDA, OpenCL, DNNL, Java, and Clojure https://aiprobook.com/deep-learning-for-programmers/

sheepy 36