objective-c - 支持多语言的 objc 语法高亮库?

标签 objective-c cocoa syntax-highlighting

我来自 ruby​​ 和 python 世界,我们有许多库可以在语法上突出显示来自多种语言的任意代码。我正在 objc 生态系统中寻找类似的东西,但我似乎找不到这样的东西,有没有可用的?

Ruby 中的等价库是 CodeRayPygments对于 Python,

提前致谢!

最佳答案

栏杆,

我自己已经搜索了很长时间来寻找一个漂亮而强大的 Cocoa 语法荧光笔,并且由于我目前正在自己​​构建一个面向代码的文本编辑器,所以这将是该项目的主要部分。

所以,我发现有很多 Objective-C/Cocoa 友好的语法高亮库/组件。对于初学者(对于一些相对基本的东西,也就是说),我建议你看一下:


但是,如果您真的需要一些功能强大、经过充分测试且仍然对 Cocoa 友好的东西,我绝对建议您尝试 the Scintilla component (for Cocoa) .代码很棒,社区(位于 Scintilla-Interest 组)将很乐意帮助您解决您可能遇到的任何问题。

简而言之:

我目前正在一个即将发布的大项目中使用它,它对我来说效果很好。


闪烁体

Scintilla is a free library that provides text-editing functions, with an emphasis on advanced features for source code editing. SciTE (cross-platform), Geany, Notepad++ (Windows), and Notepad2 (Windows) are examples of standalone editors based on Scintilla.

使用中的 Scintilla 编辑组件 (SciTe)

Scintilla Editing Component

特点

Scintilla supports many features to make code editing easier in addition to syntax highlighting. The highlighting method allows the use of different fonts, colors, styles and background colors, and is not limited to fixed-width fonts. The control supports error indicators, line numbering in the margin, as well as line markers such as code breakpoints. Other features such as code folding and autocompletion can be added.


关于objective-c - 支持多语言的 objc 语法高亮库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10062083/

相关文章:

Objective-C:在命名变量时使用 _(下划线)

objective-c - 'attach' 一个按钮如何连接到另一个进程的窗口?

language-agnostic - 来自多种编程语言的保留关键字的单一集合?

python - 有没有办法使用 Pygments(或其他库)突出显示函数调用?

javascript - iOS 使用 UIWebView 使用 Math.pow 执行 JavaScript 字符串

ios - ReactiveCocoa 将单个信号转换为值

objective-c - NSMenu 内的 NSTextField - 不交互或看起来不符合预期

macos - 带有预设行的静态 NSTableView

objective-c - 标签更新为空

syntax-highlighting - 为什么 "linenos"选项无法在 Jekyll 中添加行号?