Overview of current feature base
Documentation lookup
Task: Show the documentation for a given symbol. The symbol might resolve
to either a var or a class. For a class the javadoc should be shown.
Input: a symbol to resolve and a namespace in which the resolution has
to happen
- vimclojure: Shows the docstring for Vars. Opens the javadoc in a browser
for classes. Allows specification of javadoc URLs based on package prefixes.
Namespace browsing
Task: Provide information about active namespaces for front-end navigation.
- vimclojure: It is possible to jump to the source code of a Var based on
meta data if the source is available in Vim's search path. But it is not
possible to visually browse the namespaces in some kind of tree or such.
- counterclockwise: provides visual browsing of the namespaces and contained
vars, documentation hover on the namespaces and vars nodes, jump to the source code of a Var.
Refactoring
Everything and anything we can do to automate code changes.
- clojure-refactoring / Emacs / SLIME: is the core of this general-purpose?
Show source code
Task: A relaxed version of the above. Shows the source code for a Var.
Instead of jumping to the location. This also works if the source code is
only available in a jar file.
Input: a symbol to resolve and a namespace in which the resolution has
to happen
Implemented by: vimclojure
Code evaluation
Task: Evaluate a provided form in the REPL server.
Input: A form to expand and a namespace in which the expansion has to happen
Macro expansion
Task: Expand a provided form via macroexpand/macroexpand-1.
Input: A form to expand and a namespace in which the expansion has to happen
Implemented by: swank-clojure, vimclojure
Omni completion
Task: Complete a given symbol. Various optimisations may be done to
suggest only useful completions depending on context.
Input: the namespace edited, a partial symbol to be completed
- swank-clojure: distinguishes qualified symbols, ie. symbols containing
a /, and unqualified symbols. Matching means.startsWith
.- qualified symbols will only resolve public vars/static depending of
the part in front being a namespace or a class. Namespaces aliases are
resolved. - unqualified symbols complete to vars as they would resolve in the
current namespace, namespaces or aliases, imported classes, methods
of imported classes, discovered classes from the classpath
- qualified symbols will only resolve public vars/static depending of
- vimclojure: basically identical, but...
- does neither complete non-static methods of imported classes nor
discovered classes on classpath - sports a nifty short-cut feature:
c.c.r-u
would match eg.
clojure.contrib.repl-utils
. Strings are split at dots and dashes
(in that order). From there matching via.startsWith
is done.
- does neither complete non-static methods of imported classes nor
- counterclockwise: completes only clojure Vars (at least in the Clojure
code)- cross-pollinated with short-cut feature from vimclojure (e.g.
c.s/un
would match eg.clojure.set/union
- it has code for completing java method calls/attributes (static or instance),
java packages, but it is based on Eclipse search feature and is not really performant (pros=works even without a backend repl running, cons=too slow yet, and tied to Eclipse).
- cross-pollinated with short-cut feature from vimclojure (e.g.
Dynamic indenting
Task: Support indentation of def or with- style macros dynamically based
on some heuristic. eg. "[]
" in the argument vector.
Input: A namespace to scan for information
Implemented by: swank-clojure
- counterclockwise: supports auto-indentation (when hitting Enter) and line reindentation
(hitting Tab or a specific keyboard shortcut). Current algorithm: indents calls by 2 spaces (if functions) or by the column of the first arg if it is placed on the first line (if special forms or macros),
and non calls by 1 space. Indentation algorithm based on the parsetree of the source code. Treats functions and macros (determined from a fixed known list of clojure.core macros & special forms %2B some heuristics based on the name of the symbol)
Dynamic highlighting
Task: Support highlighting of required namespaces dynamically.
Input: A namespaces to scan for information
- Implemented by: vimclojure
Paredit
Task: Allow structure aware editing.
A lot of work already done by Laurent (~ 80% of paredit.el commands)