Building Language Plugins With the Native LSP API
In a Nutshell
Vladimir's core message: build language plugins for JetBrains IDEs in 77 lines of Kotlin by exposing compiler stages (parser, type-checker, formatter) as reusable services instead of a monolithic pipeline, then connect them via the Native LSP API. The payoff is immediate multi-editor support (syntax coloring via TextMate/Tree-sitter, diagnostics, quick-fixes, formatting) without rewriting parsers for every tool, while the same “manifold” architecture lets the compiler itself power linters, formatters, and package managers. Limitations remain—features needing PSI-level trees or partial-program analysis still need a full IntelliJ plugin—but for experimental or resource-constrained languages, LSP-first delivers usable support in weeks rather than years.
These notes were generated by AI and may contain inaccuracies.
Vladimir Logachev presents on building language plugins for JetBrains IDEs using the Native LSP API. The talk addresses what it takes to bring a language to JetBrains IDEs and the trade-offs involved in getting things working without payment. The presentation targets language creators or those considering starting a new language.
Users expect to continue using their existing IDEs when adopting a new language, as they will use it alongside other languages in their projects. To provide free functionality, compilers must expose individual processing stages for input and output rather than operating as a monolithic pipeline.
Vladimir has nine years of software engineering experience, having worked with Haskell, Scala, Elm, and TypeScript, with a focus on functional programming. The presentation demonstrates concepts using his experimental language called Awsum, which is a functional language emphasizing safety features including safe recursion, memory safety, and safe arithmetic operations. Awsum supports multiple compilation targets and operating systems but remains in early development stages.
To evaluate language development decisions, creators should consider the experience of users who must adopt the language at work rather than by choice. Users encountering a new language need immediate support including syntax highlighting, type error detection, type hints on hover, and formatting capabilities without switching editors. When compilers operate separately from user environments, users face difficulties.
Awsum is implemented in Haskell using GHC 9.12, released December 2024. Following this release, formatters and linters were completed in approximately 1.5 months, language server support required 5.5 months, and a usable package set was ready after seven months. As of November 10th, 2026, GHC 9.12 remains a non-recommended compiler version.
Supporting multiple editors (five in this case) provides broader accessibility than focusing on single-editor integration. The approach leverages existing compiler components: parsers feed into pretty printers for formatting, language servers utilize compiler stages and formatters to serve all editors, and syntax highlighting requires separate grammars for different editor ecosystems.
Syntax highlighting requires TextMate grammars for JetBrains IDEs and VS Code, while Neovim, Emacs, and Zed require Tree-sitter grammars. AI can generate these grammars from existing parsers, with property-based and case-based tests ensuring correctness against the compiler. Since LSP servers handle correctness through compiler delegation, AI-generated grammars only affect syntax coloring, making potential errors on untested programs an acceptable risk.
The Minimalistic Language plugin demonstrates core functionality including type error detection with display in the Problems tab, warning identification such as unused arguments, and quick fix suggestions. The plugin itself contains no language understanding beyond LSP server connection, with all functionality implemented within the compiler. The LSP implementation handles large files with acceptable performance.
The IntelliJ Platform supports approximately 30 features through LSP implementation, though the Minimalistic Language plugin utilizes only eight of these. Features vary in implementation cost, with some requiring advanced compiler machinery for handling partially broken code during active editing.
The language plugin implementation required five files totaling 77 lines of Kotlin code. The implementation includes server lifecycle management triggered by file extension detection, executable invocation through standard input/output communication, TextMate grammar provisioning, and dependency declarations for the platform, LSP, and TextMate plugins. An override specifies that only the language server should handle file formatting based on extension.
The experimental language changes frequently, requiring tooling and editor support to remain compatible with the latest release. The approach involves shipping all components (compiler, tooling, editor support) with identical version numbers on the same day, supporting only the latest compiler version during the experimental phase. Marketplaces requiring A.B.C version formats necessitate adjustments. A handshake procedure during LSP client-server initialization passes the expected compiler version, with mismatch notifications directing users to update plugins or proceed despite incompatibility.
A custom restart server command was implemented because JetBrains IDEs provide restart widgets without assignable action IDs for keyboard shortcuts. This implementation mirrors the approach used in IDE 2026.3.
Publishing involves pushing tags to trigger GitHub builds, followed by manual marketplace uploads. Initial publication required additional review time, but subsequent releases follow streamlined processes. JetBrains Marketplace provides advance notifications about deprecated API usage, allowing sufficient time for updates.
The plugin's minimal size results from designing the compiler as a manifold rather than a pipeline, exposing individual stages for separate access. This enables tooling reuse without requiring separate parser implementations across different languages and release cycles. The approach uses the existing Haskell LSP library (also used by Haskell Language Server) for protocol handling and state management.
Scala 3 exemplifies this approach by exposing multiple compiler stages and outputs, enabling direct compiler error integration in IntelliJ Scala plugins while Scalafmt maintains a separate parser. GHC provides stage access but faces challenges from separate tooling maintenance with distinct release cycles and dependencies. Elm represents a pipeline approach where the compiler accepts sources and produces JSON error reports, JavaScript output, or documentation, requiring ecosystem tools to maintain separate parsers and compiler versions.
The first implementation step involved property testing for the parser using round-trip tests with arbitrary AST generation. This foundation enabled formatter implementation since formatting essentially involves parsing user code and rendering it back with additional source information preservation. The same AST generation machinery supports grammar testing through Tree-sitter queries.
LSP cannot address features requiring syntactic trees within the IDE rather than the server, including language injection scenarios, complex refactorings, and cross-language references. These require full IntelliJ platform plugin implementations representing significantly more work.
Source code for both the language and plugin is available on GitHub. Documentation for IntelliJ LSP support is referenced in the presentation.
The compiler stops at the first error encountered rather than continuing to report multiple errors. This approach provides better user experience than systems that generate numerous errors from single issues, avoiding overwhelming users with 200+ errors. Users proceed through errors sequentially, receiving immediate red underlines for problematic code even without advanced highlighting below the error location.
TextMate and Tree-sitter grammars provide syntax highlighting that continues functioning regardless of compiler errors, as these grammars handle only coloring without type information or correctness validation. Advanced compiler information becomes unavailable until errors are resolved.
Migrating from LSP to full PSI implementation would require substantial work with significant differences in approach. However, implementing something functional using AI assistance with verification is preferable to not implementing language support at all. The migration process involves bringing existing parsers into the PSI and IntelliJ framework, ensuring parsers continue processing despite errors with error messages injected into AST trees, and maintaining feature functionality with incomplete code.
Keep JetBrains in your library
Save the videos and channels worth coming back to, and find them again in one place.

