README 未给出具体版本号,需自行到 Maven Central 查询最新版本;TextMate 与 TreeSitter 支持可能需要额外依赖或配置,README 未展开说明
sora-editor
RosemoeLGPL-2.1活跃维护面向 Android 的多功能代码编辑器库,提供语法高亮、自动补全等能力,帮你在 App 里快速嵌入可编辑代码的视图组件。
A multifunctional Android code editor library. (aka CodeEditor)
implementation 'io.github.rosemoe:editor:<version>'README 未说明
Android 平台的多功能代码编辑器库,帮你在 App 里快速嵌入带高亮和补全的编辑控件
面向 Android 的多功能代码编辑器库,提供语法高亮、自动补全等能力,帮你在 App 里快速嵌入可编辑代码的视图组件。
核心能力
- 增量式语法高亮,编辑时只重算变化区域
- 支持带代码片段的自动补全与自动缩进
- 内置撤销重做、查找替换和自动换行
- 支持 TextMate 与 TreeSitter 语法解析
- 提供诊断标记、括号配对高亮与粘性滚动
容易踩的坑
- 0.24.7pre-release最新正式版2026-10-17 · 2026-10-17 11:02 UTC
Editor Core
- add
FormatterProviderandExtraStylesProviderfor custom formatting and styling (#871 by @KonerDev) - support multiple providers for diagnostics, inlay hints, highlighted text and extra styles (#871 by @KonerDev)
- improve text measurement cache reuse when line content is unchanged
- fix wordwrap layout hanging due to incorrect character iterator boundaries (#889 by @jrvaghela72)
- fix backgrounds of matched and highlighted text not being drawn when only one line is visible (#882)
- fix control character rendering and positioning (#863)
- fix scrollbar drawing interfering with the line info panel (#859 by @jeeneo)
- avoid crashes when invalid span lists are received (#872)
- fix index out of bounds during symbol pair matching when text is empty (#861)
Editor LSP
- support custom request timeouts per language server definition (#867 by @KonerDev)
- add
LspEditorhelpers for definition, references, prepare-rename and rename requests (#879 by @KonerDev) - support progress reporting, progress cancellation and trace control (#879 by @KonerDev, #893 by @dingyi222666)
- support custom JSON-RPC requests and notifications through the endpoint and event listener APIs (#879 by @KonerDev)
- support explicit language IDs for server selection and document opening (#881 by @RohitKushvaha01, #885 by @KonerDev)
- fix diagnostic publishing and add bulk diagnostic updates (#869 by @KonerDev)
- fix incorrect file URI conversion (#865)
- improve cleanup of TCP and local socket connections (#893 by @dingyi222666)
TextMate
- fix text background colors not being rendered (#864)
- fix unformatted scope names in tm4e logs and lower missing grammar/include and removed rule logs to debug level (#898)
Oniguruma Native
- update Unicode data to 18.0.0
Demo App
- replace the Java-based Lua language server with native EmmyLua Language Server 0.25.1, bundled for all four Android ABIs (#893 by @dingyi222666)
- update Lua grammar and language configuration (#893 by @dingyi222666)
- update JavaScript language configuration
Compatibility Changes
- The minimum supported Android API level is raised from 21 to 23 (Android 6.0).
editor-lspcontinues to require API 26. CodeEditor.setDiagnostics(),setInlayHints()andsetHighlightTexts()are replaced by the corresponding provider registration APIs. Register providers withregisterDiagnosticProvider(),registerInlayHintProvider()andregisterHighlightTextProvider(), and call the correspondinginvalidate...()methods when their data changes.- Kotlin is updated to 2.4.10, with Kotlin language version 2.4.
- add
- 0.24.6pre-release2026-06-10 · 2026-06-10 04:42 UTC
查看更新说明
Editor Core
- improve algorithm of collecting sticky lines
- add min width for minimap region
- add inlay hint setter
- enhance emoji text deletion on low API devices
- fix cursor anchor position for IME under wordwrap mode (https://github.com/Xed-Editor/Xed-Editor/issues/1331)
- update no completion checking logic (#850 by @KonerDev)
- add
Ctrl+Spaceto trigger completion (#844)
Editor LSP
- fix NPE in signature text generation (#829)
- fix possible dead loop in Markdown text parsing (#845)
- enhance document color support and inlay hints (#830 by @KonerDev)
- enhance LSP completion overlap, character index bounds (#850 by @KonerDev)
TextMate
- add documentation for
TextMateLanguageand remove deprecated constructors - initialize color scheme on theme creation (#806)
TreeSitter
- add cancellation token for variable analysis to reduce delay in large files
As android support libraries are moving minSdk to 23, this will be the last release that supports API 21. From next release, we will raise the minSdk to 23.
- 0.24.5pre-release2026-03-17 · 2026-03-17 03:03 UTC
查看更新说明
Editor Core
- add
PublishDiagnosticsEventfor diagnostics changes (#781 by @dingyi222666) - add
InlayHintClickEventwhen inlay hint is clicked exactly - add preserve-case replace (#792)
- add experimental minimap (API is unstable yet) (#766)
- improve auto completion experience (#795 by @KonerDev)
- allow adding custom variable resolvers for code snippets (#801)
- avoid lag when text is too long when creating info for accessiblity
- add option to ensure search occurrence is visible (#816 by @KonerDev)
- cut memory usage for Latin1 charset in text buffer
- update highlight as initial analysis goes to improve experience for long files
- fix wrong text style of line info panel sometimes
- fix leading whitespaces are sometimes not visible
- fix
SymbolInputViewalways overrides the background defined in XML attributes - fix possible ANR when scrolling completion list (#800 by @nullij)
- fix possible NPE when drawing text background (https://github.com/Xed-Editor/Xed-Editor/issues/1156)
- fix possible IOOB on completion (#812 by @KonerDev)
Editor LSP
- improve LSP lifecycle and error handling (#777)(#804 by @KonerDev)
- add disable-feature option to server definition (#802)(#809 by @KonerDev)
- add support for multi-line code block with multiple bacticks in markdown renderer (#814)
- fix thread violation when updating UI in LSP (#793 by @mucute-qwq)
- fix hover window not showing (#796)(#809 by @KonerDev)
- fix unnecessary stop of language server wrapper (#808 by @KonerDev)
- fix crash due to inlay hint and document color request cancellation in LSP (#813)
TextMate
- fix wrong span type is chosen when token has underline style (#820 by @META-Xiao)
- fix highlight analysis failure when underline color is undefined
Monarch
- fix wrong span type is chosen when token has underline style (#820)
Demo App
- migrate to Material 3 theme and components
- add simple example for paged editing for super long files
- add
- 0.24.4pre-release2026-01-17 · 2026-01-17 06:51 UTC
查看更新说明
Editor Core
- improve rendering speed when there are many highlighted text backgrounds
- add event for diagnostics update (#773, #781 by @dingyi222666)
- fix a problem that leads to selection can not be correctly placed when tab is in line (#786)
- fix wrong composing text state can be reported to IME (#782, #783)
- fix externally committed tab may remove active composing text (#784)
- fix multi-line indentation for tab-indented languages (#785)
- fix composing text underline becomes unexpectedly hidden when the composing text is partially invisible
- update snakeyaml-engine to v3
Editor LSP
- improve completion prefix computation (#763 by @dingyi222666)
- add language connection status change event (#778 by @KonerDev)
TreeSitter
- update android-tree-sitter to support 16KB page size for newer Android platform (thanks to @itsaky)
- 0.24.3pre-release2025-12-15 · 2025-12-15 06:05 UTC
查看更新说明
Editor Core
- add more line-break opportunities for better programming code reading
- select auto-completion item by Tab and Enter (#768)
- add border color customizations (#764)
- fix a potential problem in calculating horizontal scrolling range (#775)
- fix a problem in line width re-calculating when wordwrap is disabled
- fix wrong background for empty line in certain situation
- enhance the access range check in
Contentfor better problem tracking
Oniguruma Native
- support 16KB page size for Android 15+ requirements (#770 by @itsvks19 )
Demo App
- add more bracket pair captures for tree-sitter Java
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
sora-editor is a cool and optimized code editor on Android platform
Read this in other languages: English, 简体中文, Español, 日本語.
Note that statements in other languages may not be up-to-date.
Work In Progress This project is still developing slowly.
Issues and pull requests are welcome.
Features
- Incremental syntax highlight
- Auto-completion (with code snippets)
- Auto indent
- Code block lines
- Scale text
- Undo/redo
- Search and replace
- Auto wordwrap
- Show non-printable characters
- Diagnostic markers
- Text magnifier
- Sticky Scroll
- Highlight bracket pairs
- Event System
- TextMate and TreeSitter support
Documentation
To quickly get started, please view this Quickstart Guide.
To check out all docs, please visit Documentation Site.
Screenshots
Discuss
- Official QQ Group:734652304
- Official Telegram Group
Contributors
License
sora-editor - the awesome code editor for Android
https://github.com/Rosemoe/sora-editor
Copyright (C) 2020-2026 Rosemoe
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Please contact Rosemoe by email [email protected] if you need
additional information or have any questions
Acknowledgements
Thanks to JetBrains for allocating free open-source
licences for IDEs such as IntelliJ IDEA.
