Skip to content

Commit

Permalink
Use context classloader to get completions
Browse files Browse the repository at this point in the history
Fall back gracefully if that fails too.

closes #108
  • Loading branch information
trptcolin committed Apr 8, 2013
1 parent 50f1d4b commit b1251eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@
- Eliminate defn override / `sourcery` (#102)
- Fix negative rationals (cgrand/sjacket#14)
- Allow input of non-BMP characters (jline/jline2#80)
- Handle completion load failure more gracefully (#108)

## 0.1.10, 2012-02-15
- Handle interruption (via ctrl-c) during input with new jline capabilities
Expand Down
10 changes: 8 additions & 2 deletions src/clj/reply/initialization.clj
Expand Up @@ -183,8 +183,14 @@

(catch Exception e#
(try
(eval '~(formify-file
(ClassLoader/getSystemResource "complete/core.clj")))
(eval
'~(try
(formify-file
(-> (Thread/currentThread)
(.getContextClassLoader)
(.getResource "complete/core.clj")))
(catch Exception e
'(throw (Exception. "Couldn't find complete/core.clj")))))
(catch Exception f#
(intern (create-ns '~'complete.core) '~'completions
(fn [prefix# ns#] []))
Expand Down

0 comments on commit b1251eb

Please sign in to comment.