Last Hy version verified working for: Hy 0.16.0
jedhy
provides autocompletion, documentation introspection and formatting, and
other tools useful to IDEs for Hy, a lisp embedded in Python.
Leveraged in Emacs hy-mode IDE which I maintain.
Install from pypi pip install jedhy
.
- Completes:
- All standard python constructs (builtins, user-defined funcs, modules, etc.)
- Hy constructs (macros, shadowed operators, compile table)
- All of the above with Hy’s mangling rules handled.
- Documentation introspection and formatting (eg. for Emacs
Eldoc mode
). - Annotations (eg. for Emacs
Company mode
).
Jedhy is fully tested. The tests folder is the easiest way to see example usage.
See jedhy.api
, the simple entry point.
(setv jedhy (jedhy.api.API))
;; Add some stuff to namespace
(import [numpy :as np])
(import itertools)
(defclass Foo [object] "A class\nDetails..." (defn --init-- [self x y]))
(defmacro foo-macro [x])
(jedhy.set-namespace :locals- (locals) :macros- --macros--)
;; COMPLETION
(jedhy.complete "pr") ; print
(jedhy.complete "print.") ; print.--call--, print.--str--, ...
(jedhy.complete "np.a") ; np.add, np.array, ...
(jedhy.complete "foo-") ; foo-macro
;; DOCS
(jedhy.docs "itertools") ; "Functional tools for creating and using iterators."
(jedhy.docs "Foo") ; "Foo: (x y) - A class"
(jedhy.full-docs "Foo") ; "Foo: (x y) - A class\nDetails..."
;; ANNOTATION
(jedhy.annotate "itertools") ; <module itertools>
(jedhy.annotate "try") ; <compiler try>