tigersoldier / company-lsp

Company completion backend for lsp-mode
GNU General Public License v3.0
251 stars 26 forks source link

Error on completion: wrong-type-argument lsp--client nil #97

Closed NilsBrause closed 5 years ago

NilsBrause commented 5 years ago

When I'm triggering an auto-completen, I'm getting the above mentioned error. I'm using OpenSUSE 15.0 with a self-compiled emacs 26.1 with the following modules: lsp-mode 20190323.612, company-lsp 20190314.720 and ccls 20190225.1410 as well as ccls-0.20190314 as the server.

This is my configuration:

(require 'company)
(add-hook 'c++-mode-hook 'company-mode)
(require 'lsp-mode)
(add-hook 'c-mode-hook #'lsp)
(add-hook 'c++-mode-hook #'lsp)
(require 'ccls)
(setq ccls-executable "/home/nils/ccls/build/ccls")
(setq ccls-extra-args '("--log-file=ccls.log"))
(require 'company-lsp)
(setq company-lsp-cache-candidates nil)
(setq company-lsp-async t)
(setq company-lsp-enable-snippet t)
(setq company-lsp-enable-recompletion nil)
(push 'company-lsp company-backends)

Here is a backtrace:

Debugger entered--Lisp error: (wrong-type-argument lsp--client nil)
  signal(wrong-type-argument (lsp--client nil))
  company-lsp--on-completion(#<hash-table equal 2/65 0x24141cd> #("std" 0 1 (fontified nil) 1 2 (fontified nil) 2 3 (fontified nil)))
  #f(compiled-function (resp) #<bytecode 0x2138e3d>)(#<hash-table equal 2/65 0x24141cd>)
  #f(compiled-function () #<bytecode 0x21685e9>)()
  #f(compiled-function (result) #<bytecode 0xd96b29>)(#<hash-table equal 2/65 0x24141cd>)
  lsp--parser-on-message(#s(lsp--parser :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "" :workspace #s(lsp--workspace :parser #1 :server-capabilities #<hash-table equal 21/65 0x1d1fb5d> :registered-server-capabilities (#s(lsp--registered-capability :id "didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/65 0x249f2c9>)) :root "/home/nils/test/" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name) #<bytecode 0x19fa065>) :test\? #f(compiled-function () #<bytecode 0x19fa079>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x19fa085> :request-handlers #<hash-table equal 0/65 0x19fa129> :response-handlers #<hash-table eql 5/65 0x19db5c5> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1a95e45> :action-handlers #<hash-table equal 0/65 0x1a9611d> :major-modes (c-mode c++-mode cuda-mode objc-mode) :activation-fn nil :priority 0 :server-id ccls :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0x18fb289>) :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :message-trace nil) :host-root nil :proc #<process ccls<1>> :cmd-proc #<process ccls<1>> :buffers (#<buffer test.cpp>) :highlight-overlays #<hash-table eq 0/65 0x20d0781> :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x20d07a1> :watches #<hash-table equal 0/65 0x20d07c1> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x20d0f81>)) "{\"jsonrpc\":\"2.0\",\"id\":106,\"result\":{\"isIncomplete\":false,\"items\":[{\"label\":\"std::\",\"kind\":9,\"detail\":\"\",\"sortText\":\"   !\",\"filterText\":\"std\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"std::\"}},{\"label\":\"stdin : struct _IO_FILE *\",\"kind\":6,\"detail\":\"\",\"sortText\":\"   \\\"\",\"filterText\":\"stdin\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"stdin\"}},{\"label\":\"stdin\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   #\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"stdin\"}},{\"label\":\"stderr : struct _IO_FILE *\",\"kind\":6,\"detail\":\"\",\"sortText\":\"   $\",\"filterText\":\"stderr\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"stderr\"}},{\"label\":\"stdout : struct _IO_FILE *\",\"kind\":6,\"detail\":\"\",\"sortText\":\"   %\",\"filterText\":\"stdout\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"stdout\"}},{\"label\":\"stderr\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   &\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"stderr\"}},{\"label\":\"stdout\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   '\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"stdout\"}},{\"label\":\"STDC_HEADERS\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   (\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"STDC_HEADERS\"}},{\"label\":\"STA_DEL\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   )\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"STA_DEL\"}},{\"label\":\"strtod(const char *__restrict __nptr, char **__restrict __endptr) -> double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   *\",\"filterText\":\"strtod\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"strtod(${1:const char *__restrict __nptr}, ${2:char **__restrict __endptr})$0\"}},{\"label\":\"strtold(const char *__restrict __nptr, char **__restrict __endptr) -> long double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   +\",\"filterText\":\"strtold\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"strtold(${1:const char *__restrict __nptr}, ${2:char **__restrict __endptr})$0\"}},{\"label\":\"strtod_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) -> double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   ,\",\"filterText\":\"strtod_l\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"strtod_l(${1:const char *__restrict __nptr}, ${2:char **__restrict __endptr}, ${3:locale_t __loc})$0\"}},{\"label\":\"strfromd(char *__dest, size_t __size, const char *__format, double __f) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   -\",\"filterText\":\"strfromd\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"strfromd(${1:char *__dest}, ${2:size_t __size}, ${3:const char *__format}, ${4:double __f})$0\"}},{\"label\":\"strtold_l(const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) -> long double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   .\",\"filterText\":\"strtold_l\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"strtold_l(${1:const char *__restrict __nptr}, ${2:char **__restrict __endptr}, ${3:locale_t __loc})$0\"}},{\"label\":\"STA_MODE\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   /\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"STA_MODE\"}},{\"label\":\"STA_FREQHOLD\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   0\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"STA_FREQHOLD\"}},{\"label\":\"STA_PPSWANDER\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   1\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"STA_PPSWANDER\"}},{\"label\":\"PTHREAD_MUTEX_STALLED : enum <anonymous>\",\"kind\":20,\"detail\":\"\",\"sortText\":\"   2\",\"filterText\":\"PTHREAD_MUTEX_STALLED\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"PTHREAD_MUTEX_STALLED\"}},{\"label\":\"pthread_setattr_default_np(const pthread_attr_t *__attr) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   3\",\"filterText\":\"pthread_setattr_default_np\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_setattr_default_np(${1:const pthread_attr_t *__attr})$0\"}},{\"label\":\"pthread_attr_setdetachstate(pthread_attr_t *__attr, int __detachstate) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   4\",\"filterText\":\"pthread_attr_setdetachstate\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_setdetachstate(${1:pthread_attr_t *__attr}, ${2:int __detachstate})$0\"}},{\"label\":\"PTHREAD_MUTEX_STALLED_NP : enum <anonymous>\",\"kind\":20,\"detail\":\"\",\"sortText\":\"   5\",\"filterText\":\"PTHREAD_MUTEX_STALLED_NP\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"PTHREAD_MUTEX_STALLED_NP\"}},{\"label\":\"sched_getscheduler(__pid_t __pid) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   6\",\"filterText\":\"sched_getscheduler\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"sched_getscheduler(${1:__pid_t __pid})$0\"}},{\"label\":\"sched_setscheduler(__pid_t __pid, int __policy, const struct sched_param *__param) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   7\",\"filterText\":\"sched_setscheduler\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"sched_setscheduler(${1:__pid_t __pid}, ${2:int __policy}, ${3:const struct sched_param *__param})$0\"}},{\"label\":\"pthread_setschedprio(pthread_t __target_thread, int __prio) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   8\",\"filterText\":\"pthread_setschedprio\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_setschedprio(${1:pthread_t __target_thread}, ${2:int __prio})$0\"}},{\"label\":\"pthread_setschedparam(pthread_t __target_thread, int __policy, const struct sched_param *__param) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   9\",\"filterText\":\"pthread_setschedparam\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_setschedparam(${1:pthread_t __target_thread}, ${2:int __policy}, ${3:const struct sched_param *__param})$0\"}},{\"label\":\"wcstod(const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) -> double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   :\",\"filterText\":\"wcstod\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"wcstod(${1:const wchar_t *__restrict __nptr}, ${2:wchar_t **__restrict __endptr})$0\"}},{\"label\":\"SIG_ATOMIC_WIDTH\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   ;\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"SIG_ATOMIC_WIDTH\"}},{\"label\":\"wcstold(const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) -> long double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   <\",\"filterText\":\"wcstold\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"wcstold(${1:const wchar_t *__restrict __nptr}, ${2:wchar_t **__restrict __endptr})$0\"}},{\"label\":\"wcstod_l(const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) -> double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   =\",\"filterText\":\"wcstod_l\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"wcstod_l(${1:const wchar_t *__restrict __nptr}, ${2:wchar_t **__restrict __endptr}, ${3:locale_t __loc})$0\"}},{\"label\":\"wcstold_l(const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) -> long double\",\"kind\":3,\"detail\":\"\",\"sortText\":\"   >\",\"filterText\":\"wcstold_l\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"wcstold_l(${1:const wchar_t *__restrict __nptr}, ${2:wchar_t **__restrict __endptr}, ${3:locale_t __loc})$0\"}},{\"label\":\"CLONE_CHILD_SETTID\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   ?\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"CLONE_CHILD_SETTID\"}},{\"label\":\"CLONE_PARENT_SETTID\",\"kind\":18,\"detail\":\"\",\"sortText\":\"   @\",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"CLONE_PARENT_SETTID\"}},{\"label\":\"PTHREAD_BARRIER_SERIAL_THREAD\",\"kind\":18,\"detail\":\"\",\"sortText\":\"  ! \",\"insertTextFormat\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"PTHREAD_BARRIER_SERIAL_THREAD\"}},{\"label\":\"pthread_attr_setguardsize(pthread_attr_t *__attr, size_t __guardsize) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !!\",\"filterText\":\"pthread_attr_setguardsize\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_setguardsize(${1:pthread_attr_t *__attr}, ${2:size_t __guardsize})$0\"}},{\"label\":\"pthread_attr_setschedparam(pthread_attr_t *__restrict __attr, const struct sched_param *__restrict __param) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !\\\"\",\"filterText\":\"pthread_attr_setschedparam\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_setschedparam(${1:pthread_attr_t *__restrict __attr}, ${2:const struct sched_param *__restrict __param})$0\"}},{\"label\":\"pthread_attr_setstackaddr(pthread_attr_t *__attr, void *__stackaddr) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !#\",\"filterText\":\"pthread_attr_setstackaddr\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_setstackaddr(${1:pthread_attr_t *__attr}, ${2:void *__stackaddr})$0\"}},{\"label\":\"pthread_attr_setschedpolicy(pthread_attr_t *__attr, int __policy) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !$\",\"filterText\":\"pthread_attr_setschedpolicy\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_setschedpolicy(${1:pthread_attr_t *__attr}, ${2:int __policy})$0\"}},{\"label\":\"pthread_condattr_setpshared(pthread_condattr_t *__attr, int __pshared) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !%\",\"filterText\":\"pthread_condattr_setpshared\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_condattr_setpshared(${1:pthread_condattr_t *__attr}, ${2:int __pshared})$0\"}},{\"label\":\"pthread_attr_setinheritsched(pthread_attr_t *__attr, int __inherit) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !&\",\"filterText\":\"pthread_attr_setinheritsched\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_setinheritsched(${1:pthread_attr_t *__attr}, ${2:int __inherit})$0\"}},{\"label\":\"pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, int __pshared) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !'\",\"filterText\":\"pthread_mutexattr_setpshared\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_mutexattr_setpshared(${1:pthread_mutexattr_t *__attr}, ${2:int __pshared})$0\"}},{\"label\":\"pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *__attr, int __pref) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !(\",\"filterText\":\"pthread_rwlockattr_setkind_np\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_rwlockattr_setkind_np(${1:pthread_rwlockattr_t *__attr}, ${2:int __pref})$0\"}},{\"label\":\"pthread_rwlockattr_setpshared(pthread_rwlockattr_t *__attr, int __pshared) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !)\",\"filterText\":\"pthread_rwlockattr_setpshared\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_rwlockattr_setpshared(${1:pthread_rwlockattr_t *__attr}, ${2:int __pshared})$0\"}},{\"label\":\"pthread_barrierattr_setpshared(pthread_barrierattr_t *__attr, int __pshared) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !*\",\"filterText\":\"pthread_barrierattr_setpshared\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_barrierattr_setpshared(${1:pthread_barrierattr_t *__attr}, ${2:int __pshared})$0\"}},{\"label\":\"pthread_attr_getstackaddr(const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !+\",\"filterText\":\"pthread_attr_getstackaddr\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_getstackaddr(${1:const pthread_attr_t *__restrict __attr}, ${2:void **__restrict __stackaddr})$0\"}}]}}")
  #f(compiled-function (proc output) #<bytecode 0x19f6b41>)(#<process ccls<1>> "(\",\"filterText\":\"pthread_rwlockattr_setkind_np\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_rwlockattr_setkind_np(${1:pthread_rwlockattr_t *__attr}, ${2:int __pref})$0\"}},{\"label\":\"pthread_rwlockattr_setpshared(pthread_rwlockattr_t *__attr, int __pshared) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !)\",\"filterText\":\"pthread_rwlockattr_setpshared\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_rwlockattr_setpshared(${1:pthread_rwlockattr_t *__attr}, ${2:int __pshared})$0\"}},{\"label\":\"pthread_barrierattr_setpshared(pthread_barrierattr_t *__attr, int __pshared) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !*\",\"filterText\":\"pthread_barrierattr_setpshared\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_barrierattr_setpshared(${1:pthread_barrierattr_t *__attr}, ${2:int __pshared})$0\"}},{\"label\":\"pthread_attr_getstackaddr(const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) -> int\",\"kind\":3,\"detail\":\"\",\"sortText\":\"  !+\",\"filterText\":\"pthread_attr_getstackaddr\",\"insertTextFormat\":2,\"textEdit\":{\"range\":{\"start\":{\"line\":5,\"character\":4},\"end\":{\"line\":5,\"character\":7}},\"newText\":\"pthread_attr_getstackaddr(${1:const pthread_attr_t *__restrict __attr}, ${2:void **__restrict __stackaddr})$0\"}}]}}")
  read-event(nil t 0.5)
  sit-for(0.5 t)
  company--fetch-candidates(#("std" 0 1 (fontified nil) 1 2 (fontified nil) 2 3 (fontified nil)))
  company-calculate-candidates(#("std" 0 1 (fontified nil) 1 2 (fontified nil) 2 3 (fontified nil)) nil)
  company--begin-new()
  company--perform()
  company-auto-begin()
  company-idle-begin(#<buffer test.cpp> #<window 3 on test.cpp> 124 87)
  apply(company-idle-begin (#<buffer test.cpp> #<window 3 on test.cpp> 124 87))
  timer-event-handler([t 23704 60368 890004 nil company-idle-begin (#<buffer test.cpp> #<window 3 on test.cpp> 124 87) nil 456000])

The same configuration works flawlessly on another machine using ArchLinux with official emacs and ccls from AUR.

Thanks in advance!

NilsBrause commented 5 years ago

When instrumenting company-lsp--on-completion with C-u C-M-x to edebug it, it works flawlessly. I'll use this as a workaround for the time being, but it's not a real solution.

yyoncho commented 5 years ago

I believe that if you delete .elc files in your emacs.d directory will fix the issue.

NilsBrause commented 5 years ago

That works! Thanks!