clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
629 stars 106 forks source link

Turn off features? #90

Open dsanders11 opened 3 years ago

dsanders11 commented 3 years ago

Is it possible to turn off features from the extension? For example, if I only want clang-tidy there's a lot of extra functionality included that it's not clear how to turn off.

philippewarren commented 6 months ago

I would also like to have the option to choose which features to use. In my case, I would like to use only the clang-tidy on-the-fly checks.

HighCommander4 commented 6 months ago

If you're only looking for clang-tidy diagnostics, a dedicated plugin for that like this one might be a better fit.

philippewarren commented 6 months ago

I am using the clang-tidy integration in the Microsoft C/C++ extension, but it has the same limitation as the one you linked. They both use the clang-tidy executable and not clangd, which means that the diagnostics are only available on file save, and it can take about 30 seconds for them to run. I have not found any extension providing the clang-tidy checks on-the-fly except for this one, but it is providing a lot more that I don't need to use because the Microsoft extension provides it.

HighCommander4 commented 6 months ago

Ok, I see.

We can probably consider adding feature toggles on a case-by-case basis. We recently had https://github.com/clangd/vscode-clangd/issues/588 filed about disabling auto-completion.

Can you list other features you'd like to disable?

philippewarren commented 6 months ago

Most features. I'd like to be able to use the clangd provided diagnostics as an addition, while still using the Microsoft C/C++ extension for most functionnalities (autocompletion, navigation, syntax highlighting, etc.) Is it doable?

HighCommander4 commented 6 months ago

Technically it's probably doable.

I'd be interested in learning more about the use case though. Why do you prefer the Microsoft extension's navigation or syntax highlighting to clangd's?

philippewarren commented 6 months ago

Actually, I really like clangd.

There used to be a bug in the MS C++ extension that caused it to fail to start if IntelliSense was disabled, which caused problems with an extension which depended on it for it's debugging functionnality. Also, since clangd is only a language server, some features were then missing (debugging, for instance). It should be better now, as this was a while ago and should have been fixed since.

I'll give clangd another shot, whilst having the MS C++ extension enabled, but with IntelliSense disabled. Maybe that will be good for my use.

Also, the configuration options are harder to work with using clangd. The clangd configuration page on the website could be mentionned in the README so that it is visible when installing the extension. There could be an option to export a default .clangd configuration file with all settings set to the default values, to allow discovery of what is possible (probably a separate issue though).