kotlin_java_language_server
VSCode extension + Language Server Protocol (LSP) server for Kotlin, Java, and C files.
Supported features
- Kotlin (
.kt, .kts), Java (.java), and C (.c, .h) documents
- Kotlin syntax highlighting (TextMate grammar)
- Document Symbol (
@ in VSCode quick open): lists symbols for current file
- Go to Definition (
F12 / cmd-click): resolves symbols from open documents, then falls back to full-project scan when needed
- Workspace Symbol (
# in quick open): searches open documents first, then falls back to full-project scan when no match is found
- Quick Symbol Search in Project (editor right-click menu): searches the workspace from the word under cursor and provides jump targets
- Android ViewBinding mapping:
ActivityDeviceInfoBinding automatically maps to res/layout*/activity_device_info.xml for direct jump
Current scope intentionally focuses on symbols that are already opened in VSCode.
Architecture
src/extension.ts: VSCode Language Client
src/server.ts: Node-based LSP server
src/symbols.ts: Kotlin / Java / C symbol parsing and cursor word extraction
This follows the standard VSCode Language Client + Language Server split architecture.
Install dependencies
npm install
Build
npm run compile
Run in VSCode (manual review)
- Open this repository in VSCode.
- Run
npm run compile.
- Press
F5 to launch an Extension Development Host.
- In the new window, open a Kotlin, Java, or C file.
- Verify:
Cmd+Shift+O (or quick open with @) shows symbols from current file.
F12 on a symbol jumps to its definition when the defining file is currently open.
Package and install in local VSCode
- Install VSCE:
npm install -D @vscode/vsce
- Create VSIX:
npx vsce package --allow-missing-repository
- Install VSIX:
code --install-extension kotlin-java-language-server-0.1.0.vsix
| |