Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lowercase @neovim.function not found #334

Open
meijieru opened this issue Apr 28, 2018 · 2 comments
Open

lowercase @neovim.function not found #334

meijieru opened this issue Apr 28, 2018 · 2 comments

Comments

@meijieru
Copy link

meijieru commented Apr 28, 2018

here are the rplugin

import neovim


@neovim.plugin
class Main(object):

    def __init__(self, vim):
        self.vim = vim

    @neovim.function('test_python')
    def test_python(self, args):
        self.vim.command('echo "hello from TestPython"')

    @neovim.function('TestPython')
    def test_python_1(self, args):
        self.vim.command('echo "hello from TestPython"')

put this script in ~/.config/nvim/rplugin/python3 and run UpdateRemotePlugins, generate rplugin.vim in .local/share/nvim

" node plugins
" python3 plugins
call remote#host#RegisterPlugin('python3', '/home/jrmei/.config/nvim/rplugin/python3/auxlib.py', [
      \ {'sync': v:false, 'name': 'test_python', 'type': 'function', 'opts': {}},
      \ {'sync': v:false, 'name': 'TestPython', 'type': 'function', 'opts': {}},
     \ ])
" ruby plugins
" python plugins

now if run call TestPython(), if will output correctly. But if run call test_python(), it complains unknown function.

@bfredl
Copy link
Member

bfredl commented Apr 28, 2018

Plugin defined functions and commands must begin with uppercase. But we should throw an error for this as early as possible, ideally by nvim core so it covers hosts in all languages.

@meijieru
Copy link
Author

Yeah, that would be ideal

@justinmk justinmk changed the title Unknown function lowercase @neovim.function not found Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants