abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
384 stars 46 forks source link

flycheck-ycmd wrong type argument: arrayp, nil #463

Closed he-la closed 6 years ago

he-la commented 6 years ago

flycheck-ycmd in a C++ project throws the error "wrong-type-argument arrayp nil". There are no errors in the ycmd log, this appears to be some misconfiguration either in the flycheck-ycmd package or possibly with my machine. Setting debug-on-error is not very useful as it simply shows flycheck's invocation with nothing specific to ycmd. I am at a bit of a loss as to where to further debug the issue.

My system is Arch Linux with the latest ycmd and emacs-ycmd (reported as 1.3snapshot, package 20171111.854).

abingham commented 6 years ago

It sounds like you've got the correct emacs-ycmd versions, but you should also check that you've got the latest flycheck. You probably do, but it's good to verify.

The next thing to verify is that ycmd completion is working at all. A good way to do this is with the ycmd-display-completions command. In a C++ buffer, start typing something which you would expect to have some completions. The run ycmd-display-completions to see the completions that ycmd offers. This bypasses flycheck and helps us determine if the ycmd infrastructure is working.

Also, run the ycmd-show-debug-info command and post the results here.

Try those things and let's see where to go next.

he-la commented 6 years ago

Sorry, I should have mentioned that ycmd completion and ycmd eldoc are working fine; the issue is isolated to flycheck-ycmd. Also, flycheck is the latest version.

Ycmd debug info shows nothing immediately interesting:

((python
    (executable . "/usr/bin/python")
    (version . "3.6.4"))
 (clang
    (has_support . t)
    (version . "clang version 7.0.0 (trunk 326028)"))
 (extra_conf
    (path . "/home/henrik/.emacs.d/ycmd/ycmd_conf_global.py")
    (is_loaded . t))
 (completer
    (name . "C-family")
    (servers)
    (items
     ((key . "compilation database path")
        (value . "None"))
     ((key . "flags")
        (value . "['Wall', '-Wextra', '-Werror', '-Wno-c++98-compat', '-Wno-c++98-compat-pedantic', '-Wno-long-long', '-Wno-variadic-macros', '-fexceptions', '-DNDEBUG', '-DUSE_CLANG_COMPLETER', '-std=c++17', '-x', 'c++', '-isystem', '/home/henrik/.emacs.d/ycmd/../BoostParts', '-isystem', '/System/Library/Frameworks/Python.framework/Headers', '-isystem', '/home/henrik/.emacs.d/ycmd/../llvm/include', '-isystem', '/home/henrik/.emacs.d/ycmd/../llvm/tools/clang/include', '-I', '/home/henrik/.emacs.d/ycmd/.', '-I', '/home/henrik/.emacs.d/ycmd/./ClangCompleter', '-isystem', '/home/henrik/.emacs.d/ycmd/./tests/gmock/gtest', '-isystem', '/home/henrik/.emacs.d/ycmd/./tests/gmock/gtest/include', '-isystem', '/home/henrik/.emacs.d/ycmd/./tests/gmock', '-isystem', '/home/henrik/.emacs.d/ycmd/./tests/gmock/include', '-resource-dir=/home/henrik/.emacs.d/ycmd/ycmd/../clang_includes', '-fspell-checking']")))))
he-la commented 6 years ago

Turns out I was overriding the ycmd checker with flycheck-clang-tidy, so the issue was actually unrelated to ycmd but for some reason got triggered by instaling flycheck-ycmd.

abingham commented 6 years ago

That's good, because I was baffled! I'm glad you got it working.