Mahib Hosain / Stripe / Open-source contributions

Metals + Bazel
Java at monorepo scale

I led Stripe’s Metals V2 rollout, built the BSP server connecting Bazel to the editor, and contributed upstream fixes for Java, generated sources, and protobuf navigation.

26M lines
JVM repository context at Stripe
BSP
A shared build interface for language tooling
VS Code / Cursor
Editor integration with Metals V2

The integration

A successful build is not enough for a useful editor. The language server also needs accurate source ownership, generated files, dependency classpaths, and current test information.

I worked with engineers at Cursor and Databricks, including onsite discussions, on Java support at Stripe’s scale. My work spanned the internal Bazel/BSP integration and contributions to the public Metals and VS Code extension repositories.

  1. BazelBuild targets and generated sources
  2. BSP serverBuild metadata for the editor
  3. MetalsLanguage intelligence
  4. VS Code / CursorNavigation, diagnostics, tests

Engineering decisions

Resolve generated files to their build targets

Generated Java sources and symlinked roots need reliable target ownership. My upstream changes connect those files to the right build context and avoid stale diagnostics or inappropriate compile-on-focus behavior.

Prefer the target’s classpath, keep a fallback

When target classpaths and Turbine headers provide the same class, the target’s classpath takes priority. Headers remain a fallback for dependency symbols. Regression coverage checks generated protobuf builder methods; refreshed indexing includes Java package information.

Use current test information

Java Bazel test code lenses check the current SemanticDB document before offering run/test actions, so the editor uses current test-class information.

Fit the language server into existing tooling

A custom launcher allows the VS Code extension to start a Metals-compatible stdio server through existing proxy and observability tooling. Normal language-client wiring stays in the extension.

Public evidence

These contributions were made under my work account, mahib-stripe. The linked PRs contain the implementation, review context, and verification notes.

I’m also quoted in Databricks’ Metals V2 launch article. The 26M-line figure describes Stripe’s JVM repository, not an independently measured user count. This case study documents my contribution to a wider collaborative project; the internal BSP implementation remains private.

← PortfolioLanguage upgrades at Stripe →