-
Notifications
You must be signed in to change notification settings - Fork 4
Clangd extraFlags extension is going away #16
Comments
@sam-mccall Thanks for the heads up! Based on your descriptions of the alternatives, I think perhaps going the protocol extension route makes most sense. Although if that is not currently available to all users, I might have to implement some type of logic to either assist users in renaming/symlinking Since this Atom package is still highly experimental, requiring users to use an up-to-date version of Clangd shouldn't be a problem. If I can avoid supporting both the old and new method, I'll be very happy. Is there any documentation (or tests) that I can look at to get a reasonable understanding of the new functionality? In the past I had to dig through a lot of the implementation to figure things out. |
Hi Thomas,
I think this mostly a drop-in replacement for your use case - you can pass the same data that's currently being passed to Because clangd ignores unknown extensions, I do think passing both extensions will be simplest, but up to you. Additionally in the long run recommending Cheers, Sam |
Summary: The new implementation is a GlobalCompilationDatabase that overlays a base. Normally this is the directory-based CDB. To preserve the behavior of compile_args_from=LSP, the base may be null. The OverlayCDB is always present, and so the extensions to populate it are always supported. It also allows overriding the flags of the fallback command. This is just unit-tested for now, but the plan is to expose this as an extension on the initialize message. This addresses use cases like thomasjo/atom-ide-cpp#16 Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53687 llvm-svn=345970
Summary: The new implementation is a GlobalCompilationDatabase that overlays a base. Normally this is the directory-based CDB. To preserve the behavior of compile_args_from=LSP, the base may be null. The OverlayCDB is always present, and so the extensions to populate it are always supported. It also allows overriding the flags of the fallback command. This is just unit-tested for now, but the plan is to expose this as an extension on the initialize message. This addresses use cases like thomasjo/atom-ide-cpp#16 Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53687 llvm-svn: 345970
Hi Thomas,
I'm afraid we're likely to remove the
extraFlags
extension that atom-ide-cpp is using: https://reviews.llvm.org/D53641Clangd has grown lots of methods of customizing compile commands. They overlap and have subtle differences, and this is causing us some reasoning about how new features should behave.
I think there are a few good alternatives:
compile_flags.txt
is a fully-supported alternative tocompile_commands.json
for specifying compile commands for simple projects. It has exactly the same format as.clang_complete
so renaming or symlinking this file will work for users.clang $FILENAME $EXTRA_FLAGS
, orclang -xobjective-c++-header $FILENAME $EXTRA_FLAGS
for *.h files. Happy to provide more details.Hopefully one of these will work well enough. You may need to respect both the old and new method for a while, because of version skew.
Happy to help out with migration if you like!
Cheers, Sam
The text was updated successfully, but these errors were encountered: