Skip to content
Autocompletion and code introspection for Hy.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
jedhy Clean: Refactored jedhy modules for 0.16 May 2, 2019
tests Clean: Refactored jedhy modules for 0.16 May 2, 2019
.gitignore
.projectile Add: Moved jedhy from hy-mode subpkg to own repo Dec 17, 2017
README.org Docs: Update readme, and usage section May 2, 2019
conftest.py Add: Moved jedhy from hy-mode subpkg to own repo Dec 17, 2017
setup.py Fix dependency for install from pypi Jun 13, 2018

README.org

Jedhy

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.

Features

  1. Completes:
    1. All standard python constructs (builtins, user-defined funcs, modules, etc.)
    2. Hy constructs (macros, shadowed operators, compile table)
    3. All of the above with Hy’s mangling rules handled.
  2. Documentation introspection and formatting (eg. for Emacs Eldoc mode).
  3. 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.

NOTE: Hy devs love to break this library. Working for: Hy 0.16.0

Example Usage

(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"

;; ANNOTATION
(jedhy.annotate "itertools") ; <module itertools>
(jedhy.annotate "try")       ; <compiler itertools>
You can’t perform that action at this time.