How georgewfraser/java-language-server works
Project type and purpose
• This is a language-server implementation for Java, packaged as a VS Code extension (and usable in other editors via scripts).
• It comprises two main layers:
a. A Node/TypeScript “extension” client (in lib/, package.json, and the dist/ scripts) that runs inside the editor’s extension host.
b. A standalone Java process (built with Maven from src/main/java) that implements the Language Server Protocol (LSP) and Debug Adapter Protocol (DAP) using the Java Compiler API.
File structure
• Top-level:
• lib/: TypeScript entry point (extension.ts), TextMate grammars, language-configuration.json, snippets, package.json
• src/main/java/: Java LSP & DAP server code (packages org.javacs.*) plus Bazel protobuf definitions under src/main/protobuf
• dist/: shell+cmd launch scripts for the language server, debug adapter, and client launchers
• scripts/: CI/helper scripts (build, download JDK, format, link, release)
• .github/, git_hooks/: CI & formatting hooks
• README.md: overall description and usage
• Patterns:
• LSP and DAP JSON-RPC over STDIO
• Node “extension” spawns child process for language server and/or debug adapter
• Java server uses incremental compilation by erasing method bodies, communicates with editor via LSP requests/responses
README for additional insights
• Describes features (autocomplete, go-to-definition, hover, lint, debug).
• Shows that the TypeScript code is minimal: its job is to download/link binaries and then launch the Java process with the correct script.
• Build toolchain: npm for the extension, Maven & protobuf for the Java server.