Skip to content

lowercase @neovim.function not found #334

@meijieru

Description

@meijieru

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.

Activity

bfredl

bfredl commented on Apr 28, 2018

@bfredl
Member

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

meijieru commented on Apr 28, 2018

@meijieru
Author

Yeah, that would be ideal

changed the title [-]Unknown function[/-] [+]lowercase @neovim.function not found[/+] on Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @justinmk@bfredl@meijieru

        Issue actions

          lowercase @neovim.function not found · Issue #334 · neovim/pynvim