-
Notifications
You must be signed in to change notification settings - Fork 298
Integrated a new c/c++ language server: cquery #1016
Comments
Thanks for logging the issue, @saibing ! Yes, unfortunately our configuration doesn't support this currently... But it would make sense to have something like this, ie:
Will use this to track setting the |
A good place to start looking is here:
Which is the code responsible for taking the configuration settings and handing them off to the language client. |
FYI |
I'd like to ask how you would like to detect the project root. When there are subpackages, the root
Sorry for pasting the link of the Emacs lsp-mode discussion thread. But they have the same issue |
@MaskRay Now I can solve this problem by add follow config into config.tsx "language.cpp.languageServer.rootFiles": ["compile_commands.json", ".cquery"],
"language.cpp.languageServer.arguments": ["--init", '{"cacheDirectory": "/tmp/oni_cquery"}'], |
@saibing Sorry, is cquery working for you with Oni? By inspecting the debugger console, there is written
|
For cquery users, you may consider ccls. It differs a lot from cquery now (5000 lines fewer, fewer third-party dependencies, IMO simpler but better pipeline, slightly better memory index). You can find some rationale for the fork at emacs-lsp/emacs-ccls#1 |
@Free-Easy I'm receiving the same error in the console as @Free-Easy. @saibing could you provide your configuration? And maybe a mention of cquery in the wiki would be nice. |
Indeed, a working cquery/ccls config would be great to see - can't seem to get either to work properly. |
I just gave ccls (fork of cquery) a go, after clangd failed miserably, giving lots of spurious errors (despite the c++ command that clangd was supposedly running, evidenced from Oni's STDERR log, giving no errors when run independently...). ccls, on the other hand, is working beautifully. My Oni configuration is as below (with the binary path altered for brevity)
Initially it didn't work, so I added the Oh, there was one other custom thing I did. I modified the build of ccls to use clang 7 (the current master defaults to clang 6), but I doubt that would make much difference to Oni integration. |
@feltech Would you mind adding your lsp config to https://github.com/onivim/oni/wiki/Language-Support#cc? |
OK, done. I didn't realise we could edit the wiki so easily! I'll have to think of some more useful stuff to add... |
Also, the
That stopped the warning in the console, at least. |
@feltech re. the grammar issue the text mate grammars allow oni use textmate syntax highlighting for different file types which tend to be richer than vim ones, a good source tends to be vscode or atom but any good one will do, you should see better highlighting with that change? also we are actually trying to amass as many bundled grammars as possible as they tend to be quite small files and massively improve the appearance of different file types |
@Akin909 Does this mean that Oni has its own engine for syntax highlighting, instead of the (slow) engine provided by Vim/Neovim? Does it run in another thread? |
@Free-Easy we use textmate grammars to parse and tokenize a file this happens in js (on the main thread atm although were looking at offloading this using As a random side note/ tangent I personally am quite keen on looking into adding an option to use |
Some more on ccls/cquery with Oni... I was a bit premature in my optimism. In particular, completions are a pain. I gave up on ccls and moved to cquery to see if that was any better, but they seem to suffer the same problems. In particular I have discovered (so far):
|
Updated wiki with config for cquery and a warning about code completion. |
The issue is that ccls/cquery do not set
If you find snippets
If this is ever an issue, there must be something wrong on oni's side. They work pretty well in other language clients (lsp-mode, LanguageClient-neovim, vscode-languageclient) |
Like I say, I found that cquery does set it, and sets it to
Yeah I found the code in Oni responsible for that and started work on a fix, but the logic is a bit fiddly, to say the least! |
@feltech For the single character The client sends |
I'm try a new c/c++ language server: cquery
CQuery is a Low-latency language server for large C++ code-bases, powered by libclang. It is much more powerful than clangd.
But I ran into some trouble that cquery need add some initializationOptions:
How to use cquery with LanguageClient-neovim
May be Oni need to support config language server's initializationOptions?
The text was updated successfully, but these errors were encountered: