In-REPL syntax highlighting & inspect source code of a hy function / module #2550
atisharma
started this conversation in
Show and tell
Replies: 1 comment
-
It now also has a code beautifier / pretty-printer. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I find it useful to examine the source for a hy (or python) function in the REPL. Python's
inspect.getsource
fails for hy source because it relies on a regex.The following code implements (a subset of) getsource for hy and prints it syntax-highlighted.
Using
hylight
forrepl-output-fn
also gives syntax highlighting in the repl.I'll maintain it at https://github.com/atisharma/hyjinx/blob/main/hyjinx/source.hy
Beta Was this translation helpful? Give feedback.
All reactions