Skip to content
Back to home
Back to blog
Feature

The Code Editor Android Deserves: LSP, IntelliSense & More

A real code editor for Android: LSP language servers, semantic autocomplete, TextMate syntax highlighting, multi-cursor editing, code navigation and inline diagnostics — all on your phone.

8 min
By Pelayo Naredo
The Code Editor Android Deserves: LSP, IntelliSense & More

Most "code editors" on Android are glorified text boxes. They lean on Android's TextView, choke on a 2,000-line file, and offer nothing that would make a real developer trust them with production code. You get syntax colors if you're lucky, and that's the end of it. So the moment a bug needs fixing on the go, you reach for your laptop anyway.

PocketCode takes the opposite approach. Its code editor for Android is built on Sora Editor, a high-performance engine backed by a gap-buffer data structure. Unlike TextView-based solutions, Sora avoids an O(n) copy on every keystroke, so large files stay smooth. On top of that engine, PocketCode layers the things you'd expect from a desktop IDE: LSP language servers, semantic autocomplete, real syntax highlighting, multi-cursor editing, and deep code navigation. Here's what that actually looks like.

Syntax highlighting that isn't a toy

Highlighting is powered by TextMate grammars (the same .tmLanguage.json format that VS Code uses), processed by the tm4e engine. That covers 33 languages out of the box — Kotlin, Java, Python, JavaScript, TypeScript (and TSX), Go, Rust, C, C++, C#, PHP, Ruby, Swift, Scala, SQL, YAML, TOML, Dockerfile, and more — each mapped to its proper TextMate scope and file extensions.

To keep the editor responsive on a phone, PocketCode ships its own IncrementalTokenizer that paints tokens instantly instead of waiting for the full TextMate pass to finish. Around that you get the editor essentials that make code readable: configurable line numbers, matching brace and parenthesis indicators, visual indentation guides, and code folding for functions, classes, methods, interfaces, comment blocks, import blocks, and custom regions — with nested folds and a fold state that persists per file.

Language detection is automatic, by extension (CodeLanguage.fromExtension()) or by filename (CodeLanguage.fromFileName(), which recognizes Dockerfile, Makefile, .gitignore and friends), falling back to plain text when nothing matches.

Autocomplete and IntelliSense, powered by LSP

This is where PocketCode stops being a mobile toy and starts being an IDE. The editor includes a full Language Server Protocol client — LspClient, implementing LSP 3.17 — that connects to standard external language servers (clangd, pyright, and others). Communication runs over JSON-RPC 2.0, with full language-server lifecycle management and automatic reconnection if a server drops.

That LSP client is what turns basic completion into real IntelliSense. Here are the eight capabilities it implements:

LSP methodFeature
textDocument/completionSemantic autocomplete
textDocument/hoverDocumentation on hover
textDocument/definitionGo to definition
textDocument/referencesFind references
textDocument/signatureHelpFunction parameter hints
textDocument/formattingServer-assisted formatting
textDocument/renameSafe semantic rename
textDocument/publishDiagnosticsReal-time server diagnostics

The Sora engine also provides its own native floating autocomplete window, so you get completion even before wiring up a language server. And for AI-assisted writing, a Ghost Text layer renders suggestions as semi-transparent inline text after the cursor, with a 150 ms grace window before minor cursor movements dismiss it — accepting a suggestion inserts the full text while preserving your undo/redo history, and it never fights the standard autocomplete engine.

Editing power: multi-cursor, Emmet, and a symbol keyboard

Typing code on a phone is only painful if the editor makes it painful. Pocket Code's MultiCursorEngine lets you drop additional cursors at arbitrary positions and edit every one of them simultaneously, with clean offset ↔ line/column conversion and the ability to remove individual cursors while the rest stay active.

Emmet is fully supported for HTML and CSS: ul>li*3 expands to a nested list, div.cls#id becomes <div id="id" class="cls"></div>, and CSS shorthands like dfdisplay: flex or w100pwidth: 100% all work.

Because phone keyboards weren't designed for code, a programming symbol bar sits above the system keyboard. One section inserts the characters you actually need — { } [ ] ( ) ; : = and the rest — and another exposes actions: undo/redo, move a line up or down, toggle line (//) or block (/* */) comments, duplicate the current line, go to a line, sort selected lines, and transform case (UPPER / lower / Title). Add pinch-to-zoom font sizing, a magnifier on long-press for precise cursor placement, and unlimited undo/redo, and the small screen stops being an excuse.

A real editor is judged by how fast you can move through a codebase. PocketCode gives you the full navigation kit:

  • Go to symbol — a fuzzy-filtered dialog over the active file, covering functions, methods, classes, interfaces, properties, variables, constants, imports and regions, each shown with a context line.
  • Outline panel — a slide-out tree of the file's structure that updates live as you edit.
  • Peek definition — an inline popup showing ~10 lines of context around a symbol's definition, without moving your cursor.
  • Go to references — every reference across the project, visually distinguishing definitions from uses.
  • Rename symbol — finds all occurrences project-wide, separates code from strings/comments, and shows a preview before you apply.
  • Global search — text or regex across all project files, filterable by extension, bound to Ctrl+Shift+F.
  • Command palette — a VS Code-style fuzzy entry point to every editor action.
  • Auto-import — scans for undefined symbols and suggests the right imports for Kotlin, Java, Python, TypeScript, JavaScript and more.

Diagnostics without a server

You don't always want to spin up a language server, so PocketCode ships a local InlineDiagnostics engine that catches problems in real time using per-language rules — no LSP required. It carries rules for Kotlin, Java, JavaScript/TypeScript, Python, Go, Rust, PHP, CSS, HTML and JSON.

Universal rules flag trailing whitespace, excessive consecutive blank lines, and TODO / FIXME / HACK / NOTE / BUG / WARN comments. Language-specific rules go further — Kotlin !! usage, JavaScript == instead of === or var instead of let/const, Python inconsistent indentation and unused imports, malformed JSON. Everything surfaces in a VS Code-style Problems panel, grouped by file and filterable by severity (ERROR, WARNING, INFO, HINT).

Where it can, the editor fixes things for you. Quick fixes appear next to diagnostics — clean up trailing whitespace, remove blank lines, and apply language-specific actions. And extract refactorings analyze the variables in a selection to pull out a method (with the right parameters and call site) or wrap an expression into a named variable, auto-indented to the correct level.

Formatting, on the device

Formatting is fully on-device — no external tooling, no network round-trip. Each language has its own formatter implementation:

FormatterLanguages
C-styleKotlin, Java, JS, TS, C, C++, C#, Dart, Go, Swift, Rust, PHP, Scala, Gradle
PythonPython (PEP-8 indentation)
XML/HTMLHTML, XML, SVG
JSONJSON (pretty-print or compact)
CSSCSS, SCSS, Less
YAML / SQL / MarkdownYAML, SQL, Markdown

Per-profile options let you set indentation size, max line width, whether to add a trailing newline, spacing around operators, and brace placement.

Built for the phone, not ported to it

The layout adapts across Phone Portrait, Phone Landscape, Tablet and Foldable form factors automatically. A Zen mode hides everything but the text, a split editor shows two files side by side, and contextual toolbar chips put Format, Find, Replace and Outline one tap away. Pretty much every action lives in an organized overflow menu, and there's an offline mode so editing, local execution and Git keep working with no connectivity.

One honest note: real-time collaboration is on the roadmap but not shipping yet. The collaboration panel exists as a UI prototype with no backend — cursor sync and shared sessions are planned, so we're not going to pretend they work today.


A phone is no longer an excuse to write code with a worse tool. PocketCode's editor brings the parts that actually matter — LSP-backed autocomplete and IntelliSense, TextMate syntax highlighting across 33 languages, multi-cursor editing, and full code navigation — to the device that's always in your pocket.

Code editor for Android: quick answers

Is there a good code editor for Android? Yes — PocketCode brings LSP autocomplete, highlighting for 33 languages, multi-cursor and built-in Git to the phone.

Can you code on Android without a computer? Yes — write, run and debug on the phone alone, offline.

A code editor with a terminal? Yes — the editor sits next to a built-in terminal (SSH/SFTP) and on-device runners, so you edit and run in one app.

Does it have Git? Built-in: commit, diff, blame, branches — no external client.

Free and ad-free? The full editor is free, no ads.

Offline? Completely — editor, runtimes and Git all work with no connection.

PocketCode is heading to Google Play. Join the pre-registration to be among the first to try it on your own device.

The tool behind this article

Code Editor

Ready to try PocketCode?

Download the app and start coding from your mobile.