Skip to content

Commit e8ceb76

Browse files
Refactor Fireplace_nrepl class into shared lib
1 parent 05cc1ff commit e8ceb76

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

pythonx/async_clj_omni/async_clj_omni/fireplace.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,16 @@ def global_watch(cmsg, cwc, ckey):
4343
wc.watch("global_watch", {}, global_watch)
4444

4545
return self.__conns.get(conn_string)
46+
47+
class Fireplace_nrepl:
48+
def __init__(self, wc):
49+
self.wc = wc
50+
51+
def send(self, msg):
52+
self.wc.send(msg)
53+
54+
def watch(self, name, q, callback):
55+
self.wc.watch(name, q, callback)
56+
57+
def unwatch(self, name):
58+
self.wc.unwatch(name)

rplugin/python3/deoplete/sources/async_clj.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,6 @@
1111
import deoplete.logger
1212

1313

14-
class Fireplace_nrepl:
15-
def __init__(self, wc):
16-
self.wc = wc
17-
18-
def send(self, msg):
19-
self.wc.send(msg)
20-
21-
def watch(self, name, q, callback):
22-
self.wc.watch(name, q, callback)
23-
24-
def unwatch(self, name):
25-
self.wc.unwatch(name)
26-
27-
2814
class Source(Base):
2915
def __init__(self, vim):
3016
Base.__init__(self, vim)
@@ -52,7 +38,7 @@ def gather_candidates(self, context):
5238
wc = self.__connmanager.get_conn(conn_string)
5339

5440
return cider_gather(deoplete.logger.getLogger('fireplace_cider_gather'),
55-
Fireplace_nrepl(wc),
41+
fireplace.Fireplace_nrepl(wc),
5642
context["complete_str"],
5743
connection.get("session"),
5844
ns)

0 commit comments

Comments
 (0)