简体   繁体   English

在Eclipse中的整个C项目上运行自动格式化程序

[英]Run auto formatter on an entire C project in Eclipse

I am using Eclipse 4.6.3 and I want to run the auto formatter on an existing C project. 我正在使用Eclipse 4.6.3,并且想在现有的C项目上运行自动格式化程序。

Apparently, this works for java: How to format all Java files in an Eclipse project at one time? 显然,这适用于Java: 如何一次格式化Eclipse项目中的所有Java文件格式?

When I select single/multiple *.c/*.h source files explicitly and run "Source->Format", auto formatter works correctly. 当我明确选择单个/多个*.c/*.h 。h源文件并运行“ Source-> Format”时,自动格式化程序将正常工作。 However, when I run "Source->Format" on the root directory, then only xml files in this directory are being auto formatted. 但是,当我在根目录上运行“ Source-> Format”时,则仅自动格式化该目录中的xml文件。

Are there any settings that allow me to run the autobuilder on every *.c/*.h file in my project? 是否有任何设置可以让我在项目中的每个*.c/*.h 。h文件上运行自动生成器?

open the files using eclipse, select all using ctrl + a . 使用eclipse打开文件,使用ctrl + a选择所有文件。 Then hit ctrl + shift + F to format the file. 然后按ctrl + shift + F格式化文件。

This works with java, maybe you can only modify the files manually in the method I stated above. 这适用于Java,也许您只能按照我上面所述的方法手动修改文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM