Closed wakita closed 2 years ago
Hm... Why my deoplete works? It imports deoplete module in it.
https://github.com/Shougo/deoplete.nvim/blob/master/rplugin/python3/deoplete/__init__.py#L11
Hm. You need to create subdirectory and rename the files.
It works for me.
# rplugin/python3/aaa/__init__.py
import pynvim
import aaa.a import A
@pynvim.plugin
class _A(A):
def __init__(self, nvim):
self.nvim = nvim
@pynvim.command('AAA', nargs='*', range='', sync=False)
def a(self, args, range):
self.nvim.out_write('A message from A\n')
# rplugin/python3/aaa/a.py
class A(object): pass
Thank you! Your trick did work on my code. Many thanks!
(you may want to change the second line of your version of __init__.py
: you meant from aaa.a import A
)
You should close it.
My attempts to split a Python remote plugin into multiple Python files so far do not work.
The following is the simplest example that demonstrates my problem. I have two Python files.
a.py
defines an empty class namesA
. Another file_a.py
defines a neovim command namedAAA
in_A
class that extendsA
.:UpdateRemotePlugins
fails to finda.py
I tried to move
a.py
to everywhere I could imagine but nothing worked. I triedsys.path.append
trick butUpdateRemotePlugin
ignores.By the way,
UpdateRemotePlugin
seems to recognizeimport
inside a Python comment. I think it should skip comments.