-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
make c-c++ layer respect .clang-format file more closely #13227
Comments
In your SO link did you try the solution#2: https://stackoverflow.com/a/55784057 ? If it works we can add it to |
This is likely due to difference in indentation of line and region functions: lsp assigns only indent-region function to lsp-format-region, but indent-line is c-indent-line, which is called upon newline or other actions. |
Does not look like I find time to do this, I will add the label for help wanted. |
The solution is easier than I thought. First we already have The underlying Therefore what we need here is to lookup for |
I propose to extend
|
Sounds good |
is it fixed ? if yes how ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
I'm running on the develop branch of spacemacs, using the c-c++ and lsp layers.
I use clang-format for C/C++, I don't know how to configure c-c++ mode to respect more of the clang-format rules as I'm editing. My main issue at the moment is that emacs tries to auto-indent inside the top-level of a namespace scope, whereas if I format the buffer, I get the desired behaviour of no indentation. (I've tried using
c-c++-enable-clang-support t
as referenced by this issue, but it doesn't do anything).Similarly, I have to manually set the
c-basic-offset
to match the project I'm working on. This information is readily available in a clang-format file, so I would imagine it's possible to auto-set these things when a clang-format file is discovered. (This is related to this issue however what I'm asking about has a wider scope).Is there something I'm missing, or is support for this kind of thing not in spacemacs yet? If not, I think this would be a good feature. Is it feasible?
Other related links:
The text was updated successfully, but these errors were encountered: