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

Clang Format error linux #2290

Closed
honigbeutler123 opened this issue Jan 7, 2019 · 19 comments
Closed

Clang Format error linux #2290

honigbeutler123 opened this issue Jan 7, 2019 · 19 comments

Comments

@honigbeutler123
Copy link

honigbeutler123 commented Jan 7, 2019

Description

Hi, i recently got an error while using the clang-format feature for cpp. The error was 'callback must be a function' and no formatting did work at all. I have to say that i am using an archlinux system (so maybe this is only an issue with a new node version or smt).

#Solution
I was able to fix the issue by going into the clang-format.coffee and insert an empty function into line 84.

from:
return @exe("clang-format").run([ @dumpToFile(dumpFile, text) ["--style=file"] ]).finally( -> fs.unlink(dumpFile) )
to:
return @exe("clang-format").run([ @dumpToFile(dumpFile, text) ["--style=file"] ]).finally( -> fs.unlink(dumpFile, ->) )

this fixed the issue for me. You might want to consider adding this to your code, because i do not thing it will be a breaking change to other systems :).

@stale
Copy link

stale bot commented Mar 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 8, 2019
@honigbeutler123
Copy link
Author

I still think this should be added since the error still exists

@stale
Copy link

stale bot commented May 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 13, 2019
@stale stale bot closed this as completed May 20, 2019
@KJLankinen
Copy link

KJLankinen commented Jul 4, 2019

I have this same error, also on Arch Linux (5.1.15-arch1-1-ARCH, x86_64). Will try the fix mentioned above.

Edit: The above mentioned fix by @honigbeutler123 worked for me as well.

@bin-haw
Copy link

bin-haw commented Jul 15, 2019

WOW,the method works for me too.I'm also on Arch Linux(5.1.16-arch1-1-ARCH)

@iamyoukou
Copy link

Works for me. I'm on macOS High Sierra 10.13.6.

@kneupane1
Copy link

kneupane1 commented Aug 9, 2019

Thanks @honigbeutler123 , it works for me too.

@MoienBowen
Copy link

I now have a issue on macOS Catalina Public Beta.
Your solution is almost prefect, just one more bracket ')' at the end.
Well, it is my case. :)

Thanks a lot for your solution, I only found this one.

@omichel
Copy link

omichel commented Oct 15, 2019

Same problem here, the patched worked for me as well. Thanks!

@hirnc
Copy link

hirnc commented Oct 29, 2019

I had the same problem on Windows 10 (Atom 1.41.0 x64). The patch worked well in my environment as well.

@julibeg
Copy link

julibeg commented Oct 29, 2019

same story on ubuntu 16.04, atom v1.40

@TheDarkTron
Copy link

Fixed it for me too, thanks!
I am on macOS 10.14.6
Atom 1.41.0 x64

@lzy-106
Copy link

lzy-106 commented Apr 27, 2020

Issue persists in latest package

@yirami
Copy link

yirami commented Aug 28, 2020

Fixed it for me too, thanks!
I am on windows 10 18363.1016
Atom 1.50.0 x64

@saisesai
Copy link

It works for me, thanks!

@serk12
Copy link

serk12 commented Apr 8, 2021

the fix from the title works for me, it should be merged, the issue it's not done yet. Thanks!

@vinimlo
Copy link

vinimlo commented Aug 25, 2021

The fix from the title works for me! It should be merged

@Ma11ock
Copy link

Ma11ock commented Feb 7, 2022

Same issue on Arch Linux and Manjaro Linux, fix worked for me as well

@na-trium-144
Copy link

I had the same issue on Linux Mint 20.3 and the fix worked for me too.

na-trium-144 added a commit to na-trium-144/atom-beautify that referenced this issue Sep 28, 2022
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