Skip to content

Error in vim: "Unknown function: nvim_buf_add_highlight" #1018

@ipkiss42

Description

@ipkiss42
  • Did you upgrade to latest plugin version? Yes
  • Did you upgrade to/compile latest binary? Run shell command
    bin/languageclient --version to get its version number.
  • (Neovim users only) Did you check output of :checkhealth LanguageClient? N/A
  • Did you check troubleshooting? Yes

Describe the bug

When running :call LanguageClient#textDocument_documentHighlight() (either manually or via an autocommand) in Vim 8.2, I get the following error:

[LC] Error: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "\'Vim(let):E117: Unknown function: nvim_buf_add_highlight\'", data: None }, id: Num(42) }

From the name, it looks like a nvim-specific function which should not be called in Vim.

Environment

  • neovim/vim version (nvim --version or vim --version):
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 26 2020 11:23:21)
Included patches: 1-510                                                                        
Compiled by Arch Linux                                                                         
Huge version with GTK3 GUI.  Features included (+) or not (-):    
  • This plugin version (git rev-parse --short HEAD): 18434f2
  • This plugin's binary version (bin/languageclient --version): languageclient 0.1.157
  • Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
    reproduce the issue. Refer to an example here): Not needed
  • Language server link and version: rust-analyzer, but I don't think it's server-specific.

To Reproduce

Steps to reproduce the behavior:

I'm sure you will manage :) Let me know if not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions