[go: up one dir, main page]

Skip to content
Oleksandr Yakushev edited this page May 20, 2024 · 17 revisions

This page shows examples of how Compliment handles different completions.

Vars

Compliment can complete vars in the current namespace. It looks like this:

As you can see, a help popup is displayed as well for the completion highlighted in a popup menu.

Scoped completions are covered, too:

For vars containing dashes, you can type only the first few symbols for each part between the dashes:

You can actually skip writing dashes:

With the help of contexts, Compliment can intelligently complete :refer vars in :require (same for :use :only). In this case the completion shows only the vars from clojure.set namespace:

Namespaces

Compliment can do simple namespace completion:

Furthermore, same as for vars, you can specify only first few letters between the periods:

Or without periods:

Tired of typing clojure.java.io? Just type cji and press TAB, Compliment will handle it for you.

Keep in mind that extra fuzziness (i.e. without periods) works only for namespaces that are loaded into the current session to avoid cluttering completion suggestions.

Classes

Just like namespaces, Compliment allows you to complete classnames (both short and package-qualified). Fuzzy-completion for classes:

For performance reasons, fuzziness works only for classes that are imported into the current namespace. For all others, the basic by-prefix completion is available:

Or you can type in just the short classname to complete the fully qualified name. (In CIDER, you have to enable fuzzy matching for this to work.)

Static members

Here’s an example of static class-member completion:

Non-static members (methods and fields)

Example of non-static member completion:

Fuzzy-completion for members splits a prefix on camel-case capital letters (like Eclipse does):

If you write a type-hinted symbol first and then try to complete a method for it, only the members for that class are offered:

Compliment will also track if the symbol was locally type-hinted earlier:

Keywords

Compliment allows to complete any keyword that was used during the current session (or introduced by any of the libraries):

Local bindings

Compliment can complete local bindings introduced by let, defn and the like:

Special forms

Compliment is aware of special Clojure forms like recur or true.