Typing in a big Java class in VS Code, my editor lagged. I'd type a dot and wait for completion. The bigger the class, the longer the wait, and the files I worked in most were the big ones.

To suggest what comes after order., a language server needs only the declarations the cursor can see and the method it's in.

So I built Language Server for Java by Bitno, with javac itself in its process, analyzing only what each request needs. Now completion keeps up with my typing in big classes, and the editor no longer stutters.

A sealed switch's missing cases completed at once, then each case filled in

Private, fast, secure and free

  • Private: no telemetry, no account; it talks only to Adoptium, for its own Java runtime and for a JDK your project is missing after asking, and, through Gradle and Maven, to the repositories your build names.
  • Fast: completion analyzes only the method at the cursor, other files are read without their method bodies, and the builds you imported before are restored at start, so it works before the reimport finishes.
  • Secure: every JDK it downloads is checked against Adoptium's SHA-256 before it's unpacked, and your repositories' credentials stay with Gradle and Maven; the server never reads them.
  • Free: because I think developer tools should be.

Install it

Completion that looks only at the method you're in

When you type, the editor asks for completion first, right after the keystroke, on a version of the file nothing has analyzed yet. So the server doesn't analyze that file. It analyzes a stand-in: the same text, with the body of every method but the one at the cursor replaced by blanks. The line breaks stay, so every line and column is still the editor's.

javac type-checks the declarations and the one method body, completion reads the types it needs, and the stand-in is thrown away. It's never kept and never shown: it would report errors your file doesn't have, such as a missing return in a blanked method. Diagnostics, hover and the rest analyze the real file in full, as before.

What it suggests is ranked by the type expected where you are:

  • constructors after new;
  • the missing cases of a sealed switch, all at once;
  • lambdas where a functional interface is expected;
  • chains of calls that end in the type you need, with auto-import and Javadoc.

javac, as your build runs it

It's javac, the compiler your build uses, through its public APIs. The server analyzes; Gradle and Maven still compile, through Bitno's language servers for them. So the editor runs your build's own javac plugins as you type, Error Prone and NullAway at their versions and settings, and reports what your build reports.

There's nothing to set up. Open a folder with a Gradle 9 or Maven build on Java 17 to 27. You don't install a JDK for the server: on its first start it downloads its own from Adoptium, about 140 MB, into ~/.jdks.

Rename, find references, implementations, and type and call hierarchies work across every project in the build.

References of Money.plus found in two projects, the method renamed, and Checkout calling the new name

What's next

Debug, more refactorings and Bazel builds aren't there yet. It's in early development, so expect rough edges; your issues decide what comes after.

If it doesn't work on your machine

Every issue comes straight to me: it always works on my machine, and I'll make sure it works on yours too.

A keycap says "Works on my machine…", three keycaps frown, then smile when it adds "…and it will work on yours too."

Who's behind it

I'm Marko, from Serbia. I build the tools I wished I had in my own work, the Bitno extensions. They're free, because I think developer tools should be.

Marko Milic on LinkedIn: Agentic Engineer, Java Backend and Developer Tooling, creator of Bitno VS Code Extensions

References