基于 clang 的跨平台 C++ IDE?
clang C++ 编译器声称其构建目的之一是通过为 IDE 提供 API 来实现更好的 IDE 集成用于解析代码等任务。
那么,有没有一些好的 C++ IDE 可以使用 clang 提供语义突出显示、重构以及实时查找和显示语义错误等功能?
我一直在使用 Eclipse CDT,但它的 C++ 解析器充满缺陷,导致 IDE 在代码中报告许多烦人的误报错误。我希望有一个 IDE,当且仅当编译器报告相同的错误时才报告错误,因此我对基于编译器内部构建的 IDE 感兴趣。
我主要对跨平台 IDE 感兴趣,尽管我不介意了解 Windows 或 Linux 的单平台 IDE(所以不是 Xcode),只要它们是 FOSS(另一个原因不是 Xcode)。
The clang C++ compiler claims to be built for, among other things, better IDE integration by providing an API for the IDE to use for tasks such as parsing the code.
So, are there are any good C++ IDE's that use clang to provide features such as semantic highlighting, refactoring, and finding and showing semantic errors in real-time?
I've been using Eclipse CDT, but its C++ parser is full of imperfections that cause the IDE to report a lot of annoying false positive errors in the code. I would like to have an IDE that reports an error if and only if the compiler would report the same error, hence my interest in an IDE that's built on a compiler's internals.
I'm primarily interested in cross-platform IDE's, although I wouldn't mind knowing about single-platform ones for Windows or Linux (so not Xcode), as long as they are FOSS (another reason why not Xcode).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
Qt Creator 的下一代代码解析和相关功能基于 Clang:
https://www.qt.io/blog/2011/10/19/qt-creator-and-clang
看起来非常非常有前途!
Qt Creator is basing their next-gen code parsing and associated functionality on Clang:
https://www.qt.io/blog/2011/10/19/qt-creator-and-clang
Looks very, very promising!
你试过clang完整吗?
如果你是朋克摇滚,那么 vim 就足够了 ;)
我经常使用 xcode 所以......不能真正分享第一手经验,但我知道它的存在。
have you tried clang complete?
if you're punk rock, then vim is enough ide ;)
i often work with xcode so... can't really share firsthand experience, but i knew of its existence.
gedit 并不是真正的 IDE,但有一个 使用 clang 提供代码帮助的插件
gedit isn't really an IDE, but there is a plugin for it that provides code assistance using clang
看来 CodeLite v3.5 开始 原生支持 Clang。但是我还没有发现是否可以将 LLVM 设置为后端。
It seems that CodeLite v3.5 starts supports Clang natively. However I haven't found is it possible to setup LLVM as backend.
语言服务器协议 (LSP) 项目在该领域取得了相关的新进展,该项目旨在成为一个与语言无关的 API,允许编辑器/IDE 与提供代码智能/分析的后端分离。
目前正在努力创建一个基于 clang 的 C++ 后端,名为 Clangd。
多个编辑器/IDE 正在进行中,以支持LSP 作为客户端。
一旦后端实现成熟,原则上所有支持 LSP 的编辑器都将能够利用通过 Clangd 公开的 clang 功能。
A relevant new development in this area in the Language Server Protocol (LSP) project, which aims to be a language-agnostic API that allows editors / IDEs to be decoupled from backends that provide code intelligence / analysis.
There is ongoing work to create a clang-based C++ backend called Clangd.
There is also ongoing work on several editors / IDEs to support the LSP as a client.
Once the backend implementation matures, all editors supporting the LSP will, in principle, be able to leverage clang's capabilities as exposed through Clangd.
KDevelop 现在拥有基于 clang 的 C 和 C++ 支持,包括语义分析和自动完成。它主要适用于 Linux,但(截至 2016 年 10 月)也有适用于 Windows 和 Mac 的测试版。
对于 emacs,有 irony-mode 和 rtags 提供自动完成、动态错误检查和跳转到符号等功能。当与 cmake-ide 结合使用时,它们是非常强大的工具,精通 emacs 的人可以非常在这种环境下富有成效。
KDevelop now has clang based c and c++ support, including semantic analysis and autocomplete. It is primarily for linux but (as of October 2016) has a beta release out for windows and mac as well.
For emacs there are irony-mode and rtags that provide features such as auto-complete, on fly error checking and jump to symbol. When combined with cmake-ide they are very powerful tools and one well versed in emacs can be highly productive in this environment.
不是 FOSS,而是 JetBrains(以 IDEA 和 ReSharper 闻名)正在将其 AppCode 产品构建为 完整的支持 Win/Linux/Mac 并使用 clang 的 C++ IDE。
是的,真的。
Not FOSS, but JetBrains (of IDEA and ReSharper fame) are building out their AppCode product into a full C++ IDE supporting Win/Linux/Mac and using clang.
Yes, really.
jucipp
2019 年第二季度在 GitHub 上获得约 900 颗星:https://github.com/cppit/ jucipp
现在转移到 GitLab:https://gitlab.com/cppit/jucipp
明确宣传 libclang 后端是主要功能。
jucipp
~900 stars on GitHub in 2019Q2: https://github.com/cppit/jucipp
Now moved to GitLab: https://gitlab.com/cppit/jucipp
Clearly advertises libclang backend as a main feature.