kotlin_java_language_server
VSCode extension + Language Server Protocol (LSP) lightweight server for Kotlin, Java, and C files.
Release Notes
0.1.11
- Kotlin & Java lambda parameters: Index lambda parameters (parenthesized and single-param forms) and emit them as
parameter symbols so lambda arguments can be navigated.
- Kotlin destructuring: Detect destructuring declarations (
val (a, b) = ..., for ((k, v) in ...)) and function parameter destructuring.
- C macros & typedefs: Index
#define macros as macro symbols and correctly recognize function-pointer typedefs (e.g., typedef void (*cb_t)(int)) as typealias.
- Tests & packaging: Added unit tests for sample files and produced the VSIX package
kotlin-java-language-server-0.1.11.vsix.
0.1.10
- C local symbol parsing: C function-local variables are now indexed for navigation, including declarations such as
size_t dlen, clen; and int val;
- Improved C F12 support: Go to Definition can now jump to local C variables like
clen and val inside the current function
0.1.9
- C Breadcrumbs fix: C functions now stay visible in Breadcrumbs when the function signature spans multiple lines or the opening brace appears on a later line
- Improved C function parsing: Multiline C function signatures now produce hierarchical
DocumentSymbol ranges that cover the full function body
0.1.8
- Output logging: Added dedicated Output and Trace channels for language-server logs in VS Code
- Error visibility: Startup failures and uncaught server errors are now written to Output and revealed automatically on error
0.1.7
- Breadcrumb symbol path: Kotlin, Java, and C now return hierarchical
DocumentSymbol trees so VS Code Breadcrumbs can show the current type and function or method path
- Improved symbol ranges: Type and executable symbol ranges now cover their full scopes, which makes current-scope detection work inside method and function bodies
0.1.5
- Symbol search ranking: Workspace symbol results are now sorted by relevance — exact match → prefix match (CamelCase preferred) → contains match
- ViewBinding in
# search: Typing ActivityMain in quick open (#) now resolves to the corresponding XML layout file
- Improved ViewBinding conversion: Better handling of edge cases like
HTTPResponseBinding → http_response.xml
0.1.4
- Phase 1: Enhanced symbol parsing — supports inner class, value class, annotation class, sealed permits, static nested class, companion object with name, annotated methods
- Annotation stripping: Robust handling of complex annotations (balanced parentheses)
- Control flow filter fix: No longer filters valid lines containing keywords in method bodies
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
- Breadcrumb symbol path: shows the current Kotlin / Java / C type and function or method in the editor path bar when Breadcrumbs are enabled
- 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.
- Breadcrumbs show the current symbol path for Kotlin, Java, and C files when
breadcrumbs.enabled is on.
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.11.vsix
| |