-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ccls: remove inaccurate vscode client initialization options from docgen #70
Comments
That would depend on whether it's "initialization options" or "workspace configuration." This is one of my least favorite parts of the LSP protocol, which is that there are many different ways to send initial configurations to the client:
Without looking into it further, I'd double check which one EDIT: Nvm I looked at our README and it does state that |
Indeed using A side question: there are three options under |
Those values are scraped directly from the package.json in the vscode extension. I guess that it's impossible to know if they are init_options or settings, but they are things that the |
Got it, thanks. Feel free to close the issue, but I feel the README is a little confusing. |
I'm going to leave it open as a reminder to improve the README :P |
I also found this confusing This is what I thought the docs were telling me to do nvim_lsp.ccls.setup{
settings = {
ccls = {
misc = {
compilationDatabaseDirectory = "build"
}
}
}
} And this is what I actually needed nvim_lsp.ccls.setup{
init_options = {
compilationDatabaseDirectory = "build"
}
} |
@cdelledonne Can you look at #528, I tried to make it clear the customization for ccls is all set via on_init. Many servers are inconsistent with whether configuration is done via settings/init options, so I think the best thing we can do is just have good documentation for each one. |
Ah, you are correct. Docgen automatically adds that nvim-lspconfig/scripts/docgen.lua Line 152 in 384e512
Not sure the best thing to do about that, it should probably be removed and manually added to each server. Other than removing that, is there anything you would improve? |
I do have one more question: the example shows how to set the init_options = {
compilationDatabaseDirectory = "build";
...
} but the list of options presents it as init_options = {
misc = {
compilationDatabaseDirectory = "build";
};
...
} Do all |
Does that work for you? I might just remove the package.json for ccls. I was going by the entry here which isn't nested under misc: |
Oh, they remap misc.compilationDatabaseDirectory to compilationDatabaseDirectory when it's sent from the client (vscode-ccls) to the server (ccls) here: https://github.com/MaskRay/vscode-ccls/blob/456f21ebf3013abbc553442dd81610f1595310f5/src/serverContext.ts#L148-L155. The documentation would be accurate if we were using the vscode client (which of course, we aren't), but we're scraping the settings from the vscode client which explains why the remapped settings are showing up in the documentation. I'm just going to remove them, because it seems like a common source of confusion. |
I'm having trouble figuring out how to specify initialization options for
ccls
(the only LSP server I've tested so far) using thesettings
key. Say I wantccls.cache.directory
to be/tmp/ccls-cache
, using a command switch I can achieve it like the followingThat works. I'd like to be able to do the same using the
settings
key, but I can't. For instance, neithernor
work. Looking into
ccls
's log, the cache option is not even being sent to the server when initializing it.Am I doing something wrong?
Environment
The text was updated successfully, but these errors were encountered: