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

c-c++-mode flycheck loads .clang_complete too late #1258

Closed
edwintorok opened this issue Apr 19, 2015 · 7 comments
Closed

c-c++-mode flycheck loads .clang_complete too late #1258

edwintorok opened this issue Apr 19, 2015 · 7 comments

Comments

@edwintorok
Copy link
Contributor

Looks like flycheck-clang-args is supposed to be set from .clang_complete at https://github.com/syl20bnr/spacemacs/blob/master/contrib/lang/c-c%2B%2B/packages.el#L122.
But the first time I open a file that doesn't happen, I have to call clang-complete, and then disable/re-enable flycheck (or make a modification and save the file) for it to take effect.

Would it be possible to invoke this from flycheck-mode-hook so that the compilation flags are correct the first time the syntax check is run? Or provide a keybinding to load/refresh these arguments.

@StreakyCobra
Copy link
Contributor

@edwintorok Do you still have this bug with the last Spacemacs release? If yes, can you try #2635 and tell us if it works?

@pszynk
Copy link

pszynk commented Nov 11, 2015

Hi, for me this problem still occurred in latest Spacemacs release, but mentioned commit from #2635 solved the problem.

One thing to watch for though !
In commit from #2635 function add-to-hooks should be renamed to spacemacs/add-to-hooks for this to work in current release.

Still a keybinding to refresh checker arguments would be a nice feature. Now when I'm modifying .clang_complete file and want to reload my changes I have to restart Spacemacs. Is there any better way?

@StreakyCobra
Copy link
Contributor

but mentioned commit from #2635 solved the problem.

Glad to hear!

In commit from #2635 function add-to-hooks should be renamed to spacemacs/add-to-hooks for this to work in current release.

Can I ask you to put this directly in the #2635 thread, so it doesn't get forgotten when merged (and you keep the credit for it ☺️) Thanks!

Still a keybinding to refresh checker arguments would be a nice feature. Now when I'm modifying .clang_complete file and want to reload my changes I have to restart Spacemacs. Is there any better way?

Have you try reloading the mode in which you are, like SPC : c++-mode RET or SPC : c-mode RET?

@edwintorok
Copy link
Contributor Author

On 11/11/2015 08:06 PM, Fabien Dubosson wrote:

but mentioned commit from #2635 <https://github.com/syl20bnr/spacemacs/pull/2635> solved the problem.

Glad to hear!

In commit from #2635 <https://github.com/syl20bnr/spacemacs/pull/2635> function add-to-hooks should be renamed to spacemacs/add-to-hooks for this to work in current release.

Can I ask you to put this directly in the #2635 #2635 thread, so it doesn't get forgotten when merged (and you keep the credit for it ☺️) Thanks!

I applied the patch from #2635 on top of 0.104.4 with this change mentioned (couldn't cherry-pick cause the filename changed too), and I confirm that it works well now.
If I type |SPC h d v flycheck-clang-args| it shows the args loaded from my .clang_complete file.

Note: I had to make sure all the relative paths in -I start with ./ so -I./.. instead of -I..

Still a keybinding to refresh checker arguments would be a nice feature. Now when I'm modifying .clang_complete file and want to reload my changes I have to restart Spacemacs. Is there any better way?

Have you try reloading the mode in which you are, like |SPC : c++-mode RET| or |SPC : c-mode RET|?

'SPC : c-mode' works.

@pszynk
Copy link

pszynk commented Nov 12, 2015

Can I ask you to put this directly in the #2635 thread, so it doesn't get forgotten when merged (and you keep the credit for it ☺️) Thanks!

I've added a comment about it on #2635

Note: I had to make sure all the relative paths in -I start with ./ so -I./.. instead of -I..

yeah, it looks like an error in the code changing relative path to absolute. I also added some info about it in my comment.

Have you try reloading the mode in which you are, like SPC : c++-mode RET or SPC : c-mode RET?

it works, thanks

@TheBB
Copy link
Collaborator

TheBB commented Nov 15, 2015

Note, since #2635 is defunct the new PR for this issue is #3819. I would appreciate review over there.

@TheBB
Copy link
Collaborator

TheBB commented Dec 9, 2015

Just merged and fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants