Skip to content
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

Add .clangd file #92

Merged
merged 3 commits into from
Aug 20, 2023
Merged

Add .clangd file #92

merged 3 commits into from
Aug 20, 2023

Conversation

noahfrn
Copy link
Contributor

@noahfrn noahfrn commented Jul 28, 2023

I've added a default .clangd compilation database for people who might be using clangd directly as their LSP, for example from vim/neovim. The default dev profile will export the compile commands by default, so I think it makes sense to point the default CompilationDatabase to that directory as well.

@friendlyanon
Copy link
Owner

That seems like a good idea, however the file seems to only work for a single build directory: https://clangd.llvm.org/config#compilationdatabase

The user presets by default already come with many possible build folder locations: https://github.com/friendlyanon/cmake-init/blob/master/cmake-init/templates/common/CMakeUserPresets.json#L17

What I think would work is if this file was also in .gitignore, since then multiple users won't clobber each others' setup.

Copy link
Owner

@friendlyanon friendlyanon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this file to cmake-init/templates/common and add it to the .gitignore file as well.

.clangd Outdated
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: ./build/dev/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this can just say build/dev then please make it so.

@friendlyanon
Copy link
Owner

Ping

@noahfrn
Copy link
Contributor Author

noahfrn commented Aug 13, 2023

Hey @friendlyanon, have been busy sorry ! Not sure what you mean exactly by adding it .gitignore, apologies, I'm not familiar with the internals of cmake-init ! The file is already currently included in the .gitignore under cmake-init/templates/common.

@friendlyanon
Copy link
Owner

The file is already currently included in the .gitignore

I haven't noticed! Then please do the other requested changes.

@friendlyanon friendlyanon merged commit c8f3fa9 into friendlyanon:develop Aug 20, 2023
1 check failed
@noahfrn noahfrn deleted the patch-1 branch September 4, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants