Cannot get YCM to work with yaml-language-server

78 views
Skip to first unread message

Vlad Rusu

unread,
Dec 20, 2021, 4:44:37 AM12/20/21
to ycm-users
Hi! I'm trying to setup YouCompleteMe to use the yaml-language-server. Managed to make the setup, but every time I ask for completion, I receive the following error:

ResponseFailedException: Request failed: -32603: Request textDocument/completion failed with message: Cannot read properties of undefined (reading 'filter')

My .vimrc snippet setting up the yaml ls is just as in the ycm-core examples:

\ { 
    \ 'name': 'yaml',
    \ 'cmdline': [ 'yaml-language-server', '--stdio' ],
    \ 'filetypes': [ 'yaml' ], \ 'capabilities': { 'textDocument': { 'completion': { 'completionItem': { 'snippetSupport': v:true } } } },
\ },

I also tried to use the Kubernetes schema by setting up a .ycm_extra_conf.py in my home directory (which gets executed, as I added logs in it). The same error occurs regardless of the presence of .ycm_extra_conf.py:

def Settings(**kwargs):
    if kwargs["language"] == "yaml":
        return {
            "ls": {
                "yaml.schemas": {
                    "kubernetes": "/*.yaml"
                },
            }
        }

Any idea what might be wrong or missing in the setup?

Ben Jackson

unread,
Dec 21, 2021, 11:40:49 AM12/21/21
to ycm-users
Unfortunately, this is a known bug in the yaml language server that's unlikely to be fixed: https://github.com/ycm-core/lsp-examples#known-issues

I think that the yaml-language-server does work with my fork of YCM which supports snippet completions, but YMMV if you try that. I often mess around with the repo and force-push etc.

Reply all
Reply to author
Forward
0 new messages