-
Notifications
You must be signed in to change notification settings - Fork 13
Fix #436 Search .clang-format file in parent folders, before creating it #444
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@travkin79 Thanks for putting this together. I think this is generally the right idea and avoiding creating clang format files in this case is a good idea.
I see this is only a draft at the moment. I did a quick review because I would really like to get this merged by end of the day Wednesday, assuming no objection.
Let me know what I can do to make this happen.
...se.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/internal/config/ClangFormatFileHandler.java
Outdated
Show resolved
Hide resolved
...se.cdt.lsp.clangd/src/org/eclipse/cdt/lsp/clangd/internal/config/ClangFormatFileHandler.java
Outdated
Show resolved
Hide resolved
Hi @jonahgraham,
I think, I could finish the PR today. Do you know of any place where the |
…re creating it
Thanks to the feedback by Jonah Graham.
c85cb59
to
d43c8da
Compare
👍
Awesome! Thanks
I don't think it is read by the Java code. Tagging @ghentschke in case she has any additional input |
I think, there is still a limitation in the approach: the |
Your analysis is correct - the resource change listener is there to validate the clang format file. There are still some wider issues with this and I will add a comment about this case to #400 I don't think this is blocking as having CDT LSP create the clang format file when it shouldn't is a worse error to me than missing some invalid .clang-format settings. |
I have submitted this now because I would like it in RC1 which I will publish today. @ghentschke I didn't wait for your review, if you want a change let me know andI can do a respin of RC1, otherwise it will make it into RC2. |
@jonahgraham I fine. Thank you. |
Instead of creating a .clang-format file for each project, CDT LSP now would check if there is a .clang-format file in some of the project's parent folders and use that. This way, multi-project directory structures (multi-project git repos) can offer common settings in their root folder that apply to all contained projects.