onsails/lspkind.nvim

bug: lspkind makes my language server crashing

to268 opened this issue · 7 comments

to268 commented

Configuration

  • Neovim version: 0.5
  • OS: artix linux (a "fork" of arch linux)
  • language server: clangd 12.0.1
  • lspkind setup:
local lspkind = require('lspkind').init({symbol_map = {Enum = ''}})
--
lspconfig.clangd.setup{ on_attach=custom_attach, lspkind }

File: lsp.log

[ ERROR ] 2021-08-07T21:46:13+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:13.904] ASTWorker building file /home/tony/files/Dev/C/libngi/src/caching.c version 78 with command \n[/home/tony/files/Dev/C/libngi]\n/usr/bin/cc -c -Og -g3 -fPIC -I include/ -o src/caching.o src/caching.c -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1\n"
[ ERROR ] 2021-08-07T21:46:13+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:13.923] --> textDocument/publishDiagnostics\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:14.031] <-- textDocument/didChange\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:14.067] <-- textDocument/completion(5)\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:14.073] Code complete: sema context ArrowMemberAccess, query scopes [] (AnyScope=true), expected type <none>\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:14.073] Code complete: 4 results from Sema, 0 from Index, 0 matched, 0 from identifiers, 4 returned.\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:14.073] --> reply:textDocument/completion(5) 6 ms\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:14.081] ASTWorker building file /home/tony/files/Dev/C/libngi/src/caching.c version 79 with command \n[/home/tony/files/Dev/C/libngi]\n/usr/bin/cc -c -Og -g3 -fPIC -I include/ -o src/caching.o src/caching.c -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"I[21:46:14.086] --> textDocument/publishDiagnostics\n"
[ ERROR ] 2021-08-07T21:46:14+0200 ] /usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:462 ]	"rpc"	"clangd"	"stderr"	"E[21:46:14.095] Transport error: Got signal, shutting down\nI[21:46:14.095] LSP finished, exiting with status 1\n"

Description

When i am writing -> after a struct, neovim just crash closing my terminal window. I have disabled the plugin and my language server doesn't crash so the crash just occur when the plugin is enabled and initialized.

please try fresh master

to268 commented

hi,
i have updated the plugin to the latest version (commit 6298b12) and i am still crashing.
This example illustrates where i am crashing if you need to reproduce the bug:

#include <stdlib.h>

struct Test {
    int id;
    char* data;
};

int main(int argc, char** argv) {
    struct Test test;

    /* Crash when "." is written */
    test.id = 0;
    /*  ^ */

    struct Test* test2 = malloc(sizeof(struct Test));

    /* Crash when ">" is written */
    test2->id = 1;
    /*    ^ */

    free(test2);

    return 0;
}

does it crash if you don't override symbol_map?

to268 commented

the plugin still crash even when i am using the symbol_map defaults (no parameters in init())

I couldn't reproduce the problem:
image

Are you using neovim 5 stable or nightly?

to268 commented

Doesn't matter because i have found the problem, the field icon is displayed properly when i am on the README.md on github but when i open the README.md cloned in nvim, it will crash when i am moving and the Field icon is displayed. I have tried to overwrite the Field icon and i have no crash so the icon for the Field makes me crash.
I am using the font Sauce Code Pro Nerd Font Complete (aka Source Code Pro patched for icons) and noto-fonts-emoji so i don't know why this make me crashing.