可以在Netbeans中使用Clang格式 [英] Can Clang formatting be used in Netbeans

查看:164
本文介绍了可以在Netbeans中使用Clang格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在NetBeans 8.1中使用clang格式化程序?如果重要的话,我正在Arch Linux上运行NetBeans.

Is there a way to use the clang formatter with NetBeans 8.1? I'm running NetBeans on Arch Linux, if it matters.

推荐答案

在您发布问题时,答案是否定的,但是现在(一年后!),您可以在NetBeans中使用clang格式化程序,具体取决于受到以下限制:

At the time you posted your question the answer was no, but now (over a year later!) you can use the clang formatter in NetBeans, subject to the following constraints:

  1. 您必须使用NetBeans 8.2版而不是8.1版.

  1. You must use version 8.2 of NetBeans rather than version 8.1.

您必须从最近的夜间开发版本安装而不是使用标准版本的NetBeans 8.2.这是因为此功能是最近才添加的.请参见 NetBeans错误270882 .

You must install from a recent nightly development build of NetBeans 8.2 rather than using the standard release. That's because this functionality was only added recently. See NetBeans bug 270882.

要在NetBeans中使用clang格式化程序,请执行以下操作:

To use the clang formatter in NetBeans:

  • 在NetBeans中创建简单的C ++应用程序.

  • Create a trivial C++ application in NetBeans.

项目选项卡中选择其项目节点,右键单击,然后从弹出菜单中选择属性.

Select its project node in the Projects tab, right click, and select Properties from the popup menu.

在打开的 Project Properties 窗口中,单击类别列表中的 Formatting .

In the Project Properties window that opens click Formatting in the list of categories.

在屏幕的右侧,有一个名为 Use clang-format 的新单选按钮.单击该按钮,然后可以使用预定义的样式,也可以提供自己的自定义格式文件,如下面的屏幕截图所示.

On the right side of the screen there is a new radio button named Use clang-format. Click that, and you can then either use a predefined style, or supply your own customized format file, as shown in the screen shot below.

这篇关于可以在Netbeans中使用Clang格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆