Languageclient-neovim: How to set InitializeParams.initializationOptions?

Created on 18 Nov 2017  路  5Comments  路  Source: autozimu/LanguageClient-neovim

I am trying to get this client working with CQuery, a new C++ language server. However, it reported that FATL| Initialization parameters (particularily cacheDirectory) are required in its log because during initialize, initializationOptions.cacheDirectory must be set.

It seems that currently there is no way to set these options in this plugin. This problem also affects clangd, which by default works only in C++98 mode and considers all syntax in C++11 as errors. Is it possible to set initializationOptions with default values/callback functions?

Thanks.

Most helpful comment

It's better to have some way to use different initializationOptions for different language servers

{
        "initializationOptions": {
                "cacheDirectory": "/tmp/cquery",
        "resourceDirectory": "yourCQueryDirectory/clang_resource_dir"
        }
}

All 5 comments

Resolved in ef2b82c41a864e8b26e58897e4bb7f4dd5576cd2.

I added a little wiki page to help to settup cquery with LanguageClient-neovim https://github.com/autozimu/LanguageClient-neovim/wiki/cquery

It's better to have some way to use different initializationOptions for different language servers

{
        "initializationOptions": {
                "cacheDirectory": "/tmp/cquery",
        "resourceDirectory": "yourCQueryDirectory/clang_resource_dir"
        }
}

That's right, I just asked about this here: https://github.com/autozimu/LanguageClient-neovim/issues/633#issuecomment-437675277.

"Method2" of the Yaml wiki entry shows one possible way to circumvent this limitation, but it's a bit ugly: https://github.com/autozimu/LanguageClient-neovim/wiki/yaml-language-server, it uses call LanguageClient#Notify('workspace/didChangeConfiguration', { 'settings': config }) to set a different config settings path per language on an autoload script.

Was this page helpful?
0 / 5 - 0 ratings