How to disable LSP snippets

I manage my own snippets using Ultisnips, I don’t want conflicting snippets from the LSP server.

image

After Googling around it sounds like I should be able to disable snippets by doing:

lspconfig.yang_lsp.setup {
  on_attach = lsp_on_attach,
  capabilities = {
    textDocument = {
      completion = {
        completionItem = {
          snippetSupport = false
        }
      }
    }
  }
}

But that doesn’t work, compe is still suggesting LSP snippets.

I can’t just disable the LSP source in nvim-compe altogether, they are the primary reason I bother to use a completion plugin. Auto completion for types and identifiers from the LSP are invaluable.

I’m not sure how LSP capabilities work, is it just a “suggestion” for the LSP server that I don’t want snippets? Can the LSP server ignore it and suggest them anyway? If so, how do I get rid of them?

(I’m using nvim-compe)


I’m using nvim-lspconfig with yang-lsp:

-- Custom config for YANG language server
--
lspconfig_configs.yang_lsp = {
  default_config = {
    cmd = { "yang-language-server" },
    filetypes = { "yang" },
    root_dir = function(fname)
      return lsputil.root_pattern("yang.settings")(fname)
    end,
  },
  docs = {
    description = [[
TODO
    ]],
  },
}