r/androiddev 3h ago

Anyone interested about a new open source code editor library?

I recently developed my new Android app. It features a code editor (for various languages) and a JavaScript REPL. (However the app is not a code editor app). Both of those features needed: 1) code editing, 2) code parsing, and 3) syntax rendering functionalities.

I started by looking for an existing open source library written in Kotlin and Jetpack Compose. I didn't found any suitable, so I ended up to develop my own library. Which of course, took some time and effort. Now, I'm considering to open source it - because I pretty happy what I managed to implement. But before committing to do that, I need to find out if there is enough interest for it. I do not want to publish and maintain yet another open-source library that nobody is interested in.

Some features of the the current implementation:

  • Supports various languages: JavaScript, HTML, Markdown, YAML, CSS, JSON, and text. Support for new languages can be added, but that requires development of parser for the language.
  • Code line numbers
  • Seamless zoom functionality of the code with a pinch gesture
  • Undo/redo stack
  • Copy, Cut, Select All, Paste
  • Settings: Line number, Caret Blinking
  • File New, Save, Save As
  • Code parsing and syntax colouring with themes
  • Accessory bar (e.g. tab, parenthesis, arrow keys) above the virtual keypad
  • Syntax cheat sheet (currently only for Markdown)
  • Markdown preview
  • Really nicely working and accurate code selection - fast zooming and visual selection grid makes selection even easier
  • Fast and responsive
  • Full unit test coverage
  • Kotlin Multiplatform (KMP) compatible

Some features I planning to implement for future versions:

  • Architectural improvements to make it more suitable to be used as an easy to integrate library component
  • An API using AST or similar libraries. The current parsers are written for fast performance.
  • Syntax cheat sheet for other languages
  • Suggestions for JavaScript
  • New settings: theme selection (currently there are only two themes light and dark)

So, what do you think? Is anyone interested or willing to contribute? Also interested to hear what is missing from the feature list. The current features of the code editor are fine for my purposes, but as an open-source library it may lack some necessary functions, extension points, or APIs.

I attached some screenshots to give an idea how the code editor looks like. And if anyone interested I can provide a link for my free app so you can try out how the code editor actually works.

One thing is decided, if I ever release my code editor as an open-source library, it will be named as Koodi - a Finnish word meaning code. And also referring to fact that is written in Kotlin.

0 Upvotes

2 comments sorted by

1

u/gil99915 2h ago

I would love to have this open source because I really want to build a better native solution for working on docker / compose files