-
-
Notifications
You must be signed in to change notification settings - Fork 954
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
Support for workspaceFolders #341
Comments
In your |
Thanks. Unfortunately this does not work. The result is the same. Could you elaborate on why this setting is necessary? The compilation data base file should contain all required paths and flags. Here's the coc config for clangd I use:
and for ccls
As ccls does provide more features, I'd like to use ccls. Thanks again for the quick response. Regards, Robert |
Hm, I got the problem, coc doesn't have correct workspace folders yet, it only send current one to language server. I'm working on CocList feature, that would add workspace folder support. |
Just to chime in, I'm facing the same, if not a similar issue. 12:51:28 ccls initialize.cc:340 I add workspace folder <one_level_above> |
Vim doesn't have concept of workspace, so we need to build one. Workspace would have |
If you want a workaround for that, I have that exact same problem. I think it is because it finds a git-folder in the folder above. If I create an empty folder named .git in the correct path everything works again. I want it to use my compilation_commands.json as a rootmarker, which i think used to work. But now it seems like the git folder has a higher priority. I first noticed the problem after the |
I've changed client to send current workspaceFolder (resolved form The |
I had given compile_commands.json as a rootpattern and it failed to change the workspace path. In addition, it didn't load the compile_commands.json. |
It's worth noticing that there's missing It would be weird that I didn't try the relative path issue. I'd just like to comment, the wiki is good reference for good defaults for |
@oblitum With coc.nvim + ccls configured exactly as given in the wiki, I'm seeing the same exact bug as reported by @aravind2612krishna and @ripperapid, and fixed by the exact same workaround (add a dummy |
@wbthomason I can't reproduce this, I use |
@wbthomason did you actually copy the |
@oblitum Yup, I tried that, as well as keeping it in I have, however, just tried reintroducing |
I'll also note that my unchanged setup worked previously with LanguageClient-Neovim without any further configuration of |
Can't reproduce this, I just copied a project to |
I do my configuration from |
Indeed, trying your configuration in my .vimrc does not change anything. Interestingly, when I try the same test you did (in my case, making a fresh Meson project in a temp dir), EDIT: I spoke too soon. By adding a layer of nesting in the directories, I can reproduce the issue. |
Not sure how you see that, the LSP clients are completely different, and each is configured in their own way. That one client is configured correctly doesn't imply the other is. |
Well, so I guess that's what needs to be clarified. |
coc_ccls_bug_example.tar.gz This directory structure mimics my more complex project. |
Indeed I was simply unable to get the include recognized. I've even simplified [
{
"directory": "/tmp/coctest/example/barfoo",
"command": "c++ -I/tmp/coctest/example/barfoo/foobar/include -std=c++17 -c example.cc",
"file": "example.cc"
}
] Even then, The above simplified |
I think that makes things a lot simpler to understand, and it's some very basic issue, still no sure whether it's coc or ccls to blame, but |
Funny, I did |
ping @chemzqm. Given the above resolution, do you still think this is a matter of more complex workspaceFolder support to fix it? It looked like a simpler bug for me. |
I am facing a similar issue; any help or workaround would be great. My coc-config file is as listed below; the code directory consists of multiple nested git repositories.
I created a file /home/code/.ccls-root I tried setting rootPatterns to compile_commands.json, .ccls-root (touch .ccls-root) but none of them are able to set the workspace-directory in ccls correctly. I am just dealing with 1 large code-base so don't really indend to use multiple workspaces for now. Just to confirm the problem the async linting is working file but none of the goto definition, implementation type things are working. LanguageClient-neovim doesn't have support for workspace directories (afaik) and it was able to find the LC root directory correctly probably just using compile_commands.json since I didn't have to specify anything on it. Here, I also need to specify compile_commands.json manually; I would very much like to switch to coc.nvim since it works better than languageclient-neovim which seems to get stuck ever so often for me. |
Those configurations're not supported, install coc-json to get completion and validation support. |
Thanks! It works after using "coc.preferences.rootPatterns"; sorry for the dumb question; I was earlier using in-line config from my .vimrc so missed the prefixes when I tried coc config. |
I think I'm hitting something related to this issue more explicitly now when trying purescript-language-server. If I open a file with if executable('purescript-language-server')
let languageservers['purescript'] = {
\ 'command': 'purescript-language-server',
\ 'args': ['--stdio'],
\ 'filetypes': ['purescript'],
\ 'rootPatterns': ['bower.json', 'psc-package.json', 'spago.dhall']
\ }
endif I don't understand why |
On
If I just run
|
Does setting |
It's not, please provide verbose output from language server. |
|
rootPath and rootUri is expected, the problem is language server doesn't respect them, but use cwd of process instead. |
Hmm, ok, thanks @chemzqm. |
@chemzqm any explanation why |
It affect workspaceFolders, I think I should pass workspaceFolders same as rootUri until there's real workspaceFolders support. |
I just disabled workspaceFolders support in language-client, since it's not workspaceFolders should be. |
@chemzqm ok, thanks. Sadly it produced no effect to that purescript server :-/, exactly same behavior (not working opening with |
@oblitum verbose output from language server is needed, |
Here's the log, I couldn't find any tip how
|
|
@chemzqm no no, this happened previously too, I just stripped it before because it's not important. It can't find the output directory because it's at |
It requries workspaceFolders and configuration to work, an extension could help. |
fyi: problem with purescript server got fixed in some of the latest commits 👍 |
Hi,
I'm having problems to get nvim.coc with ccls working with out-of-tree kernel modules. Initially I thought it is an ccls issue. The full description of my problem is here: MaskRay/ccls#201
I have a folder structure e.g. like this:
An example entry for the "mymod.c' of the compile_commands.json looks like this:
As you can see, all paths (e.g. include paths) are relative to the "directory" entry of the json node. However, ccls can't find the headers includes in the module.
The author of ccls suggested that this is an issue of my client (nvim.coc) configuration.
Any suggestions what might be the issue here? And what configuration of nvim.coc might affect this issue?
Thanks in advance,
Robert
The text was updated successfully, but these errors were encountered: